See the current branch's pull request number, checks, review state, and discussion count in Pi's statusline. The extension reads only GitHub pull request metadata. It does not register a command or model tool, render a widget, or inject model context.
- Shows compact PR number, checks, review state, and combined comment/review count.
- Starts the initial refresh in the background without delaying Pi startup.
- Refreshes once per minute, after agent turns, and when the Git branch changes.
- Keeps a recently merged or closed pull request visible for up to 24 hours.
- Uses GitHub CLI authentication and repository resolution without storing a token.
- Never reads or displays discussion bodies, review text, inline comments, or review threads.
- Runs without commands, model tools, widgets, webhooks, or a separate service.
Install and authenticate GitHub CLI first:
brew install gh
gh auth login
# For GitHub Enterprise Server (include the port if your URL uses one):
gh auth login --hostname github.example.com:8443The extension delegates authentication, credential storage, and repository resolution to gh.
It uses the pull request URL host, including its port, for follow-up API calls.
You do not need to set GH_HOST manually.
Install the extension persistently:
pi install npm:@narumitw/pi-github-prTry the published package without installing it:
pi -e npm:@narumitw/pi-github-prBuild and load a local checkout from the repository root:
npm --workspace @narumitw/pi-github-pr run build
pi -e ./packages/pi-github-prThe package declares dist/index.ts, so Pi cannot load an unbuilt local checkout.
Pi extensions run with your user permissions.
Review extension source before installing it.
Authenticate gh, then start Pi in a Git worktree whose current branch has a GitHub pull request.
The pull request status appears automatically:
PR #123: checks passing, approved, 7 comments
PR #123: checks failing (2), changes requested, 3 comments
PR #123: checks pending (5), commented, 12 comments
PR #123: no checks, draft, no comments
The PR number is an OSC 8 link when Pi's terminal capabilities allow hyperlinks, and plain text otherwise.
Checks use GitHub's terminology; the trailing count combines comments and reviews.
When rendered by pi-statusline, the github-pr icon comes from its icon settings.
The extension runs passively:
- On session start, it checks the current branch in the background without delaying Pi startup.
- On a Git branch change, it clears the old status immediately and refreshes the new branch.
- While the session is open, it refreshes every 60 seconds and after each agent turn.
- If an agent turn is aborted, it keeps the last successful status instead of reporting a GitHub failure.
- On branch change, session replacement, or session shutdown, it cancels the previous refresh timer and applicable in-flight initialization or refresh request.
- On session shutdown, it clears the statusline entry.
- An open pull request stays visible, while a merged or closed pull request stays visible for at most 24 hours after its terminal timestamp.
- If the current branch has no GitHub pull request, the statusline entry stays empty.
- If
ghis missing or unauthenticated, the statusline showsPR gh missingorPR gh auth.
- Requires
gh; there is no direct GitHub API orGITHUB_TOKENfallback. - Shows only the current branch's pull request; arbitrary pull request lookup is not supported.
- Counts pull request comments and reviews, not unresolved review threads.
- Does not read pull request comment bodies, review bodies, inline diff comments, or unresolved review-thread text.
- Each refresh invokes
gh pr viewand one GraphQL count query.
packages/pi-github-pr/
├── src/ # Authoritative implementation and helpers
│ ├── index.ts # Thin Pi entrypoint
│ └── github-pr.ts # GitHub queries and status refresh
├── dist/ # Generated Jiti runtime
├── scripts/build-runtime.mjs # Runtime builder
└── test/ # Behavior and lifecycle coverage
The generated runtime is built from src/index.ts and does not import back into src.
pi-package, pi-extension, github, pull-request, statusline, gh
MIT.
See LICENSE.