earendil-works / pi

earendil-works / pi

pi.dev domain graciously donated by exe.dev. New issues and PRs from new contributors are auto-closed by default. Maintainers review auto-closed issues daily. See CONTRIBUTING.md. pi.dev 域名由 exe.dev 慷慨捐赠。来自新贡献者的问题(Issues)和拉取请求(PRs)默认会自动关闭。维护者会每日审查这些自动关闭的问题。详情请参阅 CONTRIBUTING.md。

Pi Agent Harness Mono Repo. This is the home of the pi agent harness project including our self-extensible coding agent. Pi Agent Harness 单体仓库(Mono Repo)。这是 pi agent harness 项目的所在地,包含了我们可自我扩展的编码智能体。

  • @earendil-works/pi-coding-agent: Interactive coding agent CLI
  • @earendil-works/pi-agent-core: Agent runtime with tool calling and state management
  • @earendil-works/pi-ai: Unified multi-provider LLM API (OpenAI, Anthropic, Google, …)
  • @earendil-works/pi-coding-agent:交互式编码智能体 CLI
  • @earendil-works/pi-agent-core:具备工具调用和状态管理的智能体运行时
  • @earendil-works/pi-ai:统一的多供应商 LLM API(支持 OpenAI、Anthropic、Google 等)

To learn more about pi: Visit pi.dev, the project website with demos. Read the documentation, but you can also ask the agent to explain itself. 了解更多关于 pi 的信息:访问项目网站 pi.dev 查看演示。阅读文档,或者你也可以直接询问智能体让它进行自我解释。

Share your OSS coding agent sessions. If you use pi or other coding agents for open source work, please share your sessions. Public OSS session data helps improve coding agents with real-world tasks, tool use, failures, and fixes instead of toy benchmarks. For the full explanation, see this post on X. 分享你的开源(OSS)编码智能体工作会话。如果你在开源工作中使用 pi 或其他编码智能体,请分享你的会话。公开的开源会话数据有助于通过真实任务、工具使用、故障和修复来改进编码智能体,而不是仅仅依赖玩具基准测试。完整说明请参阅 X 上的这篇帖子。

To publish sessions, use badlogic/pi-share-hf. Read its README.md for setup instructions. All you need is a Hugging Face account, the Hugging Face CLI, and pi-share-hf. You can also watch this video, where I show how I publish my pi-mono sessions. I regularly publish my own pi-mono work sessions here: badlogicgames/pi-mono on Hugging Face. 要发布会话,请使用 badlogic/pi-share-hf。阅读其 README.md 获取设置说明。你只需要一个 Hugging Face 账户、Hugging Face CLI 和 pi-share-hf。你也可以观看此视频,我在其中演示了如何发布我的 pi-mono 会话。我会定期在 Hugging Face 上的 badlogicgames/pi-mono 发布我自己的 pi-mono 工作会话。

All Packages / 所有包

PackageDescription
@earendil-works/pi-aiUnified multi-provider LLM API (OpenAI, Anthropic, Google, etc.)
@earendil-works/pi-agent-coreAgent runtime with tool calling and state management
@earendil-works/pi-coding-agentInteractive coding agent CLI
@earendil-works/pi-tuiTerminal UI library with differential rendering
包名描述
@earendil-works/pi-ai统一的多供应商 LLM API(OpenAI、Anthropic、Google 等)
@earendil-works/pi-agent-core具备工具调用和状态管理的智能体运行时
@earendil-works/pi-coding-agent交互式编码智能体 CLI
@earendil-works/pi-tui具备差异化渲染的终端 UI 库

For Slack/chat automation and workflows see earendil-works/pi-chat. 有关 Slack/聊天自动化和工作流,请参阅 earendil-works/pi-chat。

Contributing / 贡献

See CONTRIBUTING.md for contribution guidelines and AGENTS.md for project-specific rules (for both humans and agents). 请参阅 CONTRIBUTING.md 获取贡献指南,参阅 AGENTS.md 获取项目特定规则(适用于人类和智能体)。

Development / 开发

npm install --ignore-scripts # Install all dependencies without running lifecycle scripts
npm run build # Build all packages
npm run check # Lint, format, and type check
./test.sh # Run tests (skips LLM-dependent tests without API keys)
./pi-test.sh # Run pi from sources (can be run from any directory)

Supply-chain hardening / 供应链加固

We treat npm dependency changes as reviewed code changes. Direct external dependencies are pinned to exact versions. Internal workspace packages remain version-ranged. .npmrc sets save-exact=true and min-release-age=2 to avoid same-day dependency releases during npm resolution. 我们将 npm 依赖项的变更视为已审查的代码变更。直接的外部依赖项被锁定在精确版本。内部工作区包保持版本范围。 .npmrc 设置了 save-exact=truemin-release-age=2,以避免在 npm 解析过程中使用当天发布的依赖项。

package-lock.json is the dependency ground truth. Pre-commit blocks accidental lockfile commits unless PI_ALLOW_LOCKFILE_CHANGE=1 is set. npm run check verifies pinned direct deps, native TypeScript import compatibility, and the generated coding-agent shrinkwrap. package-lock.json 是依赖关系的唯一事实来源。Pre-commit 会阻止意外的 lockfile 提交,除非设置了 PI_ALLOW_LOCKFILE_CHANGE=1npm run check 会验证锁定的直接依赖项、原生 TypeScript 导入兼容性以及生成的 coding-agent shrinkwrap。

The published CLI package includes packages/coding-agent/npm-shrinkwrap.json, generated from the root lockfile, to pin transitive deps for npm users. Release smoke tests use npm run release:local to build, pack, and create isolated npm and Bun installs outside the repo before publishing. 发布的 CLI 包包含从根 lockfile 生成的 packages/coding-agent/npm-shrinkwrap.json,用于为 npm 用户锁定传递依赖项。发布冒烟测试使用 npm run release:local 在发布前在仓库外构建、打包并创建隔离的 npm 和 Bun 安装环境。

Local release installs, documented npm installs, and pi update —self use —ignore-scripts where supported. CI installs with npm ci —ignore-scripts, and a scheduled GitHub workflow runs npm audit —omit=dev plus npm audit signatures —omit=dev. Shrinkwrap generation has an explicit allowlist for dependency lifecycle scripts; new lifecycle-script deps fail checks until reviewed. 本地发布安装、文档化的 npm 安装以及 pi update --self 在支持的情况下均使用 --ignore-scripts。CI 使用 npm ci --ignore-scripts 进行安装,定时 GitHub 工作流会运行 npm audit --omit=dev 以及 npm audit signatures --omit=dev。Shrinkwrap 生成过程对依赖项生命周期脚本有明确的白名单;新的生命周期脚本依赖项在审查通过前会触发检查失败。

License / 许可证

MIT