GH-SEARCH-REPOS(1)
π GH-SEARCH-REPOS(1) β like, the GitHub CLI manual, but make it make sense
okay bestie, welcome to gh-search-repos from the GitHub CLI manual β this is the page where we learn how to go find repositories on GitHub like the main character we are πβ¨
β¨ NAME β¨
gh-search-repos β search for repositories, fr fr π«Ά
π SYNOPSIS π
gh search repos [<query>] [flags]
that's it. that's the whole vibe. <query> is optional, flags are optional, chaos is optional but encouraged π
πΈ DESCRIPTION πΈ
So you wanna search for repositories on GitHub. Iconic. Slay. Let's go π¦
This command is lowkey flexible: you can build your query using the GitHub search syntax, you can use the parameter and qualifier flags, or β and this is the fun part β you can mix both. Combination queen behavior π
The GitHub search syntax is documented right here, and yes you should read it, it's giving homework but the useful kind:
β¨https://docs.github.com/search-github/searching-on-github/searching-for-repositoriesβ©
And heads up: if your search query has a hyphen in it and you're like "why is this being weird π", run gh search --help for the deets on handling search queries containing a hyphen. Not me almost losing my mind over a dumb little dash π
π OPTIONS π
--archivedβ filter based on the repository archived state, and it takes{true|false}ποΈ--created <date>β filter based on the created at date ποΈ--followers <number>β filter based on how many followers the repo owner has π--forks <number>β filter on the number of forks π΄--good-first-issues <number>β filter on how many issues carry the'good first issue'label β perfect for your first contribution era π±--help-wanted-issues <number>β filter on how many issues carry the'help wanted'label πββοΈ--include-forks <string>β include forks in the fetched repositories:{false|true|only}π΄-q,--jq <expression>β filter JSON output using ajqexpression, chef's kiss for pipelines π§βπ³--json <fields>β output JSON with the specified fields (peep the list further down π)--language <string>β filter based on the coding language π»--license <strings>β filter based on license type π-L,--limit <int>(default30) β maximum number of repositories to fetch π¦--match <strings>β restrict the search to a specific field of the repository:{name|description|readme}π―--number-topics <number>β filter on the number of topics π·οΈ--order <string>(default"desc") β order of repositories returned, and ngl it's ignored unless the'--sort'flag is specified:{asc|desc}β¬οΈβ¬οΈ--owner <strings>β filter on owner π€--size <string>β filter on a size range, in kilobytes π¦--sort <string>(default"best-match") β sort the fetched repositories:{forks|help-wanted-issues|stars|updated}π₯--stars <number>β filter on the number of stars β-t,--template <string>β format JSON output using a Go template; see"gh help formatting"π¨--topic <strings>β filter on topic π§΅--updated <date>β filter on the last updated at date π--visibility <strings>β filter based on visibility:{public|private|internal}π΅οΈββοΈ-w,--webβ open the search query in the web browser, chaos mode activated π
π JSON FIELDS π
If you're passing --json <fields>, these are the ones that exist, and yes I'm listing all of them because we don't do half-finished over here π
createdAt, defaultBranch, description, forksCount, fullName, hasDownloads, hasIssues, hasPages, hasProjects, hasWiki, homepage, id, isArchived, isDisabled, isFork, isPrivate, language, license, name, openIssuesCount, owner, pushedAt, size, stargazersCount, updatedAt, url, visibility, watchersCount
π§ EXIT CODES π§
0: successful execution β we ate π½οΈ1: error β it's giving oops π2: command canceled4: authentication required β log in bestie π
NOTE: specific commands may have additional exit codes. Refer to the command's help for more information. No cap, always check π
β EXAMPLE β
# Search repositories matching set of keywords "cli" and "shell"
$ gh search repos cli shell
# Search repositories matching phrase "vim plugin"
$ gh search repos "vim plugin"
# Search repositories using raw search qualifiers as separate arguments
$ gh search repos topic:github 'stars:>5000'
# Search repositories public repos in the microsoft organization
$ gh search repos --owner=microsoft --visibility=public
# Search repositories with a set of topics
$ gh search repos --topic=unix,terminal
# Search repositories by coding language and number of good first issues
$ gh search repos --language=go --good-first-issues=">=10"
# Search repositories without topic "linux"
$ gh search repos -- -topic:linux
# Search repositories excluding archived repositories
$ gh search repos --archived=false
not the -- -topic:linux with the double dashβ¦ the way that hyphen handling haunts us π« iykyk
π SEE ALSO π
gh-search(1) β go read the parent page too, it's the whole family π«Ά
okay that's the page!! this was GitHub CLI v2.102.0, dated Oct 2026, and honestly? iconic of them. mwah ππΈ go search some repos bestie, you're gonna slay β¨π
π¦ where this page comes from
- opensuse-leap 16.0: gh 2.102.0-bp160.1.1 Β· MIT
- opensuse-leap 16.0: gh 2.102.0-bp160.1.1 Β· MIT
- opensuse-leap 16.0: gh 2.102.0-bp160.1.1 Β· MIT
- opensuse-leap 16.0: gh 2.102.0-bp160.1.1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms