From 97577e407ff3aee505aec675da081da75a24224a Mon Sep 17 00:00:00 2001 From: Waldir Pimenta Date: Fri, 25 Sep 2026 13:29:14 +0100 Subject: [PATCH 1/3] Document search operator support in `gh search` help The `--help` output of `gh search issues` and `gh search prs` lacked information on using boolean operators (`OR`, `AND`) and parentheses for nesting. Each operator must be passed as separate arguments; wrapping a whole query string in quotes makes it match as a single literal phrase, so the operators are treated as plain words, and the search will fail to capture relevant results rather than reporting usage of unsupported syntax. This patch updates the help text to make this nuance explicit to users. --- pkg/cmd/search/issues/issues.go | 6 +++++- pkg/cmd/search/prs/prs.go | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/search/issues/issues.go b/pkg/cmd/search/issues/issues.go index d17cde235cf..065cbde26fd 100644 --- a/pkg/cmd/search/issues/issues.go +++ b/pkg/cmd/search/issues/issues.go @@ -35,11 +35,15 @@ func NewCmdIssues(f *cmdutil.Factory, runF func(*shared.IssuesOptions) error) *c The command supports constructing queries using the GitHub search syntax, using the parameter and qualifier flags, or a combination of the two. + GitHub search syntax is documented at: On supported GitHub hosts, advanced issue search syntax can be used in the - %[1]s--search%[1]s query. For more information about advanced issue search, see: + %[1]s--search%[1]s query. Advanced search syntax, like boolean operators %[1]sOR%[1]s/%[1]sAND%[1]s, + and parentheses for nesting, must be passed as separate arguments, rather + than within a quoted multi-word string. This syntax is not supported with + %[1]s--web%[1]s. For more information about advanced issue search, see: Use %[1]s--search-type%[1]s to select semantic or hybrid (keyword + semantic) diff --git a/pkg/cmd/search/prs/prs.go b/pkg/cmd/search/prs/prs.go index 5f193165216..17d32645873 100644 --- a/pkg/cmd/search/prs/prs.go +++ b/pkg/cmd/search/prs/prs.go @@ -40,7 +40,10 @@ func NewCmdPrs(f *cmdutil.Factory, runF func(*shared.IssuesOptions) error) *cobr On supported GitHub hosts, advanced issue search syntax can be used in the - %[1]s--search%[1]s query. For more information about advanced issue search, see: + %[1]s--search%[1]s query. Advanced search syntax, like boolean operators %[1]sOR%[1]s/%[1]sAND%[1]s, + and parentheses for nesting, must be passed as separate arguments, rather + than within a quoted multi-word string. This syntax is not supported with + %[1]s--web%[1]s. For more information about advanced issue search, see: For more information on handling search queries containing a hyphen, run %[1]sgh search --help%[1]s. From 3bc352e06367cdae0dc8e708b1f7ddf0aa24c7eb Mon Sep 17 00:00:00 2001 From: BagToad <47394200+BagToad@users.noreply.github.com> Date: Tue, 29 Sep 2026 10:33:57 -0600 Subject: [PATCH 2/3] Remove host versions from project item-list help Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- pkg/cmd/project/item-list/item_list.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/project/item-list/item_list.go b/pkg/cmd/project/item-list/item_list.go index f924195d704..28f4e4416f8 100644 --- a/pkg/cmd/project/item-list/item_list.go +++ b/pkg/cmd/project/item-list/item_list.go @@ -41,8 +41,8 @@ func NewCmdList(f *cmdutil.Factory, runF func(config listConfig) error) *cobra.C Long: heredoc.Doc(` List the items in a project. - If supported by the API host (github.com and GHES 3.20+), the --query option can - be used to perform advanced search. For the full syntax, see: + If supported by the API host, the --query option can be used to perform + advanced search. For the full syntax, see: https://docs.github.com/en/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/filtering-projects `), Example: heredoc.Doc(` From b6289046c5b1db0220ffdd472e480387534d01c3 Mon Sep 17 00:00:00 2001 From: BagToad <47394200+BagToad@users.noreply.github.com> Date: Tue, 29 Sep 2026 10:33:57 -0600 Subject: [PATCH 3/3] Remove extra blank line in search issues help Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- pkg/cmd/search/issues/issues.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/cmd/search/issues/issues.go b/pkg/cmd/search/issues/issues.go index 065cbde26fd..455ab74d4a4 100644 --- a/pkg/cmd/search/issues/issues.go +++ b/pkg/cmd/search/issues/issues.go @@ -35,7 +35,6 @@ func NewCmdIssues(f *cmdutil.Factory, runF func(*shared.IssuesOptions) error) *c The command supports constructing queries using the GitHub search syntax, using the parameter and qualifier flags, or a combination of the two. - GitHub search syntax is documented at: