{"slug": "pi-coding-agent-setup-guide", "title": "Pi Coding Agent Setup Guide", "summary": "The article provides a setup guide for the Pi Coding Agent, detailing installation via npm, usage commands for interactive REPL or one-off prompts, and configuration options for models, tools, and API keys. It also explains how to integrate MCP (Model Context Protocol) servers using an adapter, manage extensions and skills, and includes links to the official repository, adapter, and community resources.", "body_md": "# Pi Coding Agent Setup Guide\n\n## 1. Install the Agent\n```bash\nnpm install -g @mariozechner/pi-coding-agent\n```\n\n## 2. Launching Pi\n```bash\n# Interactive REPL\npi\n\n# One-off prompt\npi -p \"your prompt here\"\n\n# Continue last session (sessions are tree-structured)\npi -c\n```\nUse `pi --list-models` to inspect available models, or pass your own provider/model (e.g., `pi --provider openai --model gpt-4o`). Export the appropriate API key (e.g., `OPENAI_API_KEY`) before launching Pi.\n\n## 3. Configuration Files\n| Purpose | Global Location | Project Location | Notes |\n| --- | --- | --- | --- |\n| CLAUDE/AGENT instructions | `~/.pi/agent/CLAUDE.md` (or `AGENTS.md`) | parent dirs + cwd | All discovered files are concatenated automatically. |\n| System prompt (replace) | `~/.pi/agent/SYSTEM.md` | `.pi/SYSTEM.md` | Use `APPEND_SYSTEM.md` to extend defaults. |\n| Settings | `~/.pi/agent/settings.json` | `.pi/settings.json` | Project settings override global.\n\n## 4. Built-in & Optional Tools\nDefault tools: `read`, `write`, `edit`, `bash`. Enable more (e.g., `grep`, `find`, `ls`) via:\n```bash\npi --tools read,bash,edit,write,grep,find,ls\n```\nDisable all defaults with `pi --no-tools` if you need a locked-down run.\n\n## 5. MCP Integration\n1. **Install the adapter extension**\n   ```bash\n   pi install npm:pi-mcp-adapter\n   ```\n2. **Create `~/.pi/agent/mcp.json`**\n   ```json\n   {\n     \"settings\": {\n       \"toolPrefix\": \"mcp\",\n       \"idleTimeout\": 10\n     },\n     \"mcpServers\": {\n       \"chrome-devtools\": {\n         \"command\": \"npx\",\n         \"args\": [\"-y\", \"chrome-devtools-mcp@latest\", \"--browserUrl\", \"http://127.0.0.1:9222\"],\n         \"lifecycle\": \"lazy\"\n       }\n     }\n   }\n   ```\n   *Key options per server*: `command`, `args`, `url` (for HTTP servers), `lifecycle` (`lazy`/`eager`/`keep-alive`), `idleTimeout`, `directTools`, `debug`, `env`. You can also import configs from other agents (`cursor`, `claude-code`, `claude-desktop`, `vscode`, `windsurf`, `codex`).\n3. **Chrome DevTools server**\n   ```bash\n   start-chromium  # launches Chrome with remote debugging on 127.0.0.1:9222\n   pi -p \"use chrome devtools to navigate to example.com\"\n   ```\n   The adapter proxies MCP tools via a compact ~200-token tool, so Pi doesn't need to load every tool definition up front.\n\n## 6. Session & Headless Tips\n- `pi --session-dir <path>` to relocate the session tree.\n- `pi --no-session` for ephemeral runs.\n- For headless browser testing: `xvfb-run -a pi -p \"your command\"` (or rely on `start-chromium` headless mode).\n\n## 7. Extensions & Skills\n- Install extensions from npm or git: `pi install npm:package@version`, list via `pi list`, upgrade via `pi update`.\n- Popular picks: `pi-mcp-adapter`, `safe-git`, `pi-cost-dashboard`, `pi-notify`, `checkpoint`, `pi-canvas`.\n\n### Installing Skills with `skill.sh`\n`skill.sh` is a universal skill installer for Pi, Claude Code, Goose, and Windsurf.\n```bash\n# Install a skill for Pi\nskill.sh install pi https://raw.githubusercontent.com/user/repo/main/skill.md\n```\nIt downloads the skill markdown and places it under `~/.pi/agent/skills/`, handling any Pi-specific setup. Reuse the same skill definitions across agents for consistent capabilities.\n\n## 8. Helpful Resources\n- Pi repo: https://github.com/badlogic/pi-mono/tree/main/packages/coding-agent\n- MCP adapter: https://github.com/nicobailon/pi-mcp-adapter\n- Awesome Pi agent list: https://github.com/qualisero/awesome-pi-agent\n- Blog post introduction: https://lucumr.pocoo.org/2026/1/31/pi/\n", "url": "https://wpnews.pro/news/pi-coding-agent-setup-guide", "canonical_source": "https://gist.github.com/schpet/85531b6a05a5d8119e859bdec6b0e0b8", "published_at": "2026-02-04 18:00:42+00:00", "updated_at": "2026-05-22 12:40:09.082269+00:00", "lang": "en", "topics": ["developer-tools", "artificial-intelligence", "large-language-models", "open-source"], "entities": ["Pi Coding Agent", "Chrome DevTools", "OpenAI", "MCP"], "alternates": {"html": "https://wpnews.pro/news/pi-coding-agent-setup-guide", "markdown": "https://wpnews.pro/news/pi-coding-agent-setup-guide.md", "text": "https://wpnews.pro/news/pi-coding-agent-setup-guide.txt", "jsonld": "https://wpnews.pro/news/pi-coding-agent-setup-guide.jsonld"}}