# Pi Developer Reference Wiki > pi is a TypeScript monorepo for a provider-neutral coding-agent harness, spanning model APIs, an agent runtime, a CLI, and a terminal UI library. Repository code is the source of truth; no STRATEGY.md or docs/solutions sources were present, and the requested bundled Compound Engineering page-shape guidance is treated as portable workflow guidance. This is a Grok-Wiki source-grounded repository wiki. Use the complete Markdown link when an agent needs the full repo context. ## Context Links - [Complete Markdown wiki](https://grok-wiki.com/public/wiki/earendil-works-pi-121d322b171c/llms-full.txt) - [Complete Markdown alias](https://grok-wiki.com/public/wiki/earendil-works-pi-121d322b171c.md) - [Human interactive wiki](https://grok-wiki.com/public/wiki/earendil-works-pi-121d322b171c) - [GitHub repository](https://github.com/earendil-works/pi) ## Repository - Repository: earendil-works/pi - Generated: 2026-05-25T04:52:33.091Z - Updated: 2026-05-25T05:00:27.990Z - Runtime: Pi · Codex · gpt-5.5 - Format: Technical - Pages: 6 ## Pages - [Technical Orientation](https://grok-wiki.com/public/wiki/earendil-works-pi-121d322b171c/pages/01-technical-orientation.md): What the repo is, how the four packages fit together, the main entry points, and how to navigate the rest of the developer reference. - [Agent Core Runtime](https://grok-wiki.com/public/wiki/earendil-works-pi-121d322b171c/pages/02-agent-core-runtime.md): The reusable agent loop, event stream, tool-call execution model, harness layer, session storage, and compaction responsibilities. - [Model and Provider Abstraction](https://grok-wiki.com/public/wiki/earendil-works-pi-121d322b171c/pages/03-model-and-provider-abstraction.md): The provider-neutral LLM surface: model metadata, stream contracts, lazy provider registration, API-key resolution, OAuth hooks, and custom provider wiring. - [CLI, Session, and Tool Lifecycle](https://grok-wiki.com/public/wiki/earendil-works-pi-121d322b171c/pages/04-cli-session-and-tool-lifecycle.md): How the pi executable parses inputs, creates cwd-bound services, resolves models and settings, persists sessions, dispatches built-in tools, and bridges into the core agent. - [Interactive, Print, RPC, and TUI Surfaces](https://grok-wiki.com/public/wiki/earendil-works-pi-121d322b171c/pages/05-interactive-print-rpc-and-tui-surfaces.md): The runtime adapters above AgentSession: terminal interaction, print and JSON modes, JSONL RPC protocol, keybindings, editor components, overlays, and differential rendering. - [Resources, Extensions, Skills, and Packages](https://grok-wiki.com/public/wiki/earendil-works-pi-121d322b171c/pages/06-resources-extensions-skills-and-packages.md): The portable extension layer for loading repository, file, npm, git, and catalog-like resources without binding the architecture to one model provider or hosted service. ## Source Files - `package.json` - `packages/agent/package.json` - `packages/agent/src/agent-loop.ts` - `packages/agent/src/agent.ts` - `packages/agent/src/harness/agent-harness.ts` - `packages/agent/src/harness/compaction/compaction.ts` - `packages/agent/src/harness/messages.ts` - `packages/agent/src/harness/session/jsonl-repo.ts` - `packages/agent/src/harness/session/session.ts` - `packages/agent/src/harness/types.ts` - `packages/agent/src/index.ts` - `packages/ai/package.json` - `packages/ai/src/api-registry.ts` - `packages/ai/src/env-api-keys.ts` - `packages/ai/src/models.ts` - `packages/ai/src/oauth.ts` - `packages/ai/src/providers/register-builtins.ts` - `packages/ai/src/stream.ts` - `packages/ai/src/types.ts` - `packages/coding-agent/package.json` - `packages/coding-agent/src/cli/args.ts` - `packages/coding-agent/src/core/agent-session-services.ts` - `packages/coding-agent/src/core/agent-session.ts` - `packages/coding-agent/src/core/extensions/loader.ts` - `packages/coding-agent/src/core/extensions/runner.ts` - `packages/coding-agent/src/core/extensions/types.ts` - `packages/coding-agent/src/core/keybindings.ts` - `packages/coding-agent/src/core/model-registry.ts` - `packages/coding-agent/src/core/package-manager.ts` - `packages/coding-agent/src/core/prompt-templates.ts` - `packages/coding-agent/src/core/resource-loader.ts` - `packages/coding-agent/src/core/sdk.ts` - `packages/coding-agent/src/core/session-manager.ts` - `packages/coding-agent/src/core/settings-manager.ts` - `packages/coding-agent/src/core/skills.ts` - `packages/coding-agent/src/core/tools/bash.ts` - `packages/coding-agent/src/core/tools/index.ts` - `packages/coding-agent/src/main.ts` - `packages/coding-agent/src/modes/interactive/interactive-mode.ts` - `packages/coding-agent/src/modes/print-mode.ts` - `packages/coding-agent/src/modes/rpc/rpc-mode.ts` - `packages/coding-agent/src/modes/rpc/rpc-types.ts` - `packages/tui/package.json` - `packages/tui/src/components/editor.ts` - `packages/tui/src/keybindings.ts` - `packages/tui/src/tui.ts` - `README.md`