pi-prs
v0.2.0
Published
Pull request review feedback and watching for pi
Maintainers
Readme
🐙 pi-prs
A Pi extension that owns GitHub pull request state for your session: footer widgets, review feedback, CI failures, and watching.
🚀 Installation
pi install npm:pi-prsInstall GitHub CLI and authenticate it before using the extension.
✨ Usage
pi-prs resolves the pull request for the current branch on its own and keeps it fresh in the background. Fork and upstream remotes both work, and switching branches re-resolves immediately.
Start watching that pull request for review feedback and CI failures:
/pr watchThe extension sends unresolved review feedback and current CI failures to pi, then checks GitHub every 30 seconds for new comments, reviews, and failed checks. New feedback starts an agent turn when pi is idle or steers its next turn when it's busy.
CI messages include the commit, failed check names, and links. GitHub Actions failures also include short diagnostic excerpts as soon as the failed job finishes, even while the rest of the run continues; expand the message to see them. Other CI providers and unavailable logs fall back to check names and links. Diagnostics cover at most three jobs per batch, with up to 80 lines or 4,000 characters per excerpt.
Each failed execution is delivered once while you stay on the same pull request
in the session, including across /pr unwatch and /pr watch. Failed reruns and
failures on new commits are delivered again. Canceled checks and checks awaiting
approval show as failed in the footer but don't start agent turns; neither do
skipped or passing checks. Large sets of failures arrive in batches of up to 20
checks, and failures from superseded commits are discarded. Checks with
incomplete or unfamiliar statuses stay pending without hiding other failures.
GitHub read errors retain the last known CI status and slow polling until reads
succeed again, whether or not you're watching.
Stop watching:
/pr unwatchThis stops both review and CI feedback; footer updates continue. Watching also stops automatically when the pull request closes or merges.
🧩 Footer widgets
When pi-fancy-footer is installed,
pi-prs publishes the pull request number, unresolved review threads, and CI
status. You can change their placement, visibility, and colors with
/fancy-footer.
🔌 Extension API
pi-prs is the only extension that should poll GitHub in a session. Other
extensions consume its state from the event bus instead of shelling out to
gh:
import { createPiPrClient } from "pi-prs/api";
export default function (pi) {
const client = createPiPrClient(pi);
client.onState((state) => {
// state.pullRequest?.ci, .unresolvedThreadCount, .isDraft, …
});
client.onFeedback((event) => {
// event.feedback: new review findings
});
client.onCiFailure((event) => {
// event.headRefOid, event.failures: new failed CI executions
});
}Publishing a pi-prs:feedback or pi-prs:ci-failure event yourself sends that
feedback to pi as a steering message.
🧰 Requirements
- GitHub CLI, authenticated with
gh auth login
