pi

There are many coding agents, but this one is yours.

Earendil Inc.

pi.dev
Pi is a minimal, extensible AI coding agent harness by Earendil Inc. that lets developers fully customize their workflow via TypeScript extensions, skills, and prompt templates. It supports 15+ model providers, tree-structured session history, and four operation modes, adapting to your workflow rather than the other way around.

What Is Pi?

Pi is an open-source AI coding agent harness built by Earendil Inc. Unlike most agents that ship with an opinionated, sealed feature set, Pi takes a deliberately minimal approach: it provides powerful primitives and leaves the rest to you. Install it via npm, curl, or PowerShell, point it at your preferred model, and start extending it to fit exactly how you work.

Extensibility at the Core

Pi's defining characteristic is its extension system. Extensions are TypeScript modules with access to Pi's tools, commands, keyboard shortcuts, events, and full TUI. Features that other agents bake in — sub-agents, plan mode, permission gates, MCP integration, sandboxing, custom editors — can all be built as extensions or installed from the growing third-party package ecosystem via npm or git. If you need a capability, you can ask Pi to build it for you on the fly, hit /reload, and keep going.

Context Engineering

Pi's minimal system prompt is a feature, not a limitation. It gives you genuine control over what goes into the context window. Project-level AGENTS.md files load startup instructions from your home directory, parent directories, and current working directory. SYSTEM.md lets you replace or append to the default system prompt per project. Skills load capability packages on demand for progressive disclosure without busting the prompt cache. Extensions can inject messages before each turn, filter history, implement RAG, or build long-term memory.

Session History and Collaboration

Pi stores sessions as trees rather than flat logs. Use /tree to navigate to any previous message, branch from that point, and continue in a new direction — all branches live in a single file. You can filter by message type, bookmark entries, export sessions to HTML with /export, or upload to a GitHub Gist with /share to get a shareable URL that renders the full tree.

Model and Provider Support

Pi supports 15+ providers including Anthropic, OpenAI, Google, Azure, Bedrock, Mistral, Groq, Cerebras, xAI, Hugging Face, Kimi For Coding, MiniMax, NVIDIA, OpenRouter, and Ollama, with more available via custom provider extensions. Authenticate via API keys or OAuth. Switch models mid-session with /model or Ctrl+L, and cycle through your favorites with Ctrl+P.

Four Operating Modes

Pi is designed to fit into any workflow through four modes. Interactive mode delivers the full TUI experience. Print/JSON mode (pi -p) makes Pi scriptable and automatable. RPC mode exposes a JSON protocol over stdin/stdout for non-Node integrations. SDK mode lets you embed Pi directly into your own applications — see the OpenClaw integration for a real-world example.

Best for

  • ·Developers who want full control over their AI coding workflow
  • ·Teams building custom agent tooling or internal integrations
  • ·Power users who prefer a minimal core they can extend rather than a feature-bloated product

Key features

  • ·Minimal, extensible agent harness built around TypeScript extensions
  • ·Tree-structured, branchable, shareable session history
  • ·Supports 15+ model providers with mid-session model switching
  • ·Four operation modes: Interactive TUI, Print/JSON, RPC, and SDK
  • ·AGENTS.md and SYSTEM.md for per-project context engineering
  • ·Skills and prompt templates for progressive, cache-friendly context control

Pros

  • Highly extensible: extensions can add sub-agents, plan mode, MCP, custom UI, and more
  • Token-efficient due to a minimal system prompt and smart context engineering primitives
  • Flexible model support across 15+ providers with seamless mid-session switching

Cons

  • Intentionally ships without common features like sub-agents and plan mode out of the box, requiring extensions or manual setup
  • Steeper learning curve for users who prefer an opinionated, batteries-included agent
  • Extension ecosystem is early-stage and relies on community contributions

Comparisons featuring pi

FAQ

Does Pi have plan mode or sub-agents built in?
No, Pi intentionally omits these features from its core. The philosophy is that you should build or install exactly the workflow you want rather than work around someone else's opinion. You can spawn Pi instances via tmux for sub-agent patterns, write plans to files, or install a community package that implements plan mode the way you prefer.
How do I install Pi packages and extensions?
Pi packages bundle extensions, skills, prompts, and themes and can be installed from npm or git using the pi install command. For example: pi install npm:@foo/pi-tools or pi install git:github.com/user/repo. You can also browse the available packages at pi.dev.
Can I use Pi in CI pipelines or scripts?
Yes. Pi's Print/JSON mode (pi -p "query") is designed for scripting and automation. The --mode json flag produces structured event streams. The RPC mode provides a JSON protocol over stdin/stdout suitable for non-Node integrations, and the SDK lets you embed Pi programmatically in any Node application.