# Pi — Minimal Terminal Coding Harness You Own > Pi is a minimal terminal coding harness you customize with extensions, skills, and prompts, so you can run a consistent personal or team agent shell. ## Install Copy the content below into your project: ## Quick Use 1. Install: ```bash npm install -g @earendil-works/pi-coding-agent # or curl -fsSL https://pi.dev/install.sh | sh ``` 2. Start in a repo: ```bash cd /path/to/repo pi ``` 3. Authenticate (choose one): ```bash # subscription login inside pi /login # or API key export ANTHROPIC_API_KEY=sk-ant-... pi ``` ## Intro Pi is a minimal terminal coding harness you customize with extensions, skills, and prompts, so you can run a consistent personal or team agent shell. - **Best for:** developers who want an agent harness they can script and extend (skills, prompts, UI) across many projects - **Works with:** Node.js + npm; interactive mode plus one-shot `-p` prompts; supports context files like `AGENTS.md` - **Setup time:** 15–30 minutes ## Practical Notes - Use `AGENTS.md` per repo to encode rules (tests, migrations, output format). - Start with one workflow (lint/test/fix) and add extensions only when needed. ## Why a “harness” matters Most coding agents ship as a fixed product. Pi is intentionally small so you can: - encode team rules in context files, - add skills/prompts as reusable building blocks, - keep the workflow consistent across repos. ## Recommended setup for teams ### 1) Add project instructions Create `AGENTS.md` in the repo root: ```md - Run `npm test` after code changes. - Do not modify production migrations. - Keep PR summaries under 10 lines. ``` ### 2) Teach Pi your repo’s “definition of done” Ask Pi to: 1) find the relevant scripts (`package.json`, `Makefile`, etc.), 2) run checks, 3) propose the smallest diff, 4) re-run checks. ## One-shot mode for automation Pi supports non-interactive prompts: ```bash pi -p "Summarize this repo and tell me how to run checks." ``` This is useful for CI assistants or scheduled hygiene tasks. ### FAQ **Q: Is Pi a model?** A: No. It’s a harness that connects to providers and exposes tools, skills, and customization. **Q: How do I keep behavior consistent across repos?** A: Use shared skills/prompts and repo-local context files (`AGENTS.md`). **Q: Can I use it non-interactively?** A: Yes. Use `pi -p "..."` for one-shot prompts in scripts or CI. ## Source & Thanks > Source: https://github.com/earendil-works/pi > License: MIT > GitHub stars: 48,265 · forks: 5,740 --- ## 快速使用 1. 安装: ```bash npm install -g @earendil-works/pi-coding-agent # 或 curl -fsSL https://pi.dev/install.sh | sh ``` 2. 在仓库中启动: ```bash cd /path/to/repo pi ``` 3. 认证(二选一): ```bash # 在 pi 内用订阅登录 /login # 或使用 API key export ANTHROPIC_API_KEY=sk-ant-... pi ``` ## 简介 Pi 是一个极简的终端编码 harness:通过扩展、skills 与 prompt 模板自定义成你的个人/团队 agent 外壳,并用上下文文件固化规则,避免被某个固定 UX 绑死与被动迁移。 - **适合谁:** 想把 agent 工作流脚本化、并能跨项目复用扩展(skills/prompt/UI)的开发者 - **可搭配:** Node.js + npm;支持交互模式与一次性 `-p`;支持 `AGENTS.md` 等上下文文件 - **准备时间:** 15–30 分钟 ## 实战建议 - 在每个仓库用 `AGENTS.md` 写清规则(测试、迁移、输出格式等)。 - 先跑通一个核心工作流(lint/test/fix),再按需增加扩展。 ## 为什么“harness”很重要 很多 coding agent 是固定产品形态;Pi 刻意保持核心很小,便于你: - 用上下文文件固化团队规则, - 把 skills/prompts 做成可复用积木, - 跨仓库保持一致的交付标准。 ## 团队推荐落地方式 ### 1)写清项目规则 在仓库根目录加 `AGENTS.md`: ```md - 改代码后必须跑 `npm test`。 - 不要修改生产迁移脚本。 - PR 总结不超过 10 行。 ``` ### 2)把“完成标准”教给 Pi 让 Pi 按固定节奏做事: 1)找项目脚本(`package.json`/`Makefile` 等), 2)运行检查, 3)给出最小 diff, 4)再跑一次检查验证。 ## 一次性模式用于自动化 Pi 也支持非交互 prompt: ```bash pi -p "Summarize this repo and tell me how to run checks." ``` 适合 CI 助手或定时的仓库 hygiene 任务。 ### FAQ **Pi 是模型吗?** 答:不是。它是一个连接多种 provider 的 harness,并暴露 tools/skills/自定义能力。 **怎么跨仓库保持一致行为?** 答:复用共享 skills/prompts,并在每个仓库用 `AGENTS.md` 固化规则。 **能非交互使用吗?** 答:可以。用 `pi -p "..."` 做一次性调用,适合脚本或 CI。 ## 来源与感谢 > Source: https://github.com/earendil-works/pi > License: MIT > GitHub stars: 48,265 · forks: 5,740 --- Source: https://tokrepo.com/en/workflows/pi-minimal-terminal-coding-harness-you-own Author: Agent Toolkit