Pi

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

Tool
npm
v0.87.1
109,788 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
88 /100 Excellent
Development Activity 100
Maintenance 100
Community 76
Maturity 36
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
79 /100 Good
Architecture 84
Code Quality 85
Innovation 82
Learning Curve 65

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 33 apps in this directory

TypeScript
95%
MIT

qm

AI Agents · AI Assistants · Automation

15,266

An open-source, multiplayer agent harness that gives every employee and every room in a company its own scoped memory, sandbox, and AI agent — in Slack and on the web.

View details
80
Repo Health
88
Technical
84
Dependency
Built with
TypeScript 95%
Updated 6 days ago
TypeScript
95%
MIT

qm

AI Agents · AI Assistants · Automation

15,266

An open-source, multiplayer agent harness that gives every employee and every room in a company its own scoped memory, sandbox, and AI agent — in Slack and on the web.

View details
80
Repo Health
88
Technical
84
Dependency
Built with
TypeScript 95%
Updated 6 days ago
TypeScript
96%
Apache 2.0

rakazo

AI Agents · AI Assistants

3,009

An open-source platform for persistent AI teammates that own their own conversations, memory, routines, and computers — self-hosted, model-agnostic, and available on web, desktop, and mobile.

View details
80
Repo Health
91
Technical
83
Dependency
Built with
TypeScript 96%
Updated 5 days ago
TypeScript
96%
Apache 2.0

rakazo

AI Agents · AI Assistants

3,009

An open-source platform for persistent AI teammates that own their own conversations, memory, routines, and computers — self-hosted, model-agnostic, and available on web, desktop, and mobile.

View details
80
Repo Health
91
Technical
83
Dependency
Built with
TypeScript 96%
Updated 5 days ago
TypeScript
72%
Apache 2.0

Valmis

AI Agents

108

A security-focused, self-hostable AI agent platform for production work — agents run in isolated containers that access credentials only through a host-side proxy, so the AI itself never sees API keys or plaintext credentials.

View details
70
Repo Health
69
Technical
74
Dependency
Built with
TypeScript 72%
Svelte 27%
Updated 1 months ago
TypeScript
72%
Apache 2.0

Valmis

AI Agents

108

A security-focused, self-hostable AI agent platform for production work — agents run in isolated containers that access credentials only through a host-side proxy, so the AI itself never sees API keys or plaintext credentials.

View details
70
Repo Health
69
Technical
74
Dependency
Built with
TypeScript 72%
Svelte 27%
Updated 1 months ago

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