GH-PR-LIST(1)

πŸ’… GH-PR-LIST(1) β€” like, the whole entire manual, bestie

okay so this is gh-pr-list from the GitHub CLI manual β€” yes, that GitHub CLI, the one you keep forgetting to update β€” and it's literally the page that teaches you how to list pull requests from your terminal like a main character. sit down, grab a boba, we're doing this πŸ§‹βœ¨


🌸 NAME 🌸

gh-pr-list β€” List pull requests in a repository. that's it. that's the whole vibe. πŸ‘‘


✨ SYNOPSIS ✨

gh pr list [flags]

πŸ¦‹ DESCRIPTION πŸ¦‹

so you wanna see the PRs in a GitHub repository. iconic. by default this only lists open PRs β€” like, it's not gonna dump every closed and merged thing in your face unless you ask, because it respects you. 🫢

the search query syntax is documented here, and yes you have to actually go read it:

⟨https://docs.github.com/en/search-github/searching-on-github/searching-issues-and-pull-requests⟩

and on supported GitHub hosts, you can use advanced issue search syntax inside the --search query. that's the fancy stuff. for more info on advanced issue search, see:

⟨https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/filtering-and-searching-issues-and-pull-requests#building-advanced-filters-for-issues⟩

ngl those URLs are giving "assigned reading" but they're lowkey useful, iykyk πŸ“š


πŸ’… OPTIONS πŸ’…

this is the part you actually came for. every single flag, no skips, no cap:

  • --app <string> β€” filter by GitHub App author. yes, bots have feelings too πŸ€–
  • -a, --assignee <string> β€” filter by assignee. who's holding the bag on this one
  • -A, --author <string> β€” filter by author. and hey β€” use --app if you're filtering by a GitHub App, bestie, don't mix them up πŸ’€
  • -B, --base <string> β€” filter by base branch. the branch it's merging into, okay
  • -d, --draft β€” filter by draft state. for the PRs that aren't ready yet (real)
  • -H, --head <string> β€” filter by head branch. heads up: the ":" syntax is not supported here πŸ™ˆ
  • -q, --jq <expression> β€” filter JSON output using a jq expression. chef's kiss for piping πŸ“
  • --json <fields> β€” output JSON with the specified fields. pick your faves (full list further down πŸ‘‡)
  • -l, --label <strings> β€” filter by label. multiple labels = multiple flags, see the example
  • -L, --limit <int> (default 30) β€” maximum number of items to fetch. thirty is the default, don't come for me
  • -S, --search <query> β€” search pull requests with query. go wild with that advanced syntax
  • -s, --state <string> (default "open") β€” filter by state: {open|closed|merged|all}. the whole squad of states 🌈
  • -t, --template <string> β€” format JSON output using a Go template; see gh help formatting
  • -w, --web β€” list pull requests in the web browser. for when you want the ✨graphical experience✨

πŸ‘‘ OPTIONS INHERITED FROM PARENT COMMANDS πŸ‘‘

the parent commands said "here, take these too":

  • -R, --repo <[HOST/]OWNER/REPO> β€” select another repository using the [HOST/]OWNER/REPO format. yes that bracket syntax is intentional, it's giving optional-host energy 🌟

πŸŽ€ ALIASES πŸŽ€

gh pr ls

that's it. ls works. type less, slay more. literally.


🧚 JSON FIELDS 🧚

here's the full menu of fields you can pass to --json, and i'm listing every single one because i would never do you dirty like that:

additions, assignees, author, autoMergeRequest, baseRefName, baseRefOid, body, changedFiles, closed, closedAt, closingIssuesReferences, comments, commits, createdAt, deletions, files, fullDatabaseId, headRefName, headRefOid, headRepository, headRepositoryOwner, id, isCrossRepository, isDraft, labels, latestReviews, maintainerCanModify, mergeCommit, mergeStateStatus, mergeable, mergedAt, mergedBy, milestone, number, potentialMergeCommit, projectCards, projectItems, reactionGroups, reviewDecision, reviewRequests, reviews, state, statusCheckRollup, title, updatedAt, url

that's a lot. that's the point. pick what you need πŸ“


πŸ’€ EXIT CODES πŸ’€

when the command comes back, it comes back with a number, and the number means things:

  1. 0 β€” Successful execution πŸŽ‰
  2. 1 β€” Error 😭
  3. 2 β€” Command canceled πŸ™ˆ
  4. 4 β€” Authentication required πŸ”
NOTE: Specific commands may have additional exit codes. Refer to the command's help for more information. so like, don't @ me if there's a fifth one hiding somewhere

πŸ”₯ EXAMPLE πŸ”₯

copy these exactly, bestie, they're tested:

# List PRs authored by you
$ gh pr list --author "@me"

# List PRs opened by a GitHub App such as Dependabot
$ gh pr list --app dependabot

# List PRs with a specific head branch name
$ gh pr list --head "typo"

# List only PRs with all of the given labels
$ gh pr list --label bug --label "priority 1"

# Filter PRs using search syntax
$ gh pr list --search "status:success review:required"

# Find a PR that introduced a given commit
$ gh pr list --search "<SHA>" --state merged

not the --label one needing two whole flags for two labels β€” the way that's just how it works 😌 and yes, "<SHA>" is a placeholder, swap in your actual SHA, please don't run it literally.


🌈 SEE ALSO 🌈

  • gh-pr(1) β€” go read the parent, it's the whole PR universe

and that's the page!! mwah πŸ’‹ this was GitHub CLI v2.102.0, dated Oct 2026, and it's the GH-PR-LIST(1) manual page β€” go list some PRs, you absolute icon 🫢✨

πŸ“¦ where this page comes from