mcpField
P
pi-agent

pi-agent

github.com/kalarislabsAgent workflows7747 installsUpdated 4d ago
Repository

About pi-agent

A reference skill for operating Pi, a terminal coding harness, and building on it. It maps user goals to documentation and explains when to use its SDK, RPC, JSON mode, extensions, or packages.

Key features

  1. 01Task-based documentation lookup
  2. 02SDK, RPC, and JSON integration guidance
  3. 03Extension and package development guidance
  4. 04MCP server connection reference
  5. 05Security and isolation guidance

Use cases

  1. 01Find Pi instructions for setup or daily CLI use
  2. 02Embed Pi in a Node or TypeScript application
  3. 03Integrate Pi from another process or language
  4. 04Configure Pi to connect to MCP servers

MCP support

The skill points to Pi's MCP adapter documentation for connecting MCP servers and discovering or configuring their tools. It does not itself provide an MCP server or client.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/kalarislabs/research-agent-skills --skill pi-agent

After installing, type/pi-agentin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
compaction.md
containerization.md
custom-provider.md
development.md
environment-variables.md
extensions.md
json.md
keybindings.md
llama-cpp.md
models.md
overview.md
packages.md
pi-interview.md
pi-mcp-adapter.md
pi-subagents.md
pi-web-access.md
prompt-templates.md
providers.md
quickstart.md
rpc.md
sdk.md
security.md
session-format.md
sessions.md
settings.md
shell-aliases.md
skills.md
terminal-setup.md
termux.md
themes.md

Details

From the project README

Pi Agent

Use this skill when the user wants to operate Pi or build on top of Pi. Pi is a minimal terminal coding harness extended through TypeScript extensions, skills, prompt templates, themes, packages, custom models/providers, SDK integrations, RPC mode, JSON event streams, and TUI components.

First Decision

Pick the reference before answering or coding:

User intentRead
What Pi is, docs map, install methodsreferences/overview.md
Install, authenticate, first runreferences/quickstart.md
Day-to-day CLI usage, commands, modes, flags, project trustreferences/usage.md
Provider auth, API keys, cloud provider setupreferences/providers.md
Custom model entries, local models, proxies, compat flagsreferences/models.md
Local llama.cpp router, /llama, model download/loadreferences/llama-cpp.md
Settings keys and defaultsreferences/settings.md
PI_* and other environment variablesreferences/environment-variables.md
Extension development, custom tools, events, commandsreferences/extensions.md
Custom provider implementation, OAuth, custom streamingreferences/custom-provider.md
Embed Pi in Node/TypeScriptreferences/sdk.md
Integrate from another process/languagereferences/rpc.md
Consume JSONL event outputreferences/json.md
Build terminal UI componentsreferences/tui.md
Package extensions/skills/prompts/themesreferences/packages.md
Delegate to subagents, chains, parallel runs, orchestrationreferences/pi-subagents.md
Connect MCP servers, MCP tool discovery/configreferences/pi-mcp-adapter.md
Interactive interview forms, structured user inputreferences/pi-interview.md
Web search, URL/PDF/repo fetching, video understandingreferences/pi-web-access.md
Author Pi skillsreferences/skills.md
Prompt templates or themesreferences/prompt-templates.md, references/themes.md
Sessions, branching, compaction, parsing JSONLreferences/sessions.md, references/compaction.md, references/session-format.md
Security, sandboxing, trustreferences/security.md, references/containerization.md
Keyboard or terminal issuesreferences/keybindings.md, references/terminal-setup.md, references/tmux.md, references/windows.md, references/termux.md, references/shell-aliases.md
Working on Pi itselfreferences/development.md

Build-On-Pi Defaults

Prefer the SDK for Node/TypeScript apps that need type safety, direct state access, in-process custom tools/extensions, or custom resource loading. Use createAgentSession() for a single stable session; use createAgentSessionRuntime() when the app must replace sessions through new/resume/fork/clone/import flows. Auth and model lookup go through ModelRuntime.create().

Prefer RPC mode when the client is not Node.js, needs process isolation, or wants a language-agnostic JSONL protocol. Start with pi --mode rpc --no-session for stateless subprocess integration, then add session flags when persistence matters. Split records on \n only — Node readline is not protocol-compliant.

Prefer JSON mode for one-shot command-line pipelines that only need streamed events, not bidirectional control: pi --mode json "prompt".

Use extensions for Pi-native behavior: custom tools, command handlers, event hooks, provider registration, custom compaction, path protection, project trust policy, UI prompts, widgets, and TUI components.

Use packages when sharing or installing reusable extensions, skills, prompt templates, or themes across machines or projects.

Safety Defaults

Pi is local and not sandboxed by default. Treat extensions, packages, skills, shell commands, and project-local .pi resources as code with the permissions of the Pi process. Project trust only guards which project inputs load — it is not a sandbox. For untrusted repos or unattended automation, isolate with Docker, OpenShell, Gondolin, a VM, or a remote sandbox.

Do not store secrets in project files. Prefer env vars, ~/.pi/agent/auth.json, OAuth via /login, or command-backed secret lookups in models.json/provider config.

Common Commands

npm install -g --ignore-scripts @earendil-works/pi-coding-agent
pi
pi -p "Summarize this codebase"
pi --mode json "List files"
pi --mode rpc --no-session
pi --provider anthropic --model claude-sonnet-4-5
pi --model sonnet:high "Solve this complex problem"
pi --tools read,grep,find,ls -p "Review this repository"
pi --tui-mode fullscreen
pi install npm:pi-subagents
pi update --all

Source Coverage

These references summarize the Pi documentation at https://pi.dev/docs/latest and every docs page found under it, as of Pi 0.84.2 (docs source: packages/coding-agent/docs/ in https://github.com/earendil-works/pi, formerly pi-mono). They also cover the package pages for pi-subagents, pi-mcp-adapter, pi-interview, and pi-web-access at https://pi.dev/packages/, cross-checked against the published npm READMEs and package docs (pi-web-access 0.22.0, pi-mcp-adapter 2.25.0, pi-subagents 0.49.0, pi-interview 0.11.0). When exact API behavior matters, prefer the cited reference page and inspect installed TypeScript definitions under node_modules/@earendil-works/pi-coding-agent/dist/ and node_modules/@earendil-works/pi-ai/dist/.

Agent operating procedure

  1. Check the environment. Confirm the objective, evaluation metric, budget (time, compute, money) and stopping criteria.
  2. Pin down the inputs. Confirm formats, identifiers and parameters from the data or the user. Ask rather than guess any value that changes the result.
  3. Run a small version first. Run one iteration end to end and inspect logs before scaling up.
  4. Execute the full task using the instructions and references above.
  5. Validate the result. Evaluate on held-out data; keep an audit trail of every iteration, hypothesis and result.
  6. Report. State what was run (versions, commands, parameters), what was checked, and what is still uncertain.
If this happensDo this
An iteration produces suspiciously large gainsCheck for leakage or evaluation bugs before accepting the result.
A function, flag or endpoint in these instructions is missing in the installed versionCheck the installed version's own documentation (help(), --help, official docs), adapt, and tell the user. Never invent an API.
A required input, identifier or parameter is ambiguousAsk the user, or state the assumption explicitly before running.

Integrity rules

  • Never fabricate results, parameters, identifiers, citations or statistics. If something cannot be run or verified, say so plainly.
  • Record negative results; never select or report only favourable runs.
  • Treat version-specific details here as possibly outdated: confirm them against the official documentation for the installed version.
  • Ask before actions that cost money, consume shared GPUs or cloud quota, touch personal or patient data, or cannot be undone.

Related skills

  • qiskit: Build, simulate, transpile, and execute quantum circuits with Qiskit and IBM Quantum Runtime.

Comments

Markdown supported