Native review workspaces for pi, powered by Glimpse, Monaco, and a TypeScript web UI.
This repository started as a fork of
badlogic/pi-diff-review. The fork
has since grown into pi-workbench, a home for native Pi workspaces that help
review structured context, add feedback, navigate relevant code, run side
conversations, and send final instructions back into pi.
pi-workbench owns these workflows directly. For example, /btw is now a
feature in this repository rather than a wrapper around the standalone
pi-btw package.
pi install git:https://github.com/MartinMinkov/pi-workbenchpi-workbench currently registers three native workspaces:
/diff-reviewopens a native review window for the current git repository. From there you can review a working tree diff, the last commit, or the full repository snapshot without loading every file up front./response-reviewopens a native response review workspace for the current Pi session./btwopens a native side-conversation workspace backed by a real Pi sub-session.
Latest diff-review features include:
- Native Glimpse review window with a Monaco diff editor.
- Review scopes for
git diff,last commit, andall files. - Lazy file loading and cached file contents per scope.
- Status-aware sidebar for modified, added, deleted, renamed, and untracked files.
- Sidebar filters for status, reviewed files, commented files, and changed files.
- Repository-wide code search from the sidebar, with inline match previews.
- Collapsible file tree and collapsible sidebar.
- Inline comments on the original side, modified side, or whole file.
- Structured comment kinds: feedback, question, risk, explain, and tests.
- Editable submitted comments before finishing the review.
- A review queue that tracks submitted comments and lets you jump back to them.
- Overall review notes that are prepended to the generated pi prompt.
- Mark-reviewed state for files, with an option to hide reviewed files.
- Line wrapping and changed-region display toggles for the editor.
- Per-file scroll restoration while moving between files and scopes.
- Waiting UI in pi while the native review window is open.
- Safer submit, cancel, and teardown handling for review windows.
The review workspace also includes code-navigation tools:
- Back and forward navigation history inside the review window.
- Clickable navigation links for supported symbols, imports, and module paths.
- Changed-symbol outline for the active file.
- Current-symbol display in the editor header.
- Quick-open files with
Cmd/Ctrl+P. - Command palette with
Cmd/Ctrl+Shift+P. - Keyboard shortcuts for focusing code search, marking files reviewed, and moving between submitted comments.
Semantic definition lookup is available for:
- Rust, via
rust-analyzerwhen it is installed. - Go, via
goplswhen it is installed. - TypeScript and JavaScript, via the bundled TypeScript language service.
For other languages, the UI falls back to repository-local import and module path navigation where possible.
- Run
/diff-reviewin pi while inside a git repository. - Pick a scope:
git diff,last commit, orall files. - Search, filter, and navigate files from the sidebar.
- Add inline comments, file comments, or an overall review note.
- Edit or delete submitted comments from the review queue if needed.
- Finish the review to insert a structured feedback prompt into pi.
The generated prompt preserves comment kind, scope, file path, line range, and old/new side context so pi can apply the feedback with useful location metadata.
- Run
/response-reviewin pi after one or more assistant responses. - Pick an assistant response from the sidebar.
- Navigate headings/code blocks from the outline.
- Select text and press
Cor use the comment button to add anchored feedback. - Add optional overall feedback and a draft/next prompt.
- Finish the review to insert a structured follow-up prompt into pi.
BTW is a native workspace for side conversations that should not derail the main Pi thread. It opens a real Pi sub-session with coding-tool access, keeps the side-thread transcript in the workspace, and can hand the result back to the main session when you are ready.
Common commands:
/btw <question>
/btw --save <question>
/btw:new [question]
/btw:tangent [question]
/btw:inject [instructions]
/btw:summarize [instructions]
/btw:model [<provider> <model> <api> | clear]
/btw:thinking [<level> | clear]
/btw:clear
Typical flow:
- Run
/btw <question>to open the native BTW workspace and ask a side question. - Continue the side thread from the workspace composer while the main session stays focused.
- Use
New,Tangent, model/thinking overrides, or/btw:*commands for lifecycle control. - Use
Injectfor the full thread orSummarizefor a condensed handoff back to the main Pi session.
- macOS, Linux, or Windows.
- Node.js 20+.
pnpmfor dependency management.piinstalled.- Internet access for the Tailwind and Monaco CDNs used by the review window.
bunonly if you want to rebuilddist/web/locally.- Optional:
rust-analyzerand/orgoplsfor semantic Rust and Go navigation.
Glimpse supports Windows. To build the native host during install you need:
- .NET 8 SDK.
- Microsoft Edge WebView2 Runtime.
pnpm install
pnpm run check
pnpm run check:web
pnpm run lint
pnpm run build:webThe web UI source lives under each feature's web/ directory and is bundled
into dist/web/<feature>/. The pre-commit hook runs both TypeScript checks,
rebuilds the web bundle, and stages the generated dist/web assets.
src/extension.ts- package entry point that registers all workbench features.src/features/diff-review/- diff review feature slice.host/- pi command registration, repository loading, navigation, prompt composition.web/- Monaco diff review workspace.shared/- diff-review contracts and pure shared helpers.
src/features/response-review/- assistant response review feature slice.host/- session extraction, command registration, prompt composition.web/- response picker, rendered response view, annotations, review queue.shared/- response-review contracts.
src/features/btw/- native BTW side-conversation feature slice.host/- Pi sub-session runtime, persistence, handoff commands, workspace lifecycle.web/- transcript, composer, model/thinking controls, handoff actions.
src/shared/host/- host-only helpers shared across features.src/shared/web/- browser-only helpers shared across features.src/shared/contracts/- runtime-neutral contracts shared across features.dist/web/- built web assets consumed by native Glimpse windows.
Recent history shows the fork expanding beyond the original native diff review:
- Added review scopes, lazy loading, and last-commit review support.
- Refactored the web UI into a modular TypeScript runtime.
- Added review navigation, reference workflows, and semantic language backends.
- Added the command palette, repository code search, and changed-symbol inspector.
- Improved comment drafting, editing, paste handling, and review-queue navigation.
- Hardened waiting UI, backend failure handling, and review-window teardown.