本文为社区中文翻译(依据 MIT 协议),阅读英文原文 →。译文可能滞后于上游更新。

Pi 文档总览

快速开始

用 npm 安装 Pi:

npm install -g --ignore-scripts @earendil-works/pi-coding-agent

--ignore-scripts 会在安装期间禁用依赖的生命周期脚本。Pi 在正常的 npm 安装中不需要安装脚本。

在 Linux 或 macOS 上也可以使用安装脚本:

curl -fsSL https://pi.dev/install.sh | sh

如果通过 curl 或 npm 安装,用 npm 卸载:

npm uninstall -g @earendil-works/pi-coding-agent

pnpm、Yarn 或 Bun 安装的,用对应的卸载命令:pnpm remove -g @earendil-works/pi-coding-agentyarn global remove @earendil-works/pi-coding-agentbun uninstall -g @earendil-works/pi-coding-agent

然后在项目目录里运行:

pi

/login 登录订阅类提供商,或在启动 Pi 之前设置好 ANTHROPIC_API_KEY 之类的 API Key。

完整的首次运行流程见快速上手

从这里开始

定制

编程接入

参考

平台设置

开发