Overview
Pi is a minimal TypeScript/Node.js coding agent with custom TUI (not Ink/React), supporting interactive, print, and RPC modes.Binary path:
Config:
License: MIT (open source)
~/.local/bin/pi (via npm global)Config:
~/.pi/agent/License: MIT (open source)
Sandbox Profile
Running in Safehouse
Custom TUI
Pi uses its own terminal UI library (@mariozechner/pi-tui):
- Differential rendering (ANSI escape codes to stdout)
- Kitty keyboard protocol support
- Terminal image support (Kitty, iTerm2)
- OSC 8 hyperlink support
Credentials
No keyring integration. Credentials stored in:~/.pi/agent/auth.json(mode 0o600, plain JSON)- API keys and OAuth tokens in one file
- File locking via
proper-lockfile
OAuth Flows
Extension System
Extensions can:- Register custom tools (including replacing bash tool)
- Register custom commands
- Hook into session events
- Spawn subprocesses, access filesystem, make network requests
jiti (TypeScript-in-Node.js runtime).
Optional Sandbox Extension
Pi includes an optional sandbox extension using@anthropic-ai/sandbox-runtime:
- Uses
sandbox-execon macOS,bubblewrapon Linux - Opt-in via
pi -e ./sandbox - NOT enabled by default
Tool Binaries
Pi auto-downloadsfd and rg (ripgrep) if not on PATH:
- Downloads from GitHub releases
- Installs to
~/.pi/agent/bin/ - Adds to
PATHfor agent use