A local web viewer for pi coding agent sessions.
Browse, search, and share all your pi sessions from a browser. Renders sessions using the same HTML/CSS as pi's /export command, with live incremental updates as you chat.
- Session browser - Grid view of all sessions, grouped by project
- Tree navigation - Full session tree with filters (same UI as
/export) - Live updates - New messages append without page refresh
- Follow mode - Auto-scrolls to latest message; pauses when you scroll up to read history
- Share - Create secret GitHub Gists directly from the browser
/viewcommand - Type/viewinside pi to open the current session
Requires Go 1.21+.
git clone https://github.com/ygncode/pi-sessions-viewer.git
cd pi-sessions-viewer
go build -o pi-sessions-viewer .
# Put on PATH
sudo cp pi-sessions-viewer /usr/local/bin/
# or
cp pi-sessions-viewer ~/.pi/agent/bin/# Start server (default port 27183)
pi-sessions-viewer
# Start and open browser
pi-sessions-viewer -o
# Custom port
pi-sessions-viewer -p 8080Then open http://localhost:27183.
cp com.pi-sessions-viewer.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/com.pi-sessions-viewer.plistThe viewer starts automatically on boot and runs in the background.
Install the extension to add a /view command inside pi:
cp view-sessions.ts ~/.pi/agent/extensions/Restart pi (or run /reload). Then type /view while in a session to open it in your browser.
Install the skill so pi suggests the viewer when relevant:
cp -r skill ~/.pi/agent/skills/pi-sessions-viewerOn any session page, click Share in the top-right to create a secret GitHub Gist.
Requirements:
ghCLI installed (brew install gh)- Logged in (
gh auth login)
The share produces:
- A secret gist URL
- A preview URL at
https://pi.dev/session/#<gistId>
Shared gists are static snapshots and do not auto-update.
Sessions are read from ~/.pi/agent/sessions/ as JSONL files. The server:
- Parses each
.jsonlsession file - Generates HTML using pi's export templates (embedded in the binary)
- Watches files for changes and pushes SSE events to the browser
- The browser fetches new entries via
/api/sessionand appends them incrementally
MIT