pi-studio
v0.7.0
Published
Two-pane browser workspace for pi with prompt/response editing, annotations, critiques, prompt/response history, and live Markdown/LaTeX/code preview
Maintainers
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, code files, and other common text-based files side by side. Annotate responses and files, add local comments, write, edit, and run prompts, browse prompt and response history, request critiques, and use live preview for code, Markdown, and LaTeX.
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
- Runs editor text directly, or asks for structured critique (auto/writing/code focus)
- Includes a live Working view for following current model/tool activity, with
All/Thinking/Toolsfilters plus Load visible into editor and Copy visible actions - 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
- Embeds local PDFs in Studio Markdown previews via explicit
studio-pdffenced blocks - Ships optional
pi-studio-darkandpi-studio-lightthemes tuned for Studio's browser workspace - Exports right-pane preview as PDF (pandoc + LaTeX)
- Exports local files headlessly via
/studio-pdf <path>to<name>.studio.pdf - 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 to <name>.studio.pdf via the Studio PDF pipeline, with optional layout controls |
Install
# npm
pi install npm:pi-studio
# GitHub
pi install https://github.com/omaclaren/pi-studioRun once without installing:
pi -e https://github.com/omaclaren/pi-studioStudio 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. - Full preview/PDF quality depends on
pandoc(andxelatexfor PDF):brew install pandoc- install TeX Live/MacTeX for PDF export
- 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
