pi README

The project's README from github.com/earendil-works/pi. As one markdown file: README.md.

pi logo

Discord npm

New issues and PRs from new contributors are auto-closed by default. Maintainers review auto-closed issues daily. See CONTRIBUTING.md.

Pi Agent Harness

This is the home of the Pi agent harness project including our self extensible coding agent.

To learn more about Pi:

All Packages

Package Description
@earendil-works/chord Standalone application-composition runtime for services, replicated state, RPC, and plugins
@earendil-works/pi-telemetry Vendor-neutral telemetry contracts, reference adapter, conformance tests, and typed schemas
@earendil-works/pi-ai Unified multi-provider LLM API (OpenAI, Anthropic, Google, etc.)
@earendil-works/pi-agent-core Agent runtime with tool calling and state management
@earendil-works/pi-coding-agent Interactive coding agent CLI
@earendil-works/pi-tui Terminal UI library with differential rendering

For Slack/chat automation and workflows see earendil-works/pi-chat.

Permissions & Containerization

Pi does not include a built-in permission system for restricting filesystem, process, network, or credential access. By default, it runs with the permissions of the user and process that launched it.

If you need stronger boundaries, containerize or sandbox Pi. See packages/coding-agent/docs/containerization.md for three patterns:

Contributing

See CONTRIBUTING.md for contribution guidelines and AGENTS.md for project-specific rules (for both humans and agents). Longer term plans for Pi can also be found in RFCs.

Development

npm install --ignore-scripts  # Install all dependencies without running lifecycle scripts
npm run build         # Refresh model data, then build all packages
npm run build:offline # Rebuild using existing model data without network access
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)

Building standalone binaries from release source

GitHub releases include a versioned source archive covered by the release's SHA256SUMS file. Extract it and run the same build script used for the official standalone binaries:

VERSION="<release-version>"
tar -xzf "pi-${VERSION}-source.tar.gz"
cd "pi-${VERSION}"
./scripts/build-binaries.sh --offline-model-data --platform linux-x64 --out "$PWD/out"

The archive includes release model data and native prebuilds. --offline-model-data uses that model data without refreshing provider catalogs. The script installs dependencies and builds the executable with its runtime assets; pass --skip-install if dependencies are already provided.

Supply-chain hardening

We treat npm dependency changes as reviewed code changes.

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.

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:

License

MIT

pi.dev domain graciously donated by

Exy mascot
exe.dev

pi (earendil-works/pi)

Searching Database…

116.2K ·GitHub
这是什么?Pi 是一个智能体框架(agent harness),即一套用于构建和运行 AI 智能体的软件包工具集,包括一个可自我扩展的交互式编程智能体命令行工具、统一支持多家模型提供商的大语言模型 API、智能体运行时,以及终端用户界面库。
这是一个命令行工具,还是一组软件包?这是一个单体仓库(monorepo),里面包含多个独立的 npm 软件包:pi-coding-agent(命令行工具)、pi-agent-core(带工具调用和状态管理的智能体运行时)、pi-ai(统一的大语言模型 API)、pi-tui(终端用户界面库),另外还有用于应用组合的 chord 和用于遥测的 pi-telemetry。
我该怎么让编程智能体命令行工具运行起来?你可以安装 npm 上的 pi-coding-agent 软件包,也可以从 GitHub 发布版本下载源码压缩包(并用其中的 SHA256SUMS 文件校验),然后运行其中自带的构建脚本。如果依赖已经安装好,可以加上 --skip-install 参数跳过安装依赖。
它支持哪些大语言模型提供商?我需要 API 密钥吗?pi-ai 通过统一的 API 对接 OpenAI、Anthropic、Google 等多家提供商,因此你使用哪家提供商,就需要对应的 API 密钥。运行 Pi 还需要 Node.js 22.19 或更高版本。
Pi 会限制智能体能访问我电脑上的哪些内容吗?不会。Pi 没有内置的权限系统:默认情况下,Pi 会以启动它的用户和进程的全部权限运行,可以随意访问文件系统、进程、网络和凭据。如果想获得更强的隔离,需要自行用容器或沙箱来运行它,例如通过 Gondolin 扩展、普通 Docker 或 OpenShell。
chord 是什么?chord 是同一个单体仓库中附带的一个独立应用组合运行时,负责处理服务、复制状态、RPC 和插件。
我能在沙箱中运行 Pi 来保障安全吗?可以。文档介绍了三种方式:Gondolin 扩展(将工具转发到本地 Linux 微型虚拟机中运行,同时把身份认证保留在宿主机上)、在普通 Docker 中运行整个进程,或在 OpenShell 的策略受控沙箱中运行。
有没有 Slack 或聊天工具的集成?Slack 等聊天自动化和工作流由独立的 earendil-works/pi-chat 项目负责,不在本仓库中。
我能与他人分享我的编程智能体会话吗?可以。配套工具 pi-share-hf 可以把你的 Pi 会话日志发布到 Hugging Face,用真实的任务数据帮助改进编程智能体。
Size
83.2 MB
Stars
116.2K
Age
1y
Commits · 90 Days