GH-SEARCH-CODE(1) GitHub CLI manual GH-SEARCH-CODE(1) (NAME) gh-search-code - (SYNOPSIS) gh search code [flags] (DESCRIPTION) . : (legacy) . github.com (regex) API . gh search --help . (OPTIONS) --extension --filename -q, --jq JSON jq --json JSON --language -L, --limit (default 30) --match : {file|path} --owner -R, --repo OWNER/REPO --size -t, --template JSON Go "gh help formatting" -w, --web JSON (JSON FIELDS) path, repository, sha, textMatches, url (EXIT CODES) 0: 1: 2: 4: : . . (EXAMPLES) # "react" "lifecycle" $ gh search code react lifecycle # "error handling" $ gh search code "error handling" # $ gh search code panic path:pkg language:go # "deque" $ gh search code deque --language=python # "cli" microsoft $ gh search code cli --owner=microsoft # "panic" GitHub CLI $ gh search code panic --repo cli/cli # "lint" package.json $ gh search code lint --filename package.json (SEE ALSO) gh-search(1) Sep 2026 GH-SEARCH-CODE(1)