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

# [NAME](#NAME)

gh-search-repos - Search for repositories

# [SYNOPSIS](#SYNOPSIS)

**gh search repos \[&lt;query&gt;] \[flags]**

# [DESCRIPTION](#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⟩

For more information on handling search queries containing a hyphen, run **gh search --help**.

# [OPTIONS](#OPTIONS)

[**--archived**](#archived)

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

[**--created** **&lt;date&gt;**](#created)

Filter based on created at date

[**--followers** **&lt;number&gt;**](#followers)

Filter based on number of followers

[**--forks** **&lt;number&gt;**](#forks)

Filter on number of forks

[**--good-first-issues** **&lt;number&gt;**](#good_first_issues)

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

[**--help-wanted-issues** **&lt;number&gt;**](#help_wanted_issues)

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

[**--include-forks** **&lt;string&gt;**](#include_forks)

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

[**-q**, **--jq** **&lt;expression&gt;**](#q)

Filter JSON output using a jq expression

[**--json** **&lt;fields&gt;**](#json)

Output JSON with the specified fields

[**--language** **&lt;string&gt;**](#language)

Filter based on the coding language

[**--license** **&lt;strings&gt;**](#license)

Filter based on license type

[**-L**, **--limit** **&lt;int&gt; (default 30)**](#L)

Maximum number of repositories to fetch

[**--match** **&lt;strings&gt;**](#match)

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

[**--number-topics** **&lt;number&gt;**](#number_topics)

Filter on number of topics

[**--order** **&lt;string&gt; (default "desc")**](#order)

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

[**--owner** **&lt;strings&gt;**](#owner)

Filter on owner

[**--size** **&lt;string&gt;**](#size)

Filter on a size range, in kilobytes

[**--sort** **&lt;string&gt; (default "best-match")**](#sort)

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

[**--stars** **&lt;number&gt;**](#stars)

Filter on number of stars

[**-t**, **--template** **&lt;string&gt;**](#t)

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

[**--topic** **&lt;strings&gt;**](#topic)

Filter on topic

[**--updated** **&lt;date&gt;**](#updated)

Filter on last updated at date

[**--visibility** **&lt;strings&gt;**](#visibility)

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

[**-w**, **--web**](#w)

Open the search query in the web browser

# [JSON FIELDS](#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](#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](#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
```

# [SEE ALSO](#SEE_ALSO)

[**gh-search(1)**](/man/os/gh/gh-search.1)

Oct 2026

---

Document: gh-search-repos(1) from gh 2.103.2-r0 (Chainguard OS)
Source: https://github.com/cli/cli
