Development¶
See AGENTS.md for additional guidelines.
Setup¶
Run from source:
Forking / Rebranding¶
Configure via package.json:
Change name, configDir, and bin field for your fork. Affects CLI banner, config paths, and environment variable names.
Path Resolution¶
Three execution modes: npm install, standalone binary, tsx from source.
Always use src/config.ts for package assets:
Never use __dirname directly for package assets.
Debug Command¶
/debug (hidden) writes to ~/.pi/agent/pi-debug.log:
- Rendered TUI lines with ANSI codes
- Last messages sent to the LLM
Testing¶
./test.sh # Run non-LLM tests (no API keys needed)
npm test # Run all tests
npm test -- test/specific.test.ts # Run specific test