Pi
Pi Coding Agent
- pi
Every invocation mode, native model listing with search. The reference harness here.
- Invoke
- 6 of 6 · official
- Models
- native listing
- MCP
- json · pi
- Agents file
- ~/.pi/agent/AGENTS.md
Access
- Get
getHarness("pi") - CLI
harnesses paths pi --json - Trypi in the explorer
Pi is the reference harness for this package, because it supports everything: --no-tools for the advisor, --tools read,grep,find,ls for a read-only agent, --mode json for structured output on all of them, --model for selection and --list-models with an optional fuzzy filter. listModels parses that output into the shared AvailableModel shape; it lists only providers with configured authentication, so an empty result is a credentials question, not a bug.
Sessions are JSONL per project under ~/.pi/agent/sessions/, with UUIDv7 ids, and the directory moves with PI_CODING_AGENT_SESSION_DIR or --session-dir. .pi/SYSTEM.md replaces the system prompt and APPEND_SYSTEM.md appends to it. .pi/prompts/ holds reusable Markdown prompts invoked as slash commands, so those paths appear in both promptTemplates and commands. The Pi extension in this package registers the eleven tools in Pi itself.
MCP servers? Since 0.99 Pi has them built in, in ~/.pi/agent/mcp.json and .pi/mcp.json. The project file counts only once you trust the project. sse is out, Pi wants stdio or streamable HTTP.
Capabilities and invocation
- mcp: yes
- vision: yes
- audio: no
- video: no
- tools: yes
- streaming: yes
Binary pi, evidence official. Add --mode json for structured event output. Model selection appends --model {model}.
- advisor{}
-p --no-tools {prompt} - advisor · json{ structured: true }
-p --no-tools --mode json {prompt} - read-only{ readOnly: true }
-p --tools read,grep,find,ls {prompt} - read-only · json{ readOnly: true, structured: true }
-p --tools read,grep,find,ls --mode json {prompt} - agent{ tools: true }
-p {prompt} - agent · json{ tools: true, structured: true }
-p --mode json {prompt}
Model listing runs pi --list-models and --list-models {search} with a filter. Lists models with configured provider authentication; accepts an optional fuzzy search.
Paths
Templates as the registry stores them. ~, ${HOME}, ${TMPDIR} and %VAR% expand in resolve(); entries tagged with a platform are dropped on the others. Open in the explorer to see them expanded for a home directory of your choice.
config
~/.pi/agent/settings.json.pi/settings.json
sessions
~/.pi/agent/sessions/<dash-encoded-cwd>/<timestamp>_<session-id>.jsonlPer-project session transcripts in JSONL format; session ids are UUIDv7. Overridable with --session-dir.
instructions
AGENTS.mdLoaded from parent directories and cwd; CLAUDE.md accepted as an alternative, AGENTS.override.md takes precedence over both in a directory.
.pi/SYSTEM.mdReplaces the default system prompt; APPEND_SYSTEM.md appends instead.
~/.pi/agent/AGENTS.mdGlobal user-level instructions.
~/.pi/agent/SYSTEM.mdGlobal system prompt replacement; APPEND_SYSTEM.md appends instead.
skills
.pi/skills/~/.pi/agent/skills/Global user-level skills.
commands
.pi/prompts/Prompt templates invoked as slash commands.
~/.pi/agent/prompts/Global user-level prompt templates.
promptTemplates
.pi/prompts/Prompt templates invoked as slash commands.
~/.pi/agent/prompts/Global user-level prompt templates.
Empty
hookstempThat is not the same as the feature being missing.
Env overrides
Variables the harness reads to move a root. The path is the default while the variable is unset; resolve() applies a set one to temp.
PI_CODING_AGENT_DIR~/.pi/agentconfig · sessions · instructions · skills · commands · promptTemplatesA leading ~ in the value is expanded.
PI_CODING_AGENT_SESSION_DIR~/.pi/agent/sessionssessionsTakes precedence over PI_CODING_AGENT_DIR for sessions; --session-dir beats both.
MCP servers
~/.pi/agent/mcp.jsonuser · json · pi · mcpServers.pi/mcp.jsonproject · json · pi · mcpServers
Detection
envVars
- PI_CODING_AGENT
- PI_SESSION_ID
- PI_SESSION_FILE
projectMarkers
- .pi
Persistence
- JSON - Settings, auth, trust, models, and keybindings files. (official)
- JSONL - Session transcripts. (official)
syncAgentsFiles links ~/.pi/agent/AGENTS.md to the master bundle.