← Catalog

@scriptdude/pi-merger

pi extension: review, approve, merge and comment on open GitHub PRs from a full-screen TUI (via gh)

Extension

Install

Install with PiG

pig install npm:@scriptdude/pi-merger

Install with Pi

pi install npm:@scriptdude/pi-merger
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "image": "https://raw.githubusercontent.com/dimitritholen/pi-merger/main/docs/screenshot.png",
  "extensions": [
    "./index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.2.0 (README.md). PiG does not review it.

pi-merger

A pi extension that opens a full-screen TUI to review open GitHub pull requests. All PR data comes from the gh CLI.

pi-merger: file list on the left, diff of the selected file on the right

Install

pi install npm:@scriptdude/pi-merger
# or straight from GitHub: pi install git:github.com/dimitritholen/pi-merger

Then /reload in pi. Requires gh, logged in (gh auth login).

Use

Run pi inside a git repo with a GitHub remote, then press ctrl+shift+m or type /merger.

Starting pi in a folder that holds several repos (direct subfolders with a .git) works too: the start screen lists open PRs from all of them, and f opens a dropdown to focus on one repo.

Flow: PR list → changed files (file list left, diff preview right; stacked on terminals under 100 columns) → select hunks.

KeyAction
↑↓ / jkmove (PR, file, or hunk)
enter / →open PR · select hunks in the diff
pgup pgdn / spacescroll the diff
n pnext / previous file
ccomment on the selected hunk: sends file path, hunk and comment to the model in the current session (not posted to the PR)
aapprove (confirm first; gh pr review --approve). Blocked on your own PRs
mmerge (confirm first; pick s squash, m merge commit, r rebase). Not for drafts
uupdate branch: merge base into the PR branch (confirm first; gh pr update-branch)
fchoose repository (only when several repos were found)
vfilter: All, Created by me, Assigned to me, Review requested from me
uchoose users (PR authors): space shows/hides a user, a shows all (remembered until pi restarts)
rrefresh the PR list
escback
q / ctrl+cquit

Errors from gh (missing, not authenticated, GitHub refusals such as conflicts) show in the status line.

Limits

First 100 open PRs per repo. Repos are only searched one level down. No syntax highlighting. Single-line comments. The diff is re-fetched each time a PR is opened.

Develop

npm install, then npm test (diff parser and gh error handling) and npm run typecheck.

License

MIT