Skip to content

Commit 4a31d59

Browse files
BagToadCopilot
andcommitted
docs(skill): fix gh search query syntax guidance
gh search parses a bundled quoted query as a single phrase and fails with "Invalid search query". Document passing each qualifier as its own token or flag, and note the quoted-string form is only for the --search flag on pr/issue list. Co-authored-by: Copilot <[email protected]>
1 parent 3efd4d9 commit 4a31d59

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

skills/gh/SKILL.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,16 @@ Pass `--repo OWNER/REPO` (`-R`) to override the resolved CWD repo.
4848

4949
- `gh search issues|prs|code|repos|commits|users` uses GitHub's search
5050
index and accepts the full search syntax (`is:open`, `author:`,
51-
`label:`, `repo:owner/name`, `in:title`, ...). Pass the entire query as
52-
one quoted string, the same way you would for `--search`:
53-
`gh search issues "is:open author:foo repo:cli/cli"`. Prefer it for
51+
`label:`, `repo:owner/name`, `in:title`, ...). Pass each qualifier as
52+
its own bare token, not as one quoted string:
53+
`gh search issues repo:cli/cli is:open author:monalisa` works, but
54+
`gh search issues "repo:cli/cli is:open"` is read as a single phrase and
55+
fails with `Invalid search query`. Quote only multi-word free text
56+
(`gh search issues "broken feature"`). Most qualifiers also have a
57+
dedicated flag (`--repo`, `--author`, `--label`, ...). Prefer search for
5458
anything cross-repo or filtered by author/label.
55-
- `gh issue list --search "..."` and `gh pr list --search "..."` accept
56-
the same syntax but are scoped to one repo.
59+
- `gh issue list --search "..."` and `gh pr list --search "..."` take the
60+
query as one quoted string (it is a flag value) and are scoped to one repo.
5761

5862
## Issue types, sub-issues, and relationships
5963

0 commit comments

Comments
 (0)