pi-bro0.41.2
A private sidekick for Pi: simplify replies and diagrams, think on the side, and get second opinions—without cluttering your agent's context.
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-bro
A private sidekick for Pi: simplify replies and diagrams, think on the side, and get second opinions—without cluttering your agent's context.
Bro runs in a separate TUI window using your active Pi model (no extra CLI required) or an optional external coding CLI, so your main session stays focused.
Install
pi install npm:pi-bro
Restart Pi or run /reload, then verify your setup:
/bro doctor
Want to try it without installing? Run pi -e npm:pi-bro. To install from GitHub, use pi install git:github.com/tranhoangnguyen03/pi-bro.
Try it in 30 seconds
On first use, Bro uses your active physical Pi model automatically—no extra CLI needed. Paste this into Pi:
/bro simplify text TypeScript narrows a variable only inside the synchronous control-flow graph, so mutating a closed-over binding inside a callback does not update its inferred type outside the closure.
Expected: Bro opens a private window and rewrites that explanation in plain English. Press M to switch detail level (brief / balanced / faithful), C to copy, or Esc to close. Nothing enters your main agent's conversation.
Next, try the other two core workflows:
| Command | What happens |
|---|---|
/bro btw What is the smallest fix for that closure issue? |
Opens a private side conversation seeded with recent session context |
/bro overthink |
Press Ctrl+R for one actionable private second look on your current session |
/bro show |
Visualizes recent conversation turns as interactive browser diagrams with follow-ups |
For a guided first run, see Getting started. Before using Bro on private or work repos, check what leaves your machine.
Core workflows
1. Understand fast — Simplify & Show
/broor/bro simplify— Plain-language explanations of the latest agent reply (/simplify), pasted text (/text), local files (.md,.txt,.pdf,.docxvia/file), or public webpages (/url)./bro show— Visualize recent turns as interactive browser diagrams (any Mermaid, SVG, HTML/CSS) with iterative follow-ups; open with/openor Ctrl+O.
2. Think on the side — BTW & Grill Me
/bro btw [question]— Private side conversation seeded with recent context so you can explore tangents without derailing your main agent. Starts conversation-only; ⚠️ full-permission mode can edit files./bro grill-me [topic](experimental) — Opinionated decision interview (light,balanced, orexhaustive) that challenges assumptions one question at a time. Run/consolidatefor a decision brief and/copyto take it with you. Uses BTW model settings; read-only restrictions vary by backend.
3. Catch blind spots — Overthink & Advisor
/bro overthink— Quiet second look from the active Pi model, with inspectable source evidence. Press Ctrl+R to check on demand; enable automatic checks in/bro configif you want them.bro_advisortool — Independent second opinion your agent can call mid-task; a fresh backend process reviews the session snapshot and returns advice. Shape its priorities with/bro advisor-steer. ⚠️ Runs with permissions bypassed.
More workflows
| Command | What you get |
|---|---|
/bro elevate [task] or Ctrl+Shift+E |
Elevate. Surface missing expert considerations, pick what matters, and rewrite your task before submitting it. Shares BTW settings. |
/bro guided-review <PR> |
Guided Review. PR explanation, ranked findings with source evidence, and saved private questions. Requires Git + gh; Claude or Pi recommended for untrusted PRs. Remove saved reviews with /bro guided-review delete [PR]. |
/bro architecture [focus] |
Architecture Docs. Inspects the repo and writes source-backed Markdown, diagrams, and an offline interactive architecture.html under docs/architecture/. Uses BTW settings. |
/bro remember-me [thought] |
Remember Me. Privately clarify and approve short personal memories with expandable background; agents read them via about_user. |
/bro copy |
Copy Markdown. Edit, preview, and copy the last completed reply as raw Markdown—no model call, no saved file. |
/bro config, /bro preferences |
Settings and preferences. Pick backend, model, and effort per feature, and tell Bro how you like answers. |
Browse by task in the docs home, feature map, or command reference.
Requirements
- Pi
>=1.3.0and Node.js>=22.19.0. Overthink always uses the host Pi model, independently of Bro's backend configuration. - macOS or Linux. Windows is untested; there, cancelling stops only the backend's direct process, not anything it started.
- Built-in Pi backend (zero extra install) or at least one supported CLI on your
PATH, signed in once from your terminal:
| Backend | CLI | Notes |
|---|---|---|
| Pi (in-process) | none | Default when a physical Pi model is active. Reuses your Pi models and credentials. Restricted features get no tools; Guided Review is file-only; Advisor and full-access BTW get workspace tools. |
| Google Antigravity | agy |
Fallback preset if no physical Pi model is selected. Needs >=1.1.15. Guided Review uses --sandbox (restricts shell, still allows writes inside the project). |
| Claude Code | claude |
Works for every feature; strict file-only inspection for Guided Review. |
| Codex CLI | codex |
Guided Review uses its read-only sandbox (shell-enabled). |
- Guided Review also needs Git and an authenticated
gh. Claude or Pi is recommended for untrusted PRs (strict file-only inspection); Codex and Agy run with shell available under their sandbox, with an advisory. - PiG support is experimental.
What leaves your machine
Each feature sends data to the backend you chose and its model provider, which may keep it under their own policies. Paths below are under ~/.pi/agent/ (or $PI_CODING_AGENT_DIR).
| Feature | What is sent | What Bro keeps on disk |
|---|---|---|
| Copy Markdown | Nothing; reads the last completed reply already in Pi's session | Nothing; only an in-memory draft while the modal is open |
| Explain | Last reply, pasted text, or text extracted from your file or webpage, plus preferences | Last result as a private Pi session entry |
| Show | User and assistant text from recent turns (no tool calls, tool results, reasoning, or images), plus preferences | Private Pi session thread (bro-show-thread) with compact turns and active views, plus a session-scoped viewer page in pi-bro-<uid>/ |
| Side questions (BTW) | Your questions and up to the last 8 turns of conversation text, plus preferences | Private Pi session entries with completed turns, mode, and draft |
| Grill Me | Topic, interview turns, up to the last 8 main-session text turns, preferences, and any workspace files the selected inspector reads | Private Pi session entries with the interview and brief |
| Overthink | Untouched current session projection (including tool evidence and summaries), plus review prompt with appended Source index and preferences, to the active Pi provider | Global opt-in in bro-overthink-defaults.json; latest private check, failure, and branch opt-out in Pi session custom entries |
| Advisor | Agent's system instructions, tool list, and whole conversation (including tool calls and results; reasoning and images omitted), plus steering | Steering in bro-advisor.md and the session file |
| Elevate | Your objective, selected findings, all current-branch user/assistant text (Full also includes tool-call arguments and text results), plus preferences | Nothing; stays in memory |
| Guided Review | PR description and diff, files the backend reads, your questions, plus preferences | Reviews and captured source in bro-reviews/, with no automatic cleanup |
| Architecture Docs | Repository source, existing architecture docs, focus, and preferences; only selected backend sees snapshot files | Generated Markdown, JSON graph, and offline HTML in docs/architecture/; temporary inspection copy is removed |
| Remember Me | Your thought, interview turns, captured recent session text (unless /context off), related saved memories, and legacy style preferences |
Approved memories in bro-memories.json |
Session-scoped Bro entries live inside Pi's session file. They stay out of the model's conversation, but are not secret from someone who can read, back up, export, or share that file. Check the session content before sharing it; Bro does not encrypt or redact exports.
/bro simplify url also connects straight to the website, which sees your IP address.
Bro runs each CLI as you, with your environment. It never reads or copies an external CLI's provider credentials, though a CLI signs in its own way (including API keys in your environment). The built-in Pi backend is the exception: it runs in-process, reads your Pi auth.json, and reuses your Pi credentials for the model you select. Nothing Bro produces enters Pi's conversation unless you paste and submit it—except bro_advisor answers and about_user memory reads, which return to the agent as tool results.
[!WARNING] These run the backend in your workspace with its permission checks bypassed:
- Advisor: can read, edit, and run commands. "Advise, don't edit" is only a prompt instruction.
- Grill Me
/access full: explicitly opts into unrestricted workspace permissions. The no-edits prompt is not an access control.- BTW full-permission mode (
/modeinside BTW): meant to edit files and run commands.
Details per backend: Backends: access and retention and Privacy and safety.
Limits
- Documents:
.md,.markdown,.txt,.pdf,.docxonly, no OCR, up to 10 MiB. → Run OCR elsewhere first. - Webpages: one public HTML page; no logins, paywalls, page JavaScript, or proxy settings. → Save the page as PDF or text and use
/bro simplify file. - No fallback: if the chosen backend, model, or effort fails, Bro shows that backend's error instead of switching. → Run
/bro doctor. - Elevate runs fresh restricted calls through the BTW model setting. Restricted does not always mean sandboxed; see access and retention. The shortcut may not work in all terminals: use
/bro elevateinstead. - BTW, Grill Me, and Simplify's latest result use private session entries; they survive normal Pi reload/resume. A new session starts fresh and later fork changes stay separate. Abrupt crashes during active calls are not guaranteed.
- Guided Review runs in local interactive Pi only and does not post to GitHub.
Full list: Troubleshooting and current limits.
Stability
Bro is 0.x: a minor version can change commands or settings. Breaking changes are listed under Breaking in the changelog and release notes. Each release is published to npm from CI with provenance.
Contributing
npm ci
npm test # offline: uses fake backend CLIs, never calls a model
pi --tui-mode fullscreen -e ./src/bro.ts
See the contribution and security guides.
License
MIT. See LICENSE and THIRD_PARTY_NOTICES.md.