Pi, the AI coding agent, compiled ahead of time to native code so it starts faster and uses less CPU than Pi on Bun or Node.
earendil-works/pi
A minimal, extensible AI agent harness with a unified multi-provider LLM API, agent runtime, terminal UI, and a coding agent CLI.
Open-source alternative to:Claude Code
Cursor
- Stars
- 116,313
- Forks
- 14,837
- Open issues
- 348
- Last commit
- yesterday
What is it?
Pi is a TypeScript monorepo for building and running AI agents. Its main product is an interactive coding agent CLI that runs in a project directory, and it can be customized with extensions, skills, prompt templates, and themes, which can be bundled as packages and shared through npm or git.
The repository also contains supporting libraries: a unified LLM API covering providers such as OpenAI, Anthropic, and Google, an agent runtime with tool calling and state management, and a terminal UI library that uses differential rendering. The CLI can be used interactively, in print or JSON mode for automation, over RPC, or through a TypeScript SDK.
Pi ships without built-in sub-agents or plan mode and has no permission system for restricting filesystem or network access, so users who need isolation are pointed to containerization patterns such as Docker or a micro-VM.
Key features
- 01Interactive coding agent CLI that runs in any project directory.
- 02Customization through extensions, skills, prompt templates, and themes.
- 03Unified LLM API across multiple providers including OpenAI, Anthropic, and Google.
- 04Automation via print/JSON mode, RPC control, and a TypeScript SDK.
- 05Terminal UI library with differential rendering.
Use cases
- Running a coding agent on a local repository from the terminal.
- Building a custom agent workflow on top of the TypeScript SDK.
- Automating agent tasks in scripts using print or JSON output.
- Creating a shared extension package for a team's own agent workflows.
Quick start
- 1
Install the CLI with the pi.dev installer
Install with the official instructions in the README - 2
Start Pi in your project directory
cd /path/to/project pi - 3
Inside Pi, run /login to connect a provider, then give it a task
Things to know
- Requires Node.js 22.19 or newer if installed via npm.
- Pi has no built-in permission system, so it runs with the full permissions of the launching user unless sandboxed.
- Built-in AI providers require a subscription or API key.
Topics
FAQ
- What is pi?
- A minimal, extensible AI agent harness with a unified multi-provider LLM API, agent runtime, terminal UI, and a coding agent CLI. Pi is a TypeScript monorepo for building and running AI agents. Its main product is an interactive coding agent CLI that runs in a project directory, and it can be customized with extensions, skills, prompt templates, and themes, which can be bundled as packages and shared through npm or git.
- Is pi free to use? What license does it have?
- pi is open source under the MIT license. Check the license terms before using it in commercial products.
- Is pi still maintained?
- Actively maintained. The last commit to pi was on Oct 19, 2026.
- What can I use pi for?
- Running a coding agent on a local repository from the terminal. Building a custom agent workflow on top of the TypeScript SDK. Automating agent tasks in scripts using print or JSON output. Creating a shared extension package for a team's own agent workflows.
- How do I install pi?
- Install the CLI with the pi.dev installer Start Pi in your project directory: cd /path/to/project pi Inside Pi, run /login to connect a provider, then give it a task
- Where can I get pi?
- The source code and installation instructions are on GitHub: https://github.com/earendil-works/pi
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
An open source AI coding agent that runs in your terminal, with a desktop app and two built-in agents for building and planning changes.
An agentic coding tool from Anthropic that runs in your terminal, reads your codebase, and handles coding tasks and git workflows via natural language.
Open source autonomous coding agent that runs as an IDE extension, terminal CLI, desktop app, or SDK.
A terminal coding agent with built-in LSP, debugger, browser and subagent tools, supporting 60+ model providers.
An open-source coding agent that reads your project, edits files and runs tests from your terminal, desktop, browser or editor.