>_ ghcli.com
ghcli / Pull Requests / gh pr list

gh pr list

List and filter pull requests

gh pr list prints the open pull requests for the current repository as a clean table. Filter by author, label, base branch, or a full search query, and add --json to feed the results straight into scripts and dashboards.

Quick answer
gh pr list

Syntax

gh pr list [flags]

Examples

List open PRs in the current repo

gh pr list

Only your own pull requests

gh pr list --author @me

Merged PRs with a specific label

gh pr list --state merged --label bug

PRs targeting a release branch

gh pr list --base release-2.0

Search with GitHub's query syntax

gh pr list --search "review:required draft:false"

Machine-readable output for scripts

gh pr list --json number,title,author --limit 100

Options & flags

FlagWhat it does
-s, --stateFilter by state: open (default), closed, merged, or all.
-A, --authorFilter by author login. Use @me for yourself.
-a, --assigneeFilter by assignee.
-l, --labelFilter by label (repeatable).
-B, --baseFilter by base branch.
-S, --searchSearch PRs with GitHub search syntax.
-L, --limitMaximum number of items to fetch (default 30).
--jsonOutput specified fields as JSON for scripting.
-w, --webOpen the filtered list on github.com.

How to use gh pr list, step by step

  1. Run gh pr list in any GitHub repository to see open PRs.
  2. Narrow the list with filters like --author @me or --label bug.
  3. Combine filters — they are ANDed together.
  4. Add --json number,title and pipe to jq or --jq for automation.

Common errors and fixes

no pull requests match your search in OWNER/REPO

The filters returned nothing. Loosen them, or add --state all to include closed and merged PRs.

could not determine base repo: no git remotes found

Run the command inside a cloned repo, or pass --repo owner/name explicitly.

Related commands

Frequently asked questions

How do I list my own pull requests with GitHub CLI?

Use gh pr list --author @me. The @me shortcut resolves to the currently authenticated user, so it works in any repository without typing your username.

How do I export pull requests as JSON?

Add --json with the fields you want, e.g. gh pr list --json number,title,state. Pair it with --jq to filter inside gh, or pipe the output to jq.

Can gh pr list show closed or merged PRs?

Yes. Use --state closed, --state merged, or --state all. The default is open only.