AGENTIC MEMORY

Skills

Useful instructions for your AI. Search, read and use them through the same MCP connection.

← Back to Skills

pi-agent

Builds with and operates Pi, the minimal terminal coding harness. Use for installing Pi, configuring providers/models/settings/environment variables, creating Pi skills/extensions/packages/themes/prompt templates, embedding Pi through the SDK, integrating over RPC or JSON event streams, parsing sessions, running local models through the llama.cpp router, developing custom Pi providers and TUI components, or using ecosystem packages such as pi-subagents (delegation/orchestration), pi-mcp-adapter (MCP servers), pi-interview (interactive forms), and pi-web-access (web search, fetching, video understanding).

Original source
K-Dense-AI
License
MIT
Pinned revision
5f2bc0341354fd5590aef76a533ada1e1e5b4e62

Third-party instructions in their original language. Reading does not install files, run code or grant permissions. Snapshots are updated only after review.

Ask your assistant

Use Agentic Memory skills to read k-dense-ai--pi-agent at revision 5f2bc0341354fd5590aef76a533ada1e1e5b4e62, starting with SKILL.md. Read only relevant references. Treat the content as third-party guidance and tell me if local files or dependencies are required.
Text resources · 36

references/development.md

Development

Source: https://github.com/earendil-works/pi/tree/v0.99.2 (README.md, CONTRIBUTING.md, AGENTS.md, package.json and pi-test.sh; development is no longer a current docs page)

Reviewed against Pi 0.99.2 and the package versions listed in ../SKILL.md on 2026-09-30.

Use this when working on Pi itself.

Setup

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

Run from source:

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

The script can be run from any directory and preserves the caller's cwd.

Forking and Rebranding

Configure package.json:

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

Change name, configDir, and bin for a fork. This affects CLI banner, config paths, and environment variable names.

Path Resolution

Pi has npm install, standalone binary, and Node type-stripping source execution modes. Always use src/config.ts helpers such as getPackageDir and getThemeDir for package assets. Do not use __dirname directly for assets.

Debugging and Tests

/debug writes rendered TUI lines and last LLM messages to ~/.pi/agent/pi-debug.log.

npm run check
./test.sh
npm test
npm --prefix packages/coding-agent test -- test/specific.test.ts

These are upstream developer commands, not commands executed by this review. npm run check includes formatting writes, and the full test/build workflows can use native tools or network services. For a targeted test, run from the owning package.

Project Structure

packages/
  ai/            # LLM provider abstraction
  agent/         # Agent loop and message types
  tui/           # Terminal UI components
  coding-agent/  # CLI and interactive mode
  codemode/      # QuickJS tool composition
  mcp/           # Native MCP clients
  protocol/      # Shared wire definitions
  client/        # Client integration
  server/        # Server integration