$ cat ~/map/pi-chat.md
Pi Chat
Minimal local browser chat for pi: streaming replies, persistent sessions, and in-pi launching via /pi-chat-start.
tools✓ Sep 14
Facts
- repository
- github.com/ManuelSelch/pi-chat ↗
- GitHub Stars
- ★ 1
- Forks
- 0
- license
- —
- npm / mo
- —
- last push
- Oct 15, 2026
install
npm install then npm run dev (the server binds to the machine's loopback interface only); link extension/pi-chat.ts into ~/.pi/agent/extensions for the in-pi slash commands## TL;DR
A minimal local browser chat driven by the existing Pi SDK, credentials, tools, and persistent sessions, streaming replies over a typed WebSocket protocol.
## Key points
- $Powered by the existing Pi SDK, credentials, tools, and persistent sessions — the first prompt creates a standard persistent Pi session, and existing credentials and configuration load from the normal Pi agent directory.
- $Server-authoritative architecture: a typed, runtime-validated WebSocket protocol; a snapshot replaces browser state on every connection and reload; subsequent events use monotonic sequence numbers; Pi SDK event shapes do not cross the network boundary; provider credentials stay server-side.
- $The Slice 0/1 demo ships prompt and abort controls, real-time assistant text streaming, persistent current-project sessions, and a minimal responsive chat interface; Markdown/KaTeX, tool cards, project/session selection, slash autocomplete, and file references are listed as later slices.
- $extension/pi-chat.ts adds slash commands inside pi — /pi-chat-start with --port, --cwd, and --no-open, plus /pi-chat-stop, /pi-chat-restart, and the /pi-chat status command — installed by linking the file into ~/.pi/agent/extensions.
- $PI_CHAT_MODEL selects the model with the same spelling as the Pi CLI, resolved after extensions load so extension-provided providers work, and an unknown name fails fast at startup; PI_CHAT_CWD points the server at another working directory; npx tsx scripts/list-models.ts lists models with working auth.
- $Transport tests run against a fake runtime and cost no tokens; npm test covers protocol, chat-state reducer, message mapping, and transport integration.
## FAQ
Q Where do sessions and credentials live?
In pi's normal places — the first prompt creates a standard persistent session file, and existing credentials and configuration load from the normal Pi agent directory; the browser only talks to the local server.
Q Does the browser talk to Pi SDK types directly?
No — Pi SDK event shapes do not cross the network boundary; the server maps them onto a typed WebSocket protocol, and a fake runtime adapter covers deterministic transport tests.
## References
## Related entries
$ vagusPI
Web GUI sharing the pi CLI's ~/.pi/agent config — chat, sessions, models, and packages from your browser.
$ Pi Studio
Local web UI for pi: project folders, searchable history, streaming replies, and live token and cost meters.
$ pi-remote
Phone remote control for pi: one Python process wraps pi --mode rpc — self-hosted, relay-free, built for native Windows.
## Guides
Last updated: Sep 14, 2026