Overview
The@mariozechner/pi-coding-agent package is the flagship Pi package - a complete terminal-based coding agent with interactive TUI, session management, extension system, and built-in tools for reading, writing, editing, and executing code.
Interactive Mode
Full TUI with editor, autocomplete, and streaming responses
Session Management
Tree-based branching, resume, and auto-save functionality
Extension System
TypeScript-based plugins for tools, commands, and UI
Multiple Modes
Interactive, print, JSON, RPC, and SDK modes
Installation
Quick Start
CLI Usage
SDK Usage
Key Features
Built-in Tools
The coding agent ships with powerful file and system tools:- read - Read file contents with offset/limit support
- write - Create or overwrite files
- edit - String replacement editing with exact matching
- bash - Execute shell commands with timeout and workdir support
- grep - Search file contents using regex patterns
- find - Search for files by glob pattern
- ls - List directory contents
--tools flag:
Session Management
Sessions are stored as JSONL files with tree structure for branching:/tree command to navigate session history, branch to different points, and create forks.
Compaction: Automatic context management when approaching token limits. Customize via settings or extensions.
Extension System
Extend pi with TypeScript modules that can:- Add custom tools
- Register slash commands
- Add keyboard shortcuts
- Hook into events (tool calls, messages, session lifecycle)
- Modify UI (overlays, widgets, custom editors)
- Override built-in behavior
Skills and Prompt Templates
Skills are on-demand capability packages following the Agent Skills standard:Multiple Modes
| Mode | Usage | Description |
|---|---|---|
| Interactive | pi | Full TUI with editor and streaming |
pi -p "message" | Single message, print response | |
| JSON | pi --mode json | Event stream as JSON lines |
| RPC | pi --mode rpc | JSON-RPC over stdin/stdout |
| SDK | import { createAgentSession } | Programmatic API |
Configuration
Settings Files
~/.pi/agent/settings.json- Global settings.pi/settings.json- Project-specific settings
Context Files
Pi automatically loadsAGENTS.md or CLAUDE.md files from:
~/.pi/agent/AGENTS.md(global)- Parent directories (walking up from cwd)
- Current directory