PiPi
Quickstart
Using Pi
  • 简体中文
  • English
Quickstart
Using Pi
  • 简体中文
  • English
  • Start here

    • Quickstart
    • Using Pi
    • Providers
    • Security
    • Containerization
    • Settings
    • Keybindings
    • Sessions
    • Compaction & Branch Summarization
  • Customization

    • Extensions
    • Skills
    • Prompt Templates
    • Themes
    • Pi Packages
    • Custom Models
    • Custom Providers
  • Reference

    • Session File Format
  • Programmatic Usage

    • SDK
    • RPC Mode
    • JSON Event Stream Mode
    • TUI Components
  • Platform Setup

    • Windows Setup
    • Termux (Android) Setup
    • tmux Setup
    • Terminal Setup
    • Shell Aliases
  • Development

    • Development

Development

See AGENTS.md for additional guidelines.

Setup

git clone https://github.com/earendil-works/pi-mono
cd pi-mono
npm install
npm run build

Run from source:

/path/to/pi-mono/pi-test.sh

The script can be run from any directory. Pi keeps the caller's current working directory.

Forking / Rebranding

Configure via package.json:

{
  "piConfig": {
    "name": "pi",
    "configDir": ".pi"
  }
}

Change name, configDir, and bin field for your fork. Affects CLI banner, config paths, and environment variable names.

Path Resolution

Three execution modes: npm install, standalone binary, tsx from source.

Always use src/config.ts for package assets:

import { getPackageDir, getThemeDir } from './config.js'

Never use __dirname directly for package assets.

Debug Command

/debug (hidden) writes to ~/.pi/agent/pi-debug.log:

  • Rendered TUI lines with ANSI codes
  • Last messages sent to the LLM

Testing

./test.sh                         # Run non-LLM tests (no API keys needed)
npm test                          # Run all tests
npm test -- test/specific.test.ts # Run specific test

Project Structure

packages/
  ai/           # LLM provider abstraction
  agent/        # Agent loop and message types
  tui/          # Terminal UI components
  coding-agent/ # CLI and interactive mode
Last Updated:: 7/6/26, 9:32 AM
Contributors: seepine