A minimal, mobile-first local/Tailscale web UI for @mariozechner/pi-coding-agent.
pi-web is designed to feel like the core pi agent in a browser: small, direct, self-aware about its environment, and focused on helping you work with code rather than becoming a heavyweight IDE. It runs locally, works comfortably from a phone over Tailscale, and gives pi the web-specific context it needs to render artifacts, images, sessions, diffs, and tool output clearly.
| Desktop | Mobile |
|---|---|
![]() |
![]() |
- Mobile-first: use pi from a phone, tablet, or desktop browser
- Minimal by design: a focused agent UI, not a full IDE replacement
- Local-first: run it on your machine and optionally expose it through Tailscale
- Self-aware: pi-web injects web UI context so sessions understand artifacts, images, restarts, and browser-specific behavior
- Code-review friendly: inspect tool output, edits, Git status, commits, and diffs
- Session-oriented: manage ongoing work with tabs, drawers, pins, buckets, filters, and conversation navigation
0.3.0 focuses on continuity and richer session review:
- Active sessions are reflected in the URL, so refreshes, browser history, and copied links preserve the selected workspace
- Session buckets now have default colors, and inactive running tabs are dimmed for easier scanning
- Drawer filtering and flat edit diffs are more reliable
- Markdown messages can render Mermaid diagrams inline
- README showcase content and screenshots were refreshed for the current UI
See the 0.3.0 release notes for the fuller changelog.
For development:
npm installFrom npm:
npm i -g @ashwin-pc/pi-web
pi-webFrom a GitHub release asset:
# Download pi-web-<version>.tgz from the release page, then:
npm install -g ./pi-web-*.tgz
pi-webpi-web starts the production server on http://127.0.0.1:8787 by default. It runs Pi in the directory where you call the command; override with PI_WEB_CWD=/path/to/project pi-web.
npm run devThis starts a stable TypeScript supervisor on 8787 and a restartable child server on 8788. The public URL still serves:
- Vite frontend with HMR
- Pi API routes under
/api/* - Pi WebSocket at
/ws
The supervisor also exposes:
POST /api/restart- restart the child server safelyGET /__supervisor/status- inspect child PID/generation
Open:
http://127.0.0.1:8787
Edit files under src/ and Vite will update the UI live. If the agent edits server.ts, call POST /api/restart instead of killing the public server; the supervisor stays alive and the browser reconnects.
By default, Pi operates in the directory where you start this server. To point Pi at another project:
PI_WEB_CWD=/Users/ashwin/projects/comfy-lan-webapp npm run devThe session UI is built for small screens first, then scales up to desktop. Tabs, the session drawer, pinned sessions, bucket filters, and conversation navigation are designed to keep long-running pi work reachable from a phone without hiding the desktop workflow.
A shared diff viewer supports side-by-side or stacked layouts with intraline highlighting. It is used by both edit tool cards and Git diffs, so code review feels consistent across agent changes and repository history.
The Git button in the header opens a responsive Git panel for repo status, commit history, per-file diffs, per-commit diffs, and sync with fetch + rebase pull.
contexts/web-ui.md is injected into agent sessions so pi understands pi-web behavior such as artifact links, image rendering, and supervised restarts. Bundled pi extensions add pi-web defaults, including automatic session naming from the first prompt.
pi-web supports browser-specific extensions in .pi/web/extensions and ~/.pi/web/extensions. These use pi's extension runtime with a typed pi-web UI API, including ctx.ui.web.setFooter(...) for rendering text or trusted HTML between the composer and pinned session tabs.
See pi-web extensions for locations, types, and examples.
The README references the same deterministic Playwright visual snapshots used by tests/e2e/visual.spec.ts. Desktop and mobile captures are shown side by side, and when visual snapshots are intentionally updated, these images update with them.
| Desktop | Mobile |
|---|---|
![]() |
![]() |
Tabs, pinned sessions, bucket colors, running indicators, and the session drawer are designed to stay usable on mobile while expanding naturally on desktop.
| Desktop | Mobile |
|---|---|
![]() |
![]() |
Desktop uses a split master/detail layout; mobile switches between status, graph, diff, and commit detail views.
| Desktop | Mobile |
|---|---|
![]() |
![]() |
Navigate in-file pi session branches with a compact tree drawer. The default view keeps tool noise hidden, while the full session structure remains available from the filter.
| Desktop | Mobile |
|---|---|
![]() |
![]() |
npm run build
npm startnpm start serves the compiled dist/ app and API from one process.
Recommended: keep the Node app localhost-only and expose it with Tailscale Serve.
npm run build
PI_WEB_TOKEN="$(openssl rand -hex 32)" \
PI_WEB_CWD=/Users/ashwin/projects/comfy-lan-webapp \
HOST=127.0.0.1 \
PORT=8787 \
npm startIn another terminal:
tailscale serve --bg http://127.0.0.1:8787Then open:
https://<machine-name>.<tailnet>.ts.net
Click Token in the UI and paste the PI_WEB_TOKEN value.
You can also bind directly to your Tailscale IP:
PI_WEB_TOKEN="$(openssl rand -hex 32)" \
HOST="$(tailscale ip -4)" \
PORT=8787 \
npm startThen open:
http://<machine-name>:8787
HOST- bind host, default127.0.0.1PORT- bind port, default8787PI_WEB_TOKEN- optional bearer token for API/WebSocket accessPI_WEB_CWD- project directory Pi should operate in, default current directoryPI_WEB_NO_SESSION=1- use in-memory sessions onlyPI_WEB_CHILD_PORT- supervised child port, default8788PI_WEB_RESTART_GRACE_MS- delay between child stop/start, default250
The app is TypeScript end-to-end:
supervisor.tsis a small stable dev supervisor that owns the public port and restarts the app server safelyserver.tsis the restartable Pi API/WebSocket server, run directly withtsxsrc/main.tsbootstraps the modular Vite frontend with HMR; see docs/frontend-architecture.md- in dev,
server.tsembeds Vite middleware whilesupervisor.tsproxies API, WebSocket, and HMR traffic AGENTS.mdprovides normal project-specific pi instructions when the target cwd is this repo
This app can drive Pi tools such as bash, write, and edit. Use Tailscale ACLs and set PI_WEB_TOKEN.









