Scroll to navigation

GH-SEARCH-REPOS(1) GitHub CLI manual GH-SEARCH-REPOS(1)

NAME

gh-search-repos - Search for repositories

SYNOPSIS

gh search repos [<query>] [flags]

DESCRIPTION

Search for repositories on GitHub.

The command supports constructing queries using the GitHub search syntax, using the parameter and qualifier flags, or a combination of the two.

GitHub search syntax is documented at:

⟨https://docs.github.com/search-github/searching-on-github/searching-for-repositories⟩

OPTIONS

Filter based on the repository archived state {true|false}

Filter based on created at date

Filter based on number of followers

Filter on number of forks

Filter on number of issues with the 'good first issue' label

Filter on number of issues with the 'help wanted' label

Include forks in fetched repositories: {false|true|only}

Filter JSON output using a jq expression

Output JSON with the specified fields

Filter based on the coding language

Filter based on license type

Maximum number of repositories to fetch

Restrict search to specific field of repository: {name|description|readme}

Filter on number of topics

Order of repositories returned, ignored unless '--sort' flag is specified: {asc|desc}

Filter on owner

Filter on a size range, in kilobytes

Sort fetched repositories: {forks|help-wanted-issues|stars|updated}

Filter on number of stars

Format JSON output using a Go template; see "gh help formatting"

Filter on topic

Filter on last updated at date

Filter based on visibility: {public|private|internal}

Open the search query in the web browser

JSON FIELDS

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

1: Error

2: Command canceled

4: Authentication required

NOTE: Specific commands may have additional exit codes. Refer to the command's help for more information.

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 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

SEE ALSO

gh-search(1)

Nov 2024 GitHub CLI v2.62.0