Pi

Self-extensible AI coding agent CLI with a terminal UI, tool calling, and session management

Tool
npm
v0.84.2
93,694stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
88/100Excellent
Development Activity100
Maintenance100
Community76
Maturity36
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
79/100Good
Architecture84
Code Quality85
Innovation82
Learning Curve65

Pi is an open-source, self-extensible coding agent you run from the terminal — an interactive CLI that reads, edits, and writes files, executes shell commands, and manages multi-turn sessions, all rendered through a custom differential-rendering TUI. It ships as @earendil-works/pi-coding-agent, the flagship package of a four-package monorepo that also exposes its underlying pieces (pi-agent-core for the agent runtime, pi-ai for a unified multi-provider LLM API, and pi-tui for the terminal UI layer) as independently usable libraries.

Pi deliberately ships without a built-in permission system, running with the same access as the user who launched it; the project instead documents three containerization patterns (a Gondolin micro-VM extension, plain Docker, or OpenShell) for teams that need stronger sandboxing. It has an unusually mature supply-chain-hardening posture for a young project — pinned direct dependencies, npm audit signatures in CI, and a generated shrinkwrap bundled into every published release.

What You Get

  • An interactive terminal coding agent (pi) with file read/edit/write, bash execution, and persistent session management
  • A custom differential-rendering TUI (pi-tui) instead of a generic terminal-output loop
  • A reusable agent runtime (pi-agent-core) handling tool calling and state management independently of the CLI
  • A unified LLM API (pi-ai) abstracting OpenAI, Anthropic, Google, and other providers behind one interface
  • RPC and print modes (src/modes/rpc, src/modes/print-mode.ts) for scripting and non-interactive automation
  • Documented containerization patterns (Gondolin micro-VM, Docker, OpenShell) for sandboxing agent execution
  • Supply-chain hardening: pinned direct dependencies, generated npm shrinkwrap, and CI-enforced npm audit signatures

Common Use Cases

  • Running an interactive AI coding session in a terminal to read, edit, and test code across a real repository
  • Automating coding-agent workflows non-interactively via RPC/print mode from scripts or CI
  • Building a custom coding agent or internal tool on top of the reusable pi-agent-core runtime and pi-ai LLM abstraction
  • Sandboxing untrusted or high-autonomy agent runs inside a micro-VM, Docker container, or OpenShell policy sandbox
  • Switching between LLM providers (OpenAI, Anthropic, Google) for the same coding-agent workflow without rewriting integration code

Under The Hood

Architecture: The coding agent (packages/coding-agent) is the top-level consumer of a layered monorepo: main.ts dispatches to one of three modes — modes/interactive (the full TUI), modes/print-mode.ts (single-shot output), and modes/rpc (structured automation) — all driven by an AgentSession (core/agent-session.ts, agent-session-runtime.ts, agent-session-services.ts) that wraps the lower-level pi-agent-core tool-calling loop; session state, auth storage, bash execution, and an internal event bus are each isolated into their own core modules (bash-executor.ts, auth-storage.ts, event-bus.ts), and extensions live under core/extensions for user-defined tool/behavior additions. Tech Stack: TypeScript throughout (~93% of the codebase, 54,600+ lines in the coding-agent package alone), built with tsgo, optionally compiled to a standalone binary via Bun (build:binary), with undici dispatcher configuration for HTTP, @silvia-odwyer/photon-node for image resizing, and a custom TUI renderer (pi-tui) rather than an off-the-shelf terminal-UI library. Code Quality: The coding-agent package alone has 176+ .test.ts files run via Vitest, and the monorepo’s npm run check chains lint, format, and type-checking; the README documents an explicit, unusually detailed supply-chain-hardening policy — exact-pinned direct dependencies, min-release-age=2 in .npmrc, pre-commit lockfile-change blocking, and a generated shrinkwrap bundled into the published CLI package — treating dependency bumps as reviewed code changes. API Design: The CLI surfaces three distinct entry modes (interactive TUI, single-shot print, scriptable RPC) behind one binary, letting the same agent be driven by a human in a terminal or by another program over structured RPC without a separate integration, while the underlying pi-agent-core/pi-ai packages are published separately so the agent runtime and LLM abstraction can be reused outside the CLI entirely.

Used by 5 apps in this directory

TypeScript
59%
Other

agenta

Developer Tools · Devops · AI Development

4,489

The open-source LLMOps platform unifying prompt engineering, evaluation, and observability for teams building reliable LLM applications.

View details
91
Repo Health
77
Technical
67
Dependency
Built with
TypeScript59%
Python39%
Updated today
TypeScript
99%
MIT

Cate

AI Code Assistants

2,087

A desktop IDE built on an infinite canvas — spread code editors, terminals, browsers, docs, and AI agents across freeform space instead of stacking windows and tabs, with layouts restored automatically.

View details
79
Repo Health
71
Technical
72
Dependency
Built with
TypeScript99%
Updated today
Rust
91%
Apache 2.0

herdr

AI Agents · Developer Tools

30,468

A terminal-native agent multiplexer that runs Claude, Codex, Gemini, and other coding agents side by side in real, persistent panes you can detach from and reattach to from anywhere.

View details
83
Repo Health
84
Technical
76
Dependency
Built with
Rust91%
Updated today
TypeScript
91%
Apache 2.0

NemoClaw

AI Agents · AI Development

22,197

Run AI coding agents like OpenClaw and Hermes securely inside NVIDIA OpenShell sandboxes with a hardened blueprint, routed inference, and lifecycle management through a single CLI.

View details
73
Repo Health
87
Technical
70
Dependency
Built with
TypeScript91%
Updated today
TypeScript
94%
MIT

Pi

AI Agents

93,473

An open-source, self-extensible agent harness and coding agent CLI — a modular runtime (agent core, unified multi-provider LLM API, TUI) with no built-in permission system by default, documented containerization patterns for sandboxing instead.

View details
88
Repo Health
73
Technical
76
Dependency
Built with
TypeScript94%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search