master
Xi
A personal coding agent built in ClojureScript + Bun, featuring a terminal UI (TUI), a WebSocket server hosting multiple rooms, and a browser-based web client — all sharing the same pure event handlers.
Highlights
- One state atom per process. All logic is pure handlers
(fn [state event]) → {:state :effects}; side effects run only in a dedicated effect interpreter. - Everything is an event — prompts, agent output, commands, dialogs, room switches, and renders all flow through the same dispatch loop. The WS wire protocol is those same event maps as EDN.
- Three assemblies, one codebase — standalone TUI, WS server + TUI client, and a Replicant-based web client (with offline localStorage caching) are all compositions of the same handlers over different transports.
- Pluggable providers — Claude Agent SDK and Ollama.
- Data-driven extensions — each extension is a plain data map
(
:handlers :fx :tool-gate :commands :system-prompt …), composed at assembly time. Includes a knowledge base, web/perplexity search, GTD tasks, a permission gate, plan mode, and more. - Built-in tools — bash, read, write, edit, grep, find, ls, exposed to the agent via an MCP tool bridge.
Documentation
- docs/architecture.md — the full system picture
- docs/web-client.md — web client features & protocol
- docs/extensions.md — extension model
- docs/frontend.md — UI component library & theming
- AGENTS.md — build tasks & operational notes
Build
npm install # install shadow-cljs + the Claude Agent SDK
bb build # compile CLJS → JS (node TUI/server)
bb web:build # compile the browser web client
bb test # compile and run tests
bb tasks # list all available tasks
Requires Babashka (bb) and Bun.
Dependencies hosted on a private registry
Two dependencies are pulled from the author's self-hosted Gitea and are not publicly reachable. To build from a clean checkout, mirror them to a host you control and update the URLs:
clj-ui-framework— a cross-target UI component library (deps.edn,docs/frontend.md)tmux-dev— dev-loop tmux helpers used by thebbtasks (bb.edn)
Configuration
Copy .env.example to .env and fill in values if you want
optional Pushover notifications. Agent auth uses ~/.pi/agent/auth.json OAuth
tokens or the ANTHROPIC_API_KEY environment variable.
Description
Languages
Clojure
87.9%
CSS
10.8%
JavaScript
0.8%
HTML
0.5%