Skip to main content

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

Or use locally in a project:

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 can be configured via --tools flag:

Session Management

Sessions are stored as JSONL files with tree structure for branching:
Tree navigation: Use /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
See Extensions Guide for detailed documentation.

Skills and Prompt Templates

Skills are on-demand capability packages following the Agent Skills standard:
Prompt Templates are reusable prompts with variable substitution:

Multiple Modes

Configuration

Settings Files

  • ~/.pi/agent/settings.json - Global settings
  • .pi/settings.json - Project-specific settings
See Customization Guide for all options.

Context Files

Pi automatically loads AGENTS.md or CLAUDE.md files from:
  • ~/.pi/agent/AGENTS.md (global)
  • Parent directories (walking up from cwd)
  • Current directory
Use for project conventions, common patterns, and instructions.

API Reference

For programmatic usage, see:

Examples

Custom Tool with Extension

Session Branching

Package Structure