1---2name: gh-pr-list3description: List and filter GitHub pull requests using gh CLI with various filters like state, author, labels, and search queries.4---56# GitHub PR List78## When to use910- The user asks to list pull requests in a repository.11- You need to find PRs by author, label, state, or search query.12- Checking overall PR backlog or finding specific PRs.1314## Inputs to confirm1516- Filter criteria: state (open/closed/merged/all), author, assignee, labels.17- Search query if advanced filtering needed.18- Target repo if not current (`--repo OWNER/REPO`).19- Output format (table, JSON, web).2021## Workflow22231. Verify auth:24 ```bash25 gh --version26 gh auth status27 ```282. List PRs with filters:29 ```bash30 gh pr list31 gh pr list --state all --limit 5032 gh pr list --author "@me"33 gh pr list --label "bug" --label "priority"34 gh pr list --assignee "@me" --state open35 ```363. Use search syntax for advanced queries:37 ```bash38 gh pr list --search "status:success review:required"39 gh pr list --search "draft:false review:approved"40 ```414. Get JSON output for scripting:42 ```bash43 gh pr list --json number,title,state,author --jq '.[] | "\(.number): \(.title)"'44 ```4546## Examples4748```bash49# List your open PRs50gh pr list --author "@me"5152# Find PRs needing review53gh pr list --search "review:required"5455# List merged PRs to main56gh pr list --state merged --base main --limit 205758# Get PR numbers and titles as JSON59gh pr list --json number,title,reviewDecision60```6162## Flags reference6364| Flag | Description |65| ---------------- | ------------------------------------------------- |66| `-s, --state` | Filter: open, closed, merged, all (default: open) |67| `-A, --author` | Filter by author |68| `-a, --assignee` | Filter by assignee |69| `-l, --label` | Filter by label (repeatable) |70| `-B, --base` | Filter by base branch |71| `-H, --head` | Filter by head branch |72| `-S, --search` | Search with GitHub query syntax |73| `-L, --limit` | Max items to fetch (default 30) |74| `--json` | Output specific fields as JSON |75| `-w, --web` | Open list in browser |7677## References7879- GitHub CLI manual: https://cli.github.com/manual/80- Search syntax: https://docs.github.com/en/search-github/searching-on-github/searching-issues-and-pull-requests81- `gh pr list --help`