開發
請參閱 AGENTS.md 瞭解更多指南。
設定
git clone https://github.com/earendil-works/pi-mono
cd pi-mono
npm install
npm run build從源執行:
/path/to/pi-mono/pi-test.sh該指令碼可以從任何目錄執行。 Pi 保留呼叫者目前的工作目錄。
分叉/品牌重塑
透過 package.json 設定:
{
"piConfig": {
"name": "pi",
"configDir": ".pi"
}
}更改你的 fork 的 name、configDir 和 bin 欄位。影響 CLI 橫幅、設定路徑和環境變數名稱。
路徑解析
三種執行模式:npm 安裝、獨立二進制、來自原始碼的 tsx。
始終對包資源使用 src/config.ts:
import { getPackageDir, getThemeDir } from "./config.js";切勿直接將 __dirname 用於包資源。
除錯指令
/debug(隱藏)寫入 ~/.pi/agent/pi-debug.log:
- 使用 ANSI 程式碼渲染 TUI 行
- 傳送給 LLM 的最新訊息
測試
./test.sh # Run non-LLM tests (no API keys needed)
npm test # Run all tests
npm test -- test/specific.test.ts # Run specific test專案結構
packages/
ai/ # LLM provider abstraction
agent/ # Agent loop and message types
tui/ # Terminal UI components
coding-agent/ # CLI and interactive mode