# gh_code_search.mjs Node wrapper for `gh search code` with local filtering and formatting. ## Requirements - Node.js 22+ - GitHub CLI authenticated: `gh auth status` ## Usage ```text node scripts/gh_code_search.mjs "TODO" --language javascript --exclude-forks node scripts/gh_code_search.mjs "error handling" --repo owner/repo --output json node scripts/gh_code_search.mjs "class Component" --owner org --sort-by matches --output summary ``` ## Options - `-L, --limit N` - `--language LANG` - `--filename NAME` - `--extension EXT` - `-R, --repo OWNER/REPO` repeatable - `--owner OWNER` repeatable - `--match file|content` - `--size RANGE` - `--exclude-forks` - `--exclude-private` - `--min-matches N` - `-o, --output pretty|summary|json` - `--sort-by matches|repo|path` - `--output-file PATH` - `--timeout SECONDS` Check current native search flags with `gh search code --help`.