private-repo-search

Search code across private GitHub repositories using the gh CLI.

3|Updated Jun 15, 2026
One-click install
npx skills add https://github.com/patrickserrano/lacquer --skill private-repo-search-patrickserrano
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: private-repo-search
Source: https://github.com/patrickserrano/lacquer/tree/main/core/skills/private-repo-search
Command: npx skills add https://github.com/patrickserrano/lacquer --skill private-repo-search-patrickserrano

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Local grep and Glob only reach the checked-out repository, so code, patterns, or past implementations living in other repos — especially private ones — stay invisible. This Skill uses the authenticated gh CLI to run GitHub code search across every repo and org you can access. ## Core Features & Use Cases - Cross-repo code search: Run gh search code scoped by --owner, --repo, --language, --filename, or --extension to find symbols, patterns, or config files anywhere gh is authenticated. - Structured output: Use --json with -q jq expressions to produce machine-readable results for downstream scripting. - Content retrieval: Fetch full file contents for a matched path via gh api repos/<owner>/<repo>/contents/<path>. - Use Case: You remember writing an RLSPolicy implementation months ago but not which repo it lives in. Search gh search code "RLSPolicy" --owner your-org --language go to locate it, then pull the file content directly. ## Quick Start Search all of my GitHub org's repositories for where the function someFunctionName is used and show me the matching files.

Frequently Asked Questions about private-repo-search

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I search code across private GitHub repositories?▼

Use `gh search code <query>` with the authenticated GitHub CLI, scoped with `--owner` or `--repo` flags. It searches every repository your gh authentication can access, including private repos, unlike local grep which only covers the checked-out repo.

How to find a file by name across multiple GitHub repos?▼

Run `gh search code --filename <name>` to locate a file such as package.json or .lacquer.toml across everything you can see. Add `--owner` or `--repo` to narrow the scope, and `--json` with a jq filter for structured output.

Does gh search code require extra authentication scopes?▼

No extra scope beyond the default gh authentication is needed for code search. Confirm your setup with `gh auth status`; if a private repo you expect is missing from results, check authentication and repo access first.

Why does gh search code not show my just-pushed commit?▼

GitHub's code search index is not real-time, so a recently pushed commit may not appear for a few minutes. The CLI also uses the legacy search API, which lacks regex support and can differ from the github.com web UI results.

How do I get full file content after a code search hit?▼

gh search code returns matched paths, not full content. Fetch the file with `gh api repos/<owner>/<repo>/contents/<path> --jq '.content' | base64 -d`, or use the raw Accept header for a quick look.