pi-studio
Two-pane browser workspace for pi with prompt/response editing, annotations, critiques, active quiz, prompt/response history, live previews, and tmux-backed REPL/literate REPL workflows
Package details
Install pi-studio from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-studio- Package
pi-studio- Version
0.9.11- Published
- May 19, 2026
- Downloads
- 7,871/mo · 3,079/wk
- Author
- omacl
- License
- MIT
- Types
- extension, theme
- Size
- 8.6 MB
- Dependencies
- 3 dependencies · 1 peer
Pi manifest JSON
{
"extensions": [
"./index.ts"
],
"themes": [
"./themes"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-studio
Extension for pi that opens a local two-pane browser workspace for working with prompts, responses, live working details, Markdown and LaTeX documents, interactive HTML previews, code files, REPL sessions, and other common text-based files side by side. Annotate responses and files, add local comments, write, edit, run prompts, send code to a REPL, browse prompt and response history, request critiques, and use live preview for code, Markdown, LaTeX, and interactive HTML.
Quick demo
Watch the 2-minute demo (MP4, 2x speed, no audio)
Screenshots
Dark

Light

What it does
- Opens a two-pane browser workspace: Editor (left) + Response/Working/Editor Preview (right)
- Supports one canonical full Studio view per Pi session, plus additional editor-only companion views when you just want extra editing/preview surfaces; the editor toolbar can open a detached copy of the current editor text as a companion view
- Includes a global Zen mode for hiding secondary Studio chrome without changing the current left/right pane layout
- Runs editor text directly, asks for structured critique (auto/writing/code focus), or opens Quiz me for a Studio-native active-recall loop over the current editor text, selection, current file, folder, or repo, with optional focus guidance for shaping question selection
- Includes a live Working view for following current model/tool activity, with
All/Thinking/Toolsfilters, image previews for image-producing tool outputs, plus Load visible into editor and Copy visible actions; when cycling response history, Working follows saved working details for the selected response when available - Includes an optional tmux-backed REPL view for Shell, Python, IPython, Julia, R, GHCi, and Clojure sessions, with Raw/Literate send modes,
Cmd/Ctrl+Shift+EnterSend to REPL, session start/new/stop/interrupt controls, a compact refresh-persistent REPL Studio record of user and Pi-sent code, a secondary raw tmux mirror, agent-facingstudio_repl_status/studio_repl_sendtools, and Markdown/PDF/HTML export - Includes a local persistent scratchpad for quick notes you want to keep out of the main editor until you're ready to copy or insert them
- Includes a docked Outline rail for navigating document structure in the current editor text, with clickable entries that jump in the raw editor and reveal matching preview locations when available
- Includes local comments anchored to selections/lines, shown in a docked Comments rail, with transient Comment / Jump actions from raw-editor selections plus editor-preview selections for Markdown, LaTeX, and code/text/diff previews, alongside optional inline
[an: ...]toggles when you want comments reflected in the document text - Browses response history (
Prev/Next/Last) and loads either:- response text
- critique notes/full critique
- the prompt that generated a selected response
- Supports an annotation workflow for
[an: ...]markers:- inserts/removes the annotated-reply header
- shows/hides annotation markers in preview
- strips markers before send (optional)
- saves
.annotated.md
- Renders Markdown/LaTeX/code previews (math + Mermaid), theme-synced with pi, with copy buttons for code blocks and blockquotes
- Renders straight, unfenced interactive HTML in preview via a sandboxed browser iframe with zoom controls, while fenced
htmlblocks remain source code - Embeds local PDFs in Studio Markdown previews via explicit
studio-pdffenced blocks, with a Focus action for temporarily enlarging the embedded viewer - Ships optional
pi-studio-darkandpi-studio-lightthemes tuned for Studio's browser workspace - Exports right-pane preview as PDF (pandoc + LaTeX) or standalone HTML, preserving authored HTML previews as HTML
- Exports local files headlessly via
/studio-pdf <path>to<name>.studio.pdfor/studio-html <path>to<name>.studio.html; without a path, those commands export the last model response to a timestamped file - Shows model/session/context usage in the footer, plus a compact-context action
Commands
| Command | Description |
|---|---|
/studio |
Open with last assistant response (fallback: blank) |
/studio <path> |
Open with file preloaded |
/studio --last |
Force last response |
/studio --blank |
Force blank editor |
/studio --status |
Show studio server status |
/studio --stop |
Stop studio server |
/studio --help |
Show help |
/studio-replace [path|--blank|--last] |
Replace the current full Studio view with a new full Studio view |
/studio-editor-only [path|--blank|--last] |
Open an editor-only Studio view; multiple editor-only views may be open at once |
/studio-current <path> |
Load a file into currently open Studio tab(s) without opening a new browser window |
/studio-pdf [path] [options] |
Export a local file, or the last model response when no path is given, via the Studio PDF pipeline |
/studio-html [path] |
Export a local file, or the last model response when no path is given, to standalone HTML via the Studio preview pipeline |
Install
# npm
pi install npm:pi-studio
# GitHub
pi install https://github.com/omaclaren/pi-studio
Run once without installing:
pi -e https://github.com/omaclaren/pi-studio
Studio Markdown extras
Studio previews standard Markdown, code fences, display math, Mermaid, and local images. When adding companion files such as generated plots or PDFs, prefer the project's existing folder convention. If there is no convention, attachments/ is a reasonable default for newly generated assets. Use relative paths from the opened Markdown file or Studio working/resource directory, and wrap paths in angle brackets when spaces are possible:

Local PDFs can be embedded with an explicit Studio-only fenced block:
```studio-pdf
path: attachments/paper.pdf
title: Optional title
page: 3
height: 760
caption: Optional caption
```
path must point to a local .pdf within the current Studio resource directory. Relative paths resolve from the opened document's directory, or from Studio's working dir for non-file-backed content. page is an initial page hint for the browser PDF viewer, and height controls the embedded frame height in pixels. Use normal Markdown links for PDFs when embedding is not useful.
Notes
- Local-only server (
127.0.0.1) with tokenized Studio URLs. - For remote SSH sessions, keep Studio bound to localhost and use SSH local port forwarding;
/studioand/studio --statusprint the full tokenized localhost URL. The SSH hint repeats the full URL so it is visible even if your terminal only shows the latest notification. Open that URL through the tunnel, preserving the?token=...parameter. - Full Studio is a singleton per Pi session: use
/studioto open it,/studio-replaceto explicitly replace it, and/studio-editor-onlyfor extra editing/preview tabs that do not take over the full Studio session view. - Studio is designed as a complement to terminal pi, not a replacement.
- Installing pi-studio makes the optional
pi-studio-darkandpi-studio-lightthemes available in pi's theme selector; it does not change your active theme. - Editor/code font uses a best-effort terminal-monospace match when the current terminal config exposes it; set
PI_STUDIO_FONT_MONOto force a specific CSSfont-familystack. UsePI_STUDIO_FONT_UIorPI_STUDIO_FONT_PROSEto override the Studio UI or rendered-preview font stacks. - The optional REPL view requires
tmux. Studio can start and stop Studio-ownedpi-studio-repl-*sessions and can mirror detectedpi-repl-*sessions, but it will not stop externalpi-repl-*sessions. - Full preview/PDF quality depends on
pandoc(andxelatexfor PDF):brew install pandoc- install TeX Live/MacTeX for PDF export
- Export subprocess timeouts default to bounded values and can be tuned with
PI_STUDIO_PANDOC_TIMEOUT_MS,PI_STUDIO_LATEX_TIMEOUT_MS,PI_STUDIO_MERMAID_TIMEOUT_MS, andPI_STUDIO_HTML_RENDER_OUTPUT_MAX_BYTESfor unusually large embedded-asset HTML exports. - Mermaid diagrams in exported PDFs may also require Mermaid CLI (
mmdc/@mermaid-js/mermaid-cli) when you want diagram blocks rendered as diagrams rather than left as code.
License
MIT