gh-search-code
GitHub CLI: Search Code
Overview
Search for code across GitHub repositories using gh search code. Important: CLI API uses legacy search engine. For regex and advanced features, use -w flag to open in web browser.
When to Use This Skill
Use this skill when searching code across GitHub:
- Searching for code patterns across multiple repositories
- Finding specific file types or filenames in repos/orgs
- Locating code by language or file size across GitHub
- Searching in specific repositories or organizations
- Need to exclude certain results (requires
--flag) - Need regex search (use
-wto open in browser)
Syntax
More from aaddrick/gh-cli-search
gh-search-repos
Use when searching for repositories across GitHub - provides syntax for filtering by stars, forks, language, topics, license, archived status, and all repository attributes
22gh-cli-setup
Use when gh CLI is not installed, not configured, or authentication fails - provides installation steps, authentication methods, and troubleshooting for all platforms
6gh-search
Use when searching GitHub via CLI for issues, PRs, repos, code, or commits - provides correct syntax for exclusions, qualifiers, quoting, and platform-specific handling to avoid command failures
5gh-search-issues
Use when searching GitHub issues ACROSS REPOSITORIES or organizations - provides syntax for filtering by labels, state, assignees, authors, comments, reactions, dates. For current repo issues, use gh issue list instead.
4gh-search-prs
Use when searching GitHub pull requests ACROSS REPOSITORIES or organizations - provides syntax for filtering by draft status, merge status, review state, CI checks, branches. For current repo PRs, use gh pr list instead.
4gh-search-commits
Use when searching commit history across GitHub repositories - provides syntax for filtering by author, committer, dates, hashes, and merge commits with proper exclusion handling
4