@signalridge/pi-github-pr1.2.9
Pi extension that shows GitHub pull request review, checks, and comment status.
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
pi-github-pr — GitHub pull request statusline for Pi agents
@signalridge/pi-github-pr is a passive Pi coding agent extension that shows the current branch GitHub pull request status in Pi's statusline.
It only reads PR metadata for the current branch. It counts comments and reviews, but does not fetch or display comment bodies, review text, or review-thread content.
It is intentionally ambient: no slash command, no custom tool, no widget, and no comment injection.
Example statusline text:
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 check wording follows GitHub's Checks terminology. The trailing comment count is the
combined comments + reviews count. When rendered by pi-statusline, the github-pr icon comes
from pi-statusline icon settings.
Install
pi install npm:@signalridge/pi-github-pr
Try without installing permanently:
pi -e npm:@signalridge/pi-github-pr
Try this package locally from the repository root:
pi -e ./packages/pi-github-pr
Prerequisites
Install and authenticate GitHub CLI yourself:
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:8443
The extension shells out to gh; GitHub Enterprise hosts and credential storage are delegated to gh. It uses the PR URL host (including any port) for follow-up API calls, so no manual GH_HOST is required.
Behavior and limits
Uses gh authentication without storing tokens; no direct API, GITHUB_TOKEN fallback, webhook or separate service. Only the current branch is queried, via gh pr view plus one GraphQL count query per refresh. Counts combine comments and reviews, not unresolved review-thread counts; use GitHub or gh pr view --comments for discussion text.
The extension runs passively:
- On session start, it checks the current branch PR in the background, so slow GitHub calls do not delay startup; the compact statusline entry appears when the check completes. The session-start
ghrequest waits for Git HEAD-path discovery (up to its 5-second timeout) so the branch watcher and request can be reconciled without duplicating work; an agent-turn refresh may run during discovery. - On Git branch change, it clears the old PR immediately and refreshes the new current branch. An agent-turn refresh for that same HEAD supersedes a pending branch debounce.
- While the session remains open, it refreshes that same current branch PR every 60 seconds and after each agent turn.
- On branch change, session replacement, or session shutdown, it cancels outstanding refresh work and ignores stale results.
- On session shutdown, it clears the statusline entry.
- If the directory has no GitHub PR, the statusline entry stays empty.
- If
ghis missing or unauthenticated, the statusline shows a short hint such asPR gh missingorPR gh auth.
Each subprocess has an independent combined stdout/stderr capture budget: PR metadata 1 MiB, GraphQL counts 64 KiB, and Git HEAD-path discovery 16 KiB. Incomplete output is rejected before parsing or CLI failure classification; overflow is not reported as a timeout. These operation budgets are not settings.
Source entrypoint: src/index.ts.
Provenance
Hyperlink handling selectively adapts narumiruna/pi-extensions 36a5ad5: OSC 8 links require Pi-reported support and a validated URL, otherwise plain text. Local monitoring, cancellation and expiry safeguards remain.
License
MIT