Pi Coding Agent

title
Pi Coding Agent
type
toolbox
summary
Minimal terminal coding agent with no built-in MCP or sub-agents, extended via TypeScript modules
tags
typescript, cli, ai, coding-agent
language
TypeScript
license
MIT
created
2026-04-06
updated
2026-07-29

A minimal terminal coding agent by Mario Zechner. Pi strips away the feature bloat common in AI coding tools โ€” no built-in MCP, no sub-agents, no permission popups, no plan mode, no to-dos. Instead, it gives you a small, fast core and expects you to extend it yourself via TypeScript modules and npm packages.

The extend-it-yourself philosophy produced a real community ecosystem, and two "batteries-included Pi" distributions now sit on top of it: oh-my-pi, a maximalist fork that bakes tools into the binary, and LazyPi, a one-command installer that configures unmodified Pi with 60+ community skills, 67 themes, MCP adapter, sub-agents, and persistent memory. The two are the fork-vs-installer answers to the same "vanilla Pi ships empty" gap.

Install: npm install -g @mariozechner/pi-coding-agent

Providers: supports 15+ โ€” Anthropic, OpenAI, Google, Azure, Bedrock, Mistral, Groq, Cerebras, xAI, Hugging Face, Kimi, MiniMax, OpenRouter, Ollama, and others.

Four modes of operation:

  • Interactive TUI for normal use
  • Print/JSON mode for scripting
  • RPC (JSON over stdin/stdout) for tool integration
  • SDK for embedding in other applications

Session management uses a tree structure โ€” you can branch conversation history, share sessions, and navigate back to earlier points. Auto-compaction and dynamic context injection handle long sessions.

Extensibility is the main selling point. Skills, prompt templates, themes, and tools are all TypeScript modules you can bundle and distribute via npm or git. The philosophy is that features like MCP support or sub-agents should be community packages, not baked into the core.

Pi is also the worked example in prompt-caching-in-agents, which goes through its cache behaviour in detail โ€” how the session tree and /fork interact with prefix reuse, why an extension that reshapes the tool list re-prefills everything behind it, and why Pi refuses to prune old tool results when the one-time rewrite can cost more than the pruning saves.

Repo: https://github.com/badlogic/pi-mono/tree/main/packages/coding-agent โ€” TypeScript, MIT license.