Skip to content

Pull Requests

List pull requests

ghx pr list

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

Filter by state

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

Filter by author or assignee

ghx pr list --author alice
ghx pr list --assignee bob

Filter by branch

ghx pr list --base main
ghx pr list --head feat/dark-mode

Filter by draft status

ghx pr list --draft

Filter by label

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

ghx pr list --label enhancement
ghx pr list --label enhancement --label reviewed

Case-insensitive substring match against title and body:

ghx pr list --search "fix crash"

Limit results

ghx pr list --limit 10

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

Showing 10 of 30 pull requests

JSON output

ghx 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:

ghx pr list --no-truncate

View a single pull request

ghx pr view 10

Show comments

ghx pr view 10 --comments

Force refresh

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

ghx pr view 10 --refresh

JSON output

ghx 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!