Minimal terminal coding harness that adapts to your workflows: four core tools, ~1k-token system prompt, TypeScript extensions, skills, session trees, 15+ providers, and four modes (TUI, print, RPC, SDK).

Share:

Pi is a minimal terminal coding harness from Earendil Inc. (creator Mario Zechner, the author behind libGDX). It ships with just four core tools — read, write, edit, and bash — and a system prompt around 1,000 tokens, then lets you extend everything else with TypeScript extensions, skills, prompt templates, and themes. With 85k+ GitHub stars, MIT-licensed, and 15+ model providers, Pi is built to adapt to your workflows instead of the other way around.

Key Features

  • Truly minimal core: Four tools (read, write, edit, bash) and a ~1,000-token system prompt keep context lean; other harnesses burn 5,000-15,000 tokens before you type anything.
  • Self-modifying: Pi reads its own docs and examples, so you can ask it to build a new command, tool, or workflow — then hot-reload with /reload without exiting.
  • Four modes: Interactive TUI, print mode (pi -p "query") for scripts/CI, JSON event stream mode, RPC mode for non-Node integrations, and an SDK to embed Pi in your apps.
  • Session trees: Every conversation is stored as a tree in one JSONL file — branch at any point with /tree, navigate, bookmark, export to HTML, or share via gist.
  • 15+ providers: Anthropic, OpenAI, Google, Azure, Bedrock, Mistral, Groq, Cerebras, xAI, Hugging Face, Kimi, MiniMax, NVIDIA, OpenRouter, Ollama, and more; switch models mid-session with /model or Ctrl+L.
  • Context engineering: AGENTS.md and SYSTEM.md loading, customizable compaction, on-demand skills, prompt templates, and dynamic context via extensions.
  • Packages: Bundle extensions, skills, prompts, and themes as Pi packages, installable from npm or git (pi install).

Use Cases

Who Should Use This Tool?

  • Minimalists: Developers who want a lean harness without opinionated built-ins like plan mode, to-dos, or permission popups.
  • Power users: People who want to build their own sub-agents, permission gates, sandboxing, or MCP support as extensions.
  • Scripting & CI: Teams that run agents non-interactively via print mode or RPC in pipelines.

Problems It Solves

  1. Context bloat: A tiny core prompt plus on-demand skills keep the context window clean, cutting token waste.
  2. Locked-in workflows: No sealed product — if you need a feature, ask Pi to build it or install a package.
  3. Lost conversation history: Session trees let you branch experiments and return to any earlier point in a single file.

Pricing

Plan Price Features
Open Source $0 Full harness, extensions, skills, packages. MIT License.

Pi is free and open source (MIT). Install via curl -fsSL https://pi.dev/install.sh | sh, npm install -g @earendil-works/pi-coding-agent, or Homebrew/pnpm/bun. Model usage is billed by your providers.

Advantages & Unique Selling Points

Compared to Competitors:

  1. Minimalism by design: No MCP, sub-agents, plan mode, to-dos, or permission popups by default — features that other agents bake in, you build or install.
  2. Self-extending: Pi can read its own docs and examples and customize itself on the fly, then reload without restarting.
  3. Provider freedom: 15+ providers and mid-session model switching, unlike harnesses tied to a single vendor.

What Makes It Stand Out:

  • 85k+ GitHub stars, MIT-licensed, built in the open by Earendil Inc.
  • Session trees with branching and sharing in one JSONL file.
  • Four operating modes including RPC and SDK for programmatic use.

User Reviews

"Pi's system prompt and tool definitions come in at around 1,000 tokens. Other solutions burn 5,000 to 15,000 tokens before you've typed anything." — Teleport, YouTube review

"Not having built-in to-dos straight up is such an advantage because those built-in to-dos are a massive foot gun. The agent will use them just because it can and they encourage short-sightedness." — Dracon Dev & AI, YouTube review

Getting Started

Quick Start Guide

  1. Install: curl -fsSL https://pi.dev/install.sh | sh or npm install -g --ignore-scripts @earendil-works/pi-coding-agent.
  2. Authenticate: Run /login to pick a provider, or set an API key like ANTHROPIC_API_KEY.
  3. Start: Run pi in a project directory to launch the interactive TUI.
  4. Extend: Ask Pi to build the command, tool, or workflow you need, then /reload.

Integration

  • Providers: Anthropic, OpenAI, Google, Azure, Bedrock, Mistral, Groq, Cerebras, xAI, Hugging Face, Kimi, MiniMax, NVIDIA, OpenRouter, Ollama.
  • Programmatic: RPC over stdin/stdout, JSON event streams, Node.js SDK.
  • Real-world: OpenClaw uses Pi as its underlying coding agent.
  • Platforms: macOS, Linux, Windows, and Termux on Android.

Frequently Asked Questions

Why doesn't Pi have MCP or sub-agents by default?

Pi deliberately skips features like MCP, sub-agents, plan mode, and permission popups to keep the core minimal. You can build any of them as a TypeScript extension or install a Pi package that provides them.

Can I switch models mid-session?

Yes. Use /model or Ctrl+L to switch models anytime, and Ctrl+P to cycle through favorites.

Is my session history preserved?

Yes. Sessions are stored as trees in JSONL files — you can branch, navigate back, export to HTML, or share via gist.

Alternatives

If Pi isn't the right fit, consider these alternatives:

  • OpenCode: Open-source terminal AI coding agent with multi-provider support.
  • Aider: AI pair programming in the terminal, focused on git-based workflows.
  • Claude Code: Anthropic's feature-rich coding agent with MCP and sub-agents built in.

Tips & Best Practices

  1. Keep context light: Load skills on demand instead of piling everything into the system prompt.
  2. Use session trees for experiments: Branch risky explorations with /tree and return to a known-good point in the same file.
  3. Ask Pi to build what you need: Before installing third-party tools, ask Pi to read its docs and build the extension itself.

Conclusion

Pi is the harness for people who want their tools to fit their workflow, not the other way around. A minimal core, self-modifying extensions, session trees, and provider freedom make it one of the most flexible coding agents available — and at 85k+ stars, one of the most loved open-source ones.

Comments

No comments yet. Be the first to comment!