Command referencegh pr list
gh pr list command (Linux & Windows / GitHub CLI)
What it does
List pull requests in a repository with state, author, and search filters. When people search for gh pr list, they usually want practical GitHub CLI flags, safe examples, and how this subcommand fits everyday PR and repo workflows on Linux, Windows, and macOS. Syntax, options, and copyable examples are below.
List pull requests in a repository with state, author, and search filters.
Syntax
gh pr list [flags]
Common options
| Flag / option | Meaning |
|---|---|
| -s, --state | Filter by open, closed, merged, or all. |
| -A, --author | Filter by author login. |
| -l, --label | Filter by label. |
| -B, --base | Filter by base branch. |
| -S, --search | Search query. |
| -w, --web | Open the PR list in a browser. |
Practical examples
Open PRs
gh pr list
Lists open pull requests for the current repository.
My PRs
gh pr list --author @me
Shows pull requests you authored.
Against main
gh pr list --base main
Filters PRs targeting main.
Merged recently
gh pr list --state merged --limit 10
Shows the latest merged pull requests.
Common mistakes
- Looking for draft PRs without noticing they still appear as open.
- Using issue search syntax that does not apply to PR list filters.
Related commands
- gh pr createCreate a pull request from the current branch with title, body, reviewers, and base branch options.
- gh pr viewDisplay pull request metadata, body, and checks in the terminal or browser.
- gh pr checkoutCheck out a pull request locally as a branch so you can build, test, or review the changes.
- gh pr statusShow pull request status relevant to your work: current branch, created PRs, and review requests.
- gh auth loginAuthenticate the GitHub CLI with GitHub.com or GitHub Enterprise so other gh commands can run.
- gh pr mergeMerge a pull request using merge commit, squash, or rebase strategies.
- gitTrack source history and collaborate through distributed repositories.
- gh repo cloneClone a GitHub repository to your machine using your authenticated gh settings.
FAQ
What does gh pr list do in GitHub CLI?
List pull requests in a repository with state, author, and search filters.
Does gh pr list work on Windows and Linux?
Yes. The GitHub CLI (`gh`) runs on Linux, Windows, and macOS with the same subcommand syntax after you authenticate with `gh auth login`.
What is a practical gh pr list example?
Try `gh pr list` — Lists open pull requests for the current repository.
Do I need a token in the command line for gh pr list?
Prefer `gh auth login` so credentials stay in the system keyring or secure storage. Avoid pasting personal access tokens into shell history.
Browse the full Linux and Windows command reference to search more bash, CMD, PowerShell, Conda, and GitHub CLI commands.