Pi
Pi is a minimal terminal coding agent from Mario Zechner. The live product is at pi.dev; source lives in the MIT-licensed badlogic/pi-mono monorepo (about 99k GitHub stars as of 2026-08-30). Install the CLI with npm install -g @mariozechner/pi-coding-agent, then point it at the model provider you already pay for.
If you want a heavier official harness, compare Claude Code, Gemini CLI, and OpenCode.
Key Features
- Tiny default tool surface: A short system prompt plus
read,write,edit, andbash. Extra capabilities come from extensions, skills, prompt templates, and themes. - Extensible packages: Bundle custom tools and share them via npm or git (
pi install .). Ask Pi to build missing pieces, then/reload. - Many providers: Anthropic, OpenAI, Google, Azure, Bedrock, OpenRouter, Ollama, and more. Switch mid-session with
/modelorCtrl+L. - Four run modes: Interactive TUI, print/JSON for scripts, RPC over stdin/stdout, and an embeddable SDK.
- Tree-shaped sessions: Navigate prior points with
/tree, export HTML, or/sharea gist. Compaction andAGENTS.md/SYSTEM.mdhelp with context engineering.
Use Cases
Who should use this tool?
- Developers who find Claude Code too heavy and want a thinner interactive loop in the terminal.
- Teams scripting agents with
pi -por JSON mode in CI. - Extension authors who want to grow the harness instead of forking a sealed product.
Problems it solves
- Opinionated bloat: Skip built-in sub-agents, plan mode, MCP, and permission popups unless you add them yourself.
- Provider lock-in: Keep one CLI while swapping models and auth (API keys or OAuth).
- Opaque sessions: Inspect and branch history instead of losing context in a flat chat log.
Limitation: There is no hosted product seat. You run the CLI locally and pay the model provider. Security (containers, confirmations) is your responsibility unless you build it with extensions.
Pricing
| Plan | Price | Notes |
|---|---|---|
| Open source | $0 | MIT CLI. Model tokens are billed by Anthropic, OpenAI, or whatever /model points at. |
Getting Started
- Read pi.dev or the pi-mono README.
- Install:
npm install -g @mariozechner/pi-coding-agent(npm latest was 0.73.1 when checked on 2026-08-30). - In a repo, run
pi, authenticate a provider, and start with a small coding task. - Add project instructions in
AGENTS.mdbefore granting broad bash rights.
Practical workflow
Pick a small bug, let Pi edit and run tests in interactive mode, then /export the session if you want a reviewable artifact. For automation, use print mode with a pinned model.
Frequently Asked Questions
Is Pi free?
The CLI and source are free under MIT. You still pay your LLM provider for tokens.
Does it include MCP or sub-agents by default?
No. The project intentionally omits them; you can add similar behavior with extensions, skills, or packages.
Which package should I install?
Use @mariozechner/pi-coding-agent from the badlogic/pi-mono README. Older third-party package names in blogs may be stale.
How does it compare to Claude Code?
Claude Code is Anthropic's fuller product surface (CLI, IDE, desktop, cloud). Pi stays minimal and provider-agnostic; you extend it when you need more.
Alternatives
- Claude Code: Heavier official Anthropic coding agent.
- Gemini CLI: Google's open terminal agent.
- OpenCode: Another open coding CLI.
Tips
- Start with the four default tools; add packages only when a workflow repeats.
- Prefer containers or tight bash allowlists before letting the agent run unconstrained.
- Use
/modelto keep expensive models for hard steps and cheaper ones for exploration.
Conclusion
Pi fits developers who want a free, extensible terminal harness and are fine bringing their own model keys. Start at pi.dev, install the current npm package, then decide whether Claude Code is worth the extra product weight.
Comments
No comments yet. Be the first to comment!
Related Tools
Related Insights
Skills + Hooks + Plugins: How Anthropic Redefined AI Coding Tool Extensibility
An in-depth analysis of Claude Code's trinity architecture of Skills, Hooks, and Plugins. Explore why this design is more advanced than GitHub Copilot and Cursor, and how it redefines AI coding tool extensibility through open standards.
What Locks Codex Is the Picker, Not the Models
You already pay for OpenCode Go, Grok, and Z.ai, but the Codex picker still shows mostly GPT. The community project codex-router does not teach another install ritual. It puts subscriptions you already bought back into the selector, keeps keys on the machine, and leaves native GPT alone.
Codex on any model: magpie makes Codex Router unnecessary
magpie is a free, open-source menu bar app that runs a local gateway and puts OpenRouter, DeepSeek and your ChatGPT, Claude, Cursor, Grok and Copilot subscriptions right into Codex's own model picker, with one click and no Codex Router.