Skip to main content

Command referencegh pr list

gh pr list command (Linux & Windows / GitHub CLI)

Linux & WindowsGitHub CLIgitbeginner

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 / optionMeaning
-s, --stateFilter by open, closed, merged, or all.
-A, --authorFilter by author login.
-l, --labelFilter by label.
-B, --baseFilter by base branch.
-S, --searchSearch query.
-w, --webOpen 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.

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.