You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Set to 1 to enable mobile push notifications via ntfy
Optional
PI_EXT_NTFY_TOPIC
ntfy topic name (any unique string)
Required if ntfy is enabled
Treat .env.local as sensitive — it's already in .gitignore.
4. Install npm package dependencies
cd npm
npm install
cd ..
This installs all pi packages declared in npm/package.json (litellm provider, tavily, subagents, amplike, etc.).
5. Verify configuration
pi --list-modes
Expected output: rush, smart, deep.
Try a quick test:
pi "hello, world"
6. (Optional) Custom skills
The skills/ directory contains custom skills:
code-explorer — deep code understanding and tracing across multi-file flows
skill-creator — create, edit, and benchmark agent skills
They are auto-discovered from ~/.pi/agent/skills/.
The agents/ directory can hold custom subagent definitions (currently empty).
Updating
# Update pi itself + all npm packages in npm/
pi update
# Or just packages (skip pi self-update):
pi update --extensions
# Pull config changes from the repo:cd~/.pi/agent && git pull
pi update --extensions handles the npm packages declared in npm/package.json automatically. You only need to manually npm install in npm/ on a fresh clone (step 4 in Quick start).
Extensions in extensions/ are auto-discovered — both single .ts files and directories with index.ts are loaded automatically. No need to register them anywhere in settings.json.
Environment variable resolution
Pi starts with the current shell environment as a base. The _env-injector extension (extensions/_env-injector.ts) layers additional sources on top before any other extension runs, in this priority order (later overrides earlier):
Priority
Source
Description
1 (base)
Shell / OS environment
Actual shell env vars, .profile, systemd, etc.
2
~/.pi/agent/settings.json → "env" block
Global Pi settings, supports $VAR / ${VAR} expansion
3
~/.pi/agent/.env
Global dotenv (checked into version control)
4
~/.pi/agent/.env.local
Global dotenv secrets (gitignored)
5
.pi/settings.json → "env" block
Per-project Pi settings, supports $VAR / ${VAR} expansion
6
$cwd/.env
Project-level defaults
7 (highest)
$cwd/.env.local
Project-level local overrides
Extensions & Customizations
📋 Core TUI / Editor Enhancements
Extension
Description
left-strip-tools.ts
Replaces the default full-block colored backgrounds on tool call/result lines with a thin colored bar on the left edge. Preserves syntax highlighting, diffs, and truncation warnings. Each tool (read, bash, write, grep, find, ls) gets a color-coded strip — pending (blue), success (green), error (red). edit is intentionally not wrapped (its built-in renderer paints its own line backgrounds, which clash with the strip). Results are collapsed by default (showing line count) with Ctrl+O to expand.
keybindings.json
Overrides tui.input.newLine to use Shift+Enter / Ctrl+N instead of plain Enter (which submits).
themes/dark-strip.json — Custom dark-strip theme
Dark theme tuned for the left-strip tool rendering with distinct colors for tool states (toolPendingBg, toolSuccessBg, toolErrorBg), custom message backgrounds, and a cyan/blue accent palette.
🔔 Notifications
Extension
Description
notify.ts
Alerts you when pi waits for human input (agent_end). Sound: terminal bell + native audio player (paplay/pw-play/aplay) with bundled notification.wav fallback. Desktop: OSC 777 / Kitty OSC 99 / Windows toast. Mobile push (optional): sends an ntfy.sh notification if no activity within a configurable timeout (default 30s). Set PI_EXT_NTFY_ENABLED=1 and PI_EXT_NTFY_TOPIC in .env.local. Tags, priority, sound all configurable. Includes idle detection via xprintidle to avoid spamming when you're away.
🧠 Model Reliability
Extension
Description
tool-call-revert.ts
Detects when a model outputs malformed tool calls (e.g., DeepSeek V4 DSML text blocks instead of proper API blocks) and automatically reverts + retries the prompt as if the bad response never happened. The bad response is filtered out of context so the model never sees it — even on future turns. Gives up after 5 consecutive failures to prevent infinite loops.
models.json — Model compatibility overrides
Configures DeepSeek V4 Flash with reasoning: true, a custom thinking-level map (off→null, medium→high, high→max), and DeepSeek-compat thinking format.
🧪 Multi-Model Deliberation (Fusion)
Extension
Description
fusion.ts
Runs a prompt against a panel of models in parallel, then a judge model compares responses and returns structured JSON analysis: consensus, contradictions, partial coverage, unique insights, and blind spots. Configured via ~/.pi/agent/fusion.json or .pi/fusion.json. Toggle with /fusion on/off. Widget: shows status in the footer. Self-contained (no external packages).
🔍 Web & Research Tools
Extension
Description
web-search.ts
Registers a web_search tool powered by the Tavily API. Supports time-range filtering, search depth selection (ultra-fast through advanced), and rich result rendering with line-count summaries. Requires TAVILY_API_KEY. Also includes a web_research tool (disabled) for deep Tavily research (30–120s, async delivery).
visit-webpage.ts
Registers a visit_webpage tool that fetches URLs via Jina Reader (JavaScript-rendered HTML → markdown) or downloads images to temp files. Supports Jina auth via JINA_API_KEY. Handles retries on 5xx/451 errors, content-length limits (5MB for images, 100KB for pages), and 60s timeout.
🔄 Subagent Delegation
Extension
Description
subagent.ts
Registers a subagent tool that spawns isolated child sessions for parallel or single-task delegation. Provides 6 built-in agent roles: reviewer (code review), scout (codebase recon), researcher (web research), context-builder (analysis), worker (implementation), delegate (generic). Supports concurrent execution (up to panel concurrency). Widget: shows per-agent status in the footer. Shortcut Alt+O: opens a TUI overlay to peek subagent output, navigate between agents (←/→), and scroll (↑/↓). Automatically compatible with tool-call-revert inside child sessions.
💾 Persistent PTY Sessions
Extension
Description
pty/index.ts
Full-featured PTY manager with 6 tools: pty_start (spawn SSH/REPL/db shell), pty_send (send input with escape-sequence interpretation), pty_drain (read new output, cursor-advancing), pty_tail (peek without advancing), pty_list (list all sessions), pty_kill (terminate). Uses zigpty + @xterm/headless for accurate terminal emulation. Widget: shows active sessions in the footer. Shortcut Alt+T: opens a TUI overlay with tabbed per-session viewport and scrolling. Supports \n, \t, \x1b, \uXXXX escape sequences in input.
⚙️ Goal Mode & Auditing
Extension
Description
pi-goal-audit.ts & pi-goal-audit-helpers.ts
Custom fork of Michaelliv/pi-goal that adds an independent auditor subagent before marking goals complete. The auditor uses read-only tools (read, grep, find, ls, bash) and must output <approved/> for the goal to pass. Supports --tokens budget flag, continuation prompts, and token/time tracking. /goal command manages goal lifecycle (set, pause, resume, clear, complete).
🎛️ Tool & Skill Presets
Extension
Description
preset.ts
Switchable named presets that filter active tools and skills. Supports allowlist (tools-enabled) and denylist (tools-disabled) per category. Stored in ~/.pi/agent/presets.json (global) and .pi/presets.json (project). Menu: /preset opens an interactive selector. Fast path: /preset <name> activates directly. Shortcut Ctrl+Shift+P: cycles through presets. CLI flag: --preset <name> at startup. Built-in all and none presets. Interactive editor via /preset → Edit/Customize with full category browsing, toggle (Space), mode toggle (m), select all/none (a/n), and description scrolling (←/→). Widget: shows active preset name + tool/skill counts in the footer.
⚡ Performance & Metrics
Extension
Description
perf-speed.ts
Per-turn prefill and decode speed widget for the footer. Measures prefill speed (new input token delta / time-to-first-token, tok/s) and decode speed (output tokens / generation time, tok/s). Uses pi-footer event widget (widget ID: perf-speed). Emits values only on change to avoid unnecessary updates.
📝 Prompt History
Extension
Description
prompt-history.ts
Persists all submitted prompts to ~/.pi/agent/prompt-history.json (last 20). On startup, injects them into the editor's history so ↑ immediately recalls previous prompts — no first submit needed. Uses prototype patching on Editor.prototype.handleInput and addToHistory.
🔧 Environment & Dependency Management
Extension
Description
_env-injector.ts
Loads environment variables from settings.json env blocks and .env/.env.local files (both global and project-level) before any other extension runs. 7-tier priority: shell env → global settings → global .env → global .env.local → project settings → project .env → project .env.local. Supports $VAR, ${VAR}, and $$ shell-style expansion within values.
_install-deps.ts
Scans sibling extension directories for package.json files and auto-runs npm install if node_modules is missing or incomplete. Runs before other extensions, ensuring deps like zigpty and @xterm/headless (used by the PTY extension) are ready.
🐛 Debugging & Diagnostics
Extension
Description
context-dump.ts
Registers /context-dump command that dumps the full session context (all messages, model info, token usage, raw session entries, system prompt) to a timestamped JSON file. Useful for debugging context bleed, audit traces, or inspecting what the LLM actually sees.
📦 Configured Pi Packages (in settings.json)
Package
Description
pi-provider-litellm
LiteLLM API provider — connects to a private proxy exposing multiple local/cloud models (DeepSeek, Qwen, more).
pi-skill-tavily
Tavily web search skills (tavily-research, tavily-search, tavily-extract) for the agent.
Customizable footer bar with widgets: cwd, context bar, compaction status, model name, token cost, git branch/diff/remote, preset status, fusion status, perf-speed. Configured in extensions/pi-footer.json.
pi-mcp-adapter
MCP (Model Context Protocol) adapter — connects to external MCP servers defined in mcp.json. Ready for use.
pi-agentic-compaction
Intelligent context compaction that condenses old turns to save tokens while preserving key information. Runs on DeepSeek V4 Flash.
pi-openplan
Structured planning: /plan commands (write, read, list, edit, question), plan_write/plan_read/plan_edit/plan_question/plan_list tools, auto-formatted YAML frontmatter, plan storage in .pi/plans/.
pi-interactive-shell
Interactive CLI session overlay (interactive_shell tool) for delegating to TUI coding agents (pi, Claude Code, Gemini, Codex, Cursor) with modes: interactive, hands-free, dispatch, monitor.
@dreki-gg/pi-context7
Fetches current library documentation by name or Context7 ID before coding against third-party APIs — prevents relying on stale training data.
🌐 Thinking Modes
Configured in modes.json — all use DeepSeek V4 Flash via LiteLLM with different thinking levels:
Mode
Thinking
Use Case
rush
Off (no thinking)
Quick lookups, simple edits, low-latency tasks
smart
Medium (mapped to high)
Default balance — general coding
deep
High (mapped to max)
Complex architecture, debugging, planning
🧰 Custom Skills
Skill
Description
code-explorer
Deep code understanding and tracing across multi-file flows. Uses CodeGraph and CodeSearch for fast cross-file analysis. Automatically triggered before complex cross-file edits.
skill-creator
Tools to create, edit, and benchmark custom agent skills.
pi-goal-writer
Drafts and reviews strong /goal objectives with clear success criteria, verification steps, constraints, and iteration policy.