Skip to content

Pull Requests

List pull requests

gh-cached pr list

When the cache is fresh, results are served from disk. Otherwise the GitHub API is used.

Filter by state

gh-cached pr list                     # open (default)
gh-cached pr list --state closed
gh-cached pr list --state merged
gh-cached pr list --state all

Filter by author or assignee

gh-cached pr list --author alice
gh-cached pr list --assignee bob

Filter by branch

gh-cached pr list --base main
gh-cached pr list --head feat/dark-mode

Filter by draft status

gh-cached pr list --draft

Filter by label

Labels use AND logic. Repeat the flag to require all specified labels:

gh-cached pr list --label enhancement
gh-cached pr list --label enhancement --label reviewed

Case-insensitive substring match against title and body:

gh-cached pr list --search "fix crash"

Limit results

gh-cached pr list --limit 10

When the total exceeds the limit, a summary is printed to stderr:

Showing 10 of 30 pull requests

JSON output

gh-cached pr list --json

Outputs a pretty-printed JSON array of pull request objects.

Disable title truncation

By default, titles are truncated to 55 characters. Use --no-truncate to show full titles:

gh-cached pr list --no-truncate

View a single pull request

gh-cached pr view 10

Show comments

gh-cached pr view 10 --comments

Force refresh

Bypass the cache and fetch the latest data from GitHub, updating the cache:

gh-cached pr view 10 --refresh

JSON output

gh-cached pr view 10 --json

Example output

pr list

#10  Add new feature         feature → main    approved          3  2025-01-15
#9   Fix edge case [draft]   fix-bug → dev     review required   1  2025-01-14

pr view

#10 Add new feature
OPEN • opened by octocat • 3 comment(s)

Branch:    feature → main
Review:    approved
Labels:    enhancement
Assignees: alice, bob
Created:   2025-01-08 11:00
URL:       https://github.com/octocat/hello-world/pull/10

This PR adds a new feature...

── Comment 1 by reviewer1 (2025-01-09 08:30) ──

Looks good, approved!