Pi Tutorial
In one sentence: Pi is a minimal, open-source terminal AI coding agent. It doesn't dictate your workflow — everything is defined through TypeScript extensions.
What is Pi?
Pi is developed by Earendil Inc. and open-sourced under MIT. Unlike Claude Code or Cursor, Pi deliberately stays minimal — no built-in sub-agents, Plan Mode, or MCP. You write these features yourself as extensions.
Core philosophy: Your workflow, your rules.
Quick Install
# npm (recommended)
npm install -g --ignore-scripts @earendil-works/pi-coding-agent
# Or one-liner script
curl -fsSL https://pi.dev/install.sh | shConfigure your API key and launch:
export ANTHROPIC_API_KEY=sk-ant-...
piYou can also use /login to authenticate directly with Anthropic, OpenAI, or GitHub Copilot subscriptions.
Highlights
- 15+ model providers: Anthropic, OpenAI, Gemini, DeepSeek, Kimi, MiniMax, and more — switch anytime with
/model. - Tree-based conversation history: Branch and backtrack from any node. All branches are stored in a single JSONL file.
- TypeScript extensions: Extensions access Pi's full internals — tools, commands, TUI components, event system. Writing an extension feels like writing an npm package.
- Four run modes: Interactive TUI,
-pscript mode, RPC protocol, SDK embedding. - Pi package ecosystem: Extensions, skills, templates, and themes can be packaged and shared, installed via npm or git.
Pi vs Claude Code
| Pi | Claude Code |
|---|---|
| Minimal core, features via extensions | Feature-rich, works out of the box |
| Fully open source (MIT) | Closed source |
| 15+ model providers | Anthropic only |
| Highly customizable, DIY required | Low barrier, install and go |
Choose Pi: You want full control, model flexibility, and an open-source solution. Choose Claude Code: You want something that just works without tinkering.
Pi open-source repo: github.com/earendil-works/pi
