skills/pi-agent/references/development.md
Source: https://pi.dev/docs/latest/development
Use this when working on Pi itself.
git clone https://github.com/earendil-works/pi-mono
cd pi-mono
npm install
npm run build
Run from source:
/path/to/pi-mono/pi-test.sh
The script can be run from any directory and preserves the caller's cwd.
Configure package.json:
{
"piConfig": {
"name": "pi",
"configDir": ".pi"
}
}
Change name, configDir, and bin for a fork. This affects CLI banner, config paths, and environment variable names.
Pi has npm install, standalone binary, and tsx-from-source execution modes. Always use src/config.ts helpers such as getPackageDir and getThemeDir for package assets. Do not use __dirname directly for assets.
/debug writes rendered TUI lines and last LLM messages to ~/.pi/agent/pi-debug.log.
./test.sh
npm test
npm test -- test/specific.test.ts
packages/
ai/ # LLM provider abstraction
agent/ # Agent loop and message types
tui/ # Terminal UI components
coding-agent/ # CLI and interactive mode