pi-show-diffs
v0.2.8
Published
Pi package that adds a diff approval viewer before edit and write tools change files.
Maintainers
Readme
pi-show-diffs
warp.dev inspired pi extension that stops and shows an editable diff before file changes are applied.
https://github.com/user-attachments/assets/8bda7619-fcd2-4615-a93a-d15b2fee408b
It currently reviews:
edithashline_editwrite
This gives pi an interactive pre-apply diff review step, so you can inspect the proposed change first and then decide whether to allow it.
Diff review UX
For normal file changes, the modal uses a split diff viewer with:
- side-by-side Original / Updated columns
- syntax-aware ANSI highlighting for common code file types
- collapsed unchanged regions with clear labels
- hunk-aware navigation
- unified diff fallback for narrow terminals or preview errors
- live toggle between split and unified views
- inline editing for
edit,write, and validhashline_editpreviews directly inside the diff modal - adjustable context expansion around hunks
- wrapped inline rendering for long lines
Install
Install from npm:
pi install npm:pi-show-diffsOr install directly from GitHub:
pi install git:github.com/xRyul/pi-show-diffsCommands
/diff-approval— open or toggle approval settings/show-diffs— alias for/diff-approval
Command args:
/diff-approval on/diff-approval off/diff-approval toggle/diff-approval status
Shortcuts in the diff modal
Approval actions
Enter,a, ory- approverorEsc- rejectEore- enter inline edit mode for the updated sideEscin inline edit mode — leave editing and return to review modes- steer and add feedbackShift+A- approve and turn on auto-approve
Navigation
↑/↓- scrollPgUp/PgDn- jump by pageHome/End— jump to top/bottomn/p- next / previous hunk- inline edit mode:
Ctrl+N/Ctrl+Pjump hunks;Alt/Option+↑/↓also works if your terminal is configured to send Alt
View controls
Tab- toggle split / unified view←/→— decrease / increase shown context around hunks[/]- alternate context controlsw- toggle wrapping
Config
Persistent config is stored at:
~/.pi/agent/extensions/pi-show-diffs.json
Current config shape:
{
"autoApprove": false
}Notes
- no
edit/writetool overrides are registered, so it stays compatible with other tool-wrapping extensions likecollapse-tools.ts - non-interactive mode falls back to a text-based diff review flow
- steering rejects the current proposal and sends your feedback back to the model
- editing final file content applies immediately for
edit,write, andhashline_editafter the original tool call succeeds - auto-approve restores normal behavior until you turn it off again
- invalid
hashline_editpreviews (for example tag mismatches) skip the review modal and fall through to the tool's normal error handling
