gh-pr-list - Man Page

List pull requests in a repository

Synopsis

gh pr list [flags]

Description

List pull requests in a GitHub repository.

The search query syntax is documented here:

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

Options

--app <string>

Filter by GitHub App author

-a, --assignee <string>

Filter by assignee

-A, --author <string>

Filter by author

-B, --base <string>

Filter by base branch

-d,  --draft

Filter by draft state

-H, --head <string>

Filter by head branch

-q, --jq <expression>

Filter JSON output using a jq expression

--json <fields>

Output JSON with the specified fields

-l, --label <strings>

Filter by label

-L, --limit <int> (default 30)

Maximum number of items to fetch

-S, --search <query>

Search pull requests with query

-s, --state <string> (default "open")

Filter by state: {open|closed|merged|all}

-t, --template <string>

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

-w,  --web

List pull requests in the web browser

Options Inherited from Parent Commands

-R, --repo <[HOST/]OWNER/REPO>

Select another repository using the [HOST/]OWNER/REPO format

Aliases

gh pr ls

JSON Fields

additions, assignees, author, autoMergeRequest, baseRefName, baseRefOid, body, changedFiles, closed, closedAt, 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

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

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

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

See Also

gh-pr(1)

Referenced By

gh-pr(1).

Dec 2024 GitHub CLI manual