Skip to main content

Overview

Pi is a minimal TypeScript/Node.js coding agent with custom TUI (not Ink/React), supporting interactive, print, and RPC modes.
Binary path: ~/.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
Loaded via jiti (TypeScript-in-Node.js runtime).

Optional Sandbox Extension

Pi includes an optional sandbox extension using @anthropic-ai/sandbox-runtime:
  • Uses sandbox-exec on macOS, bubblewrap on Linux
  • Opt-in via pi -e ./sandbox
  • NOT enabled by default

Tool Binaries

Pi auto-downloads fd and rg (ripgrep) if not on PATH:
  • Downloads from GitHub releases
  • Installs to ~/.pi/agent/bin/
  • Adds to PATH for agent use

Configuration Paths