gh-search
Skill4 starsChanged 6 months agoMITView on GitHub
GitHub CLI (`gh search`) operations for searching code, commits, issues, pull requests, and repositories with structured JSON output. You MUST load this skill when working with the `gh search` command.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- lhotwll217/owner-operatortheir own version, first seen Nov 16, 2026
- aaddrick/gh-cli-searchtheir own version, first seen Oct 17, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- aaddrick/gh-cli-search★ 9same name
- lhotwll217/owner-operator★ 8same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository124 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/AGENTS.mdAGENTS.md
- .github/workflows/AGENTS.mdAGENTS.md
- .vscode/AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- agent-log-analysisSkill
- agent-mdSkill
- agent-md-writerSkill
- agent-skill-md-writerSkill
- agentskillsSkill
- agents-md-writerSkill
- ai-prompt-writerSkill
- ansibleSkill
- apache-airflow-apiSkill
- apache-airflow-dagsSkill
- astro-cliSkill
- astronomer-docsSkill
- awesome-copilotSkill
- brainstorm-agent-runsSkill
- brainstorm-github-prSkill
- brainstormSkill
- catSkill
- chrome-devtoolsSkill
- claude-docsSkill
- codeqlSkill
- code-reviewSkill
- code-tourSkill
- coding-standard-writerSkill
- context-aware-opsSkill
- copilot-cliSkill
- copilot-docsSkill
- critical-thinkingSkill
- datadog-agentSkill
- datadog-apiSkill
- datadog-mcpSkill
- datadog-monitorsSkill
- datadog-pulumiSkill
- devcontainerSkill
- dictationSkill
- direnvSkill
- dockerfileSkill
- dockerSkill
- docs-reviewSkill
- docs-writerSkill
- dot-claudeSkill
- dotfilesSkill
- dot-githubSkill
- editorconfigSkill
- fact-writerSkill
- gdpr-compliantSkill
- gh-agent-taskSkill
- gh-apiSkill
- gh-aw-compileSkill
- gh-aw-firewall-debugSkill
- gh-aw-firewallSkill
- gh-aw-newSkill
- gh-awSkill
- gh-aw-troubleshootingSkill
- gh-codespaceSkill
- gh-issueSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 3 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Use gh search to query GitHub for code, commits, issues, pull requests, and repositories.
- Distinctive: line 13
Prefer structured JSON output over manual text parsing.
- Distinctive: line 18
When looking for issues or PRs that match specific criteria (labels, state, author) across an entire organization.
- Distinctive: line 24
When attempting to perform automated code modifications or refactoring across multiple repos.
- Very specific: line 25
If you just need to view a single known issue or PR by its number (use gh issue view or gh pr view).
- Very specific: line 82
Use --json to request specific fields and output in structured JSON format.
- Very specific: line 83
Always use --limit to bound the results, especially when searching across all of GitHub.
- Very specific: line 84
When searching within a specific repository, use the --repo="owner/repo" flag to narrow the search scope.
- Very specific: line 89
If a search returns no results, try broadening the query or removing filters like --extension or --label to isolate the problem.
- Very specific: line 94
Do not use grep or awk to parse the default tabular output of gh search.
- Very specific: line 95
Avoid unbounded searches (without --limit) if you only need a few examples or the latest item.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!-- markdownlint-disable MD013 MD023 MD031 MD032 -->gh-search Skill
Use gh search to query GitHub for code, commits, issues, pull requests, and repositories.
Prefer structured JSON output over manual text parsing.
When to Use
- To find examples of specific function usage or API patterns across millions of repositories.
- When looking for issues or PRs that match specific criteria (labels, state, author) across an entire organization.
- To programmatically aggregate repository metadata using structured
--jsonoutput.
When Not to Use
- For searching file contents within a small, local repository (use
greporrgdirectly instead of incurring API latency). - When attempting to perform automated code modifications or refactoring across multiple repos.
- If you just need to view a single known issue or PR by its number (use
gh issue vieworgh pr view).
Common Pitfalls
- Parsing Tabular Output: Attempting to use
awkorgrepon the default visual output instead of utilizing--jsonand--jq, leading to brittle scripts. - Unbounded Searches: Running a query without the
--limitflag, pulling down an overwhelming number of results that exhaust the API rate limit or the agent's context window. - Indexing Delays: Searching for code that was committed only minutes ago and assuming it doesn't exist when GitHub's search index hasn't caught up yet.
Commands / Usage Patterns
- Search Repositories:
gh search repos "query" --limit 10 --json nameWithOwner,description,urlExample output:[{"description":"RAG Framework...","nameWithOwner":"truefoundry/cognita","url":"..."}] - Search Pull Requests:
gh search prs --state=open --limit 10 --json number,title,repositoryExample output:[{"number":123,"repository":{"name":"repo"},"title":"Fix issue"}] - Search Issues:
gh search issues --state=open --label="bug" --limit 10 --json number,title,urlExample output:[{"number":456,"title":"Bug description","url":"..."}] - Search Code:
gh search code "functionName" --extension="js" --json path,urlExample output:[{"path":"src/index.js","url":"https://github.com/.../src/index.js"}] - Search Commits:
gh search commits "fix regex" --limit 10 --json sha,message,authorExample output:[{"author":{"login":"user"},"message":"fix regex","sha":"abcdef"}] - Search for dotfiles repositories:
gh search repos "dotfiles" --limit 20
Mindmap of Commands
mindmap
root((gh search))
code
Search within code
commits
Search for commits
issues
Search for issues
prs
Search for pull requests
repos
Search for repositoriesCore Principles
- Use
--jsonto request specific fields and output in structured JSON format. This avoids fragile parsing of tabular shell output. - Always use
--limitto bound the results, especially when searching across all of GitHub. Default limit is often 30, but explicit bounds ensure efficiency. - When searching within a specific repository, use the
--repo="owner/repo"flag to narrow the search scope. - For complex data extraction, combine
--jsonwith--jqto filter results on the client side.
Diagnostics and Troubleshooting
- If a search returns no results, try broadening the query or removing filters like
--extensionor--labelto isolate the problem. - Remember that code search has indexing delays; very recent changes might not appear immediately.
What to Avoid
- Do not use
greporawkto parse the default tabular output ofgh search. Always use--json. - Avoid unbounded searches (without
--limit) if you only need a few examples or the latest item.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

