Development
See AGENTS.md for additional guidelines.
git clone https://github.com/earendil-works/pi-monocd pi-mononpm installnpm run buildRun from source:
/path/to/pi-mono/pi-test.shThe script can be run from any directory. Pi keeps the caller’s current working directory.
Forking / Rebranding
Section titled “Forking / Rebranding”Configure via package.json:
{ "piConfig": { "name": "pi", "configDir": ".pi" }}Change name, configDir, and bin field for your fork. Affects CLI banner, config paths, and environment variable names.
Path Resolution
Section titled “Path Resolution”Three execution modes: npm install, standalone binary, tsx from source.
Always use src/config.ts for package assets:
import { getPackageDir, getThemeDir } from "./config.js";Never use __dirname directly for package assets.
Debug Command
Section titled “Debug Command”/debug (hidden) writes to ~/.pi/agent/pi-debug.log:
- Rendered TUI lines with ANSI codes
- Last messages sent to the LLM
Testing
Section titled “Testing”./test.sh # Run non-LLM tests (no API keys needed)npm test # Run all testsnpm test -- test/specific.test.ts # Run specific testProject Structure
Section titled “Project Structure”packages/ ai/ # LLM provider abstraction agent/ # Agent loop and message types tui/ # Terminal UI components coding-agent/ # CLI and interactive mode