开发
更多指南请参阅 AGENTS.md。
git clone https://github.com/earendil-works/pi-monocd pi-mononpm installnpm run build从源码运行:
/path/to/pi-mono/pi-test.sh该脚本可在任意目录运行。Pi 会保留调用者的当前工作目录。
Fork / 品牌定制
Section titled “Fork / 品牌定制”通过 package.json 配置:
{ "piConfig": { "name": "pi", "configDir": ".pi" }}修改 name、configDir 和 bin 字段以适配你的 fork。这会影响 CLI 横幅、配置路径和环境变量名称。
三种运行方式:npm 安装、独立二进制、tsx 源码运行。
始终使用 src/config.ts 解析包内资源:
import { getPackageDir, getThemeDir } from "./config.js";不要直接使用 __dirname 解析包资源。
/debug(隐藏命令)写入 ~/.pi/agent/pi-debug.log:
- 带 ANSI 码的 TUI 渲染行
- 最近发送给 LLM 的消息
./test.sh # 运行非 LLM 测试(无需 API 密钥)npm test # 运行全部测试npm test -- test/specific.test.ts # 运行指定测试packages/ ai/ # LLM 提供商抽象 agent/ # Agent 循环与消息类型 tui/ # 终端 UI 组件 coding-agent/ # CLI 与交互模式