pi-auto-reviewer
Auto-review bash commands before your pi agent executes them — akin to Codex Auto-review and Claude Code auto mode.
Package details
Install pi-auto-reviewer from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-auto-reviewer- Package
pi-auto-reviewer- Version
1.0.0- Published
- Jun 11, 2026
- Downloads
- not available
- Author
- vinzenzulrich
- License
- MIT
- Types
- extension
- Size
- 16.1 KB
- Dependencies
- 0 dependencies · 1 peer
Pi manifest JSON
{
"extensions": [
"./auto-reviewer.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-auto-reviewer
Automatically review bash commands that your pi agent wants to execute - akin to Codex "Auto-review" and Claude Code "auto mode".
How it works
Every bash command the agent wants to run goes through three tiers:
| Tier | Action | Examples |
|---|---|---|
| 1. Auto-permitted | Runs immediately | ls, cd, grep, git status, npm list, echo |
| 2. Auto-blocked | Refused immediately | rm -rf, sudo, chmod 777, git push --force, shutdown |
| 3. Needs review | Sent to a reviewer LLM | git commit, npm install, curl, mv, sed -i, cp |
When a command falls into Tier 3, a subagent LLM reviews the command with project context and decides ALLOW or BLOCK.
Install
All projects (global)
cp auto-reviewer.ts ~/.pi/agent/extensions/
Single project
Copy the extension into your project:
cp auto-reviewer.ts .pi/extensions/
Pi auto-discovers extensions in .pi/extensions/ when the project is trusted.
Single session
pi -e ./auto-reviewer.ts
Usage
Once installed, it works automatically - no configuration needed. Every bash command the agent tries to run will be reviewed.
What to expect
Safe commands (Tier 1) run without any visible delay.
Dangerous commands (Tier 2) are blocked with a notification explaining why.
Everything else (Tier 3) pauses briefly while the reviewer LLM decides. You'll see a status message:
Reviewing: <command>...- If allowed: the command runs and you see
Auto-reviewer: ✓ <reason> - If blocked: the command is refused and you see
Auto-reviewer: ✗ <reason> - If the reviewer fails (timeout, error): you're prompted interactively to allow or deny manually.
- If allowed: the command runs and you see
Non-interactive mode
In print mode (pi -p) or JSON mode, Tier 3 commands are blocked by default since there's no UI to fall back on.
Customizing review rules
Edit AUTO_PERMITTED and AUTO_BLOCKED arrays in auto-reviewer.ts to add or remove patterns. Edit buildReviewPrompt() to change how the reviewer LLM decides.
Publishing to the pi package gallery
Publish to npm:
npm publishThe pi.dev/packages gallery automatically discovers packages tagged with
"pi-package". Once published, users can install it with:pi install npm:pi-auto-reviewerOr try it in a single session:
pi -e npm:pi-auto-reviewer
To publish via git instead of npm, push to a public repo and users install with:
pi install git:github.com/your-username/pi-auto-reviewer