Guide · September 18, 2026
How to Use the Pi Coding Agent in VS Code (With a GUI)
Step-by-step: install the pi CLI, add PiLot Studio to VS Code, configure a provider, connect MCP servers, start a session, and fix common first-run issues.
The Pi coding agent (pi) is an open-source AI coding agent that plans, edits files, and runs commands in your project. PiLot Studio is a free, open-source VS Code extension that gives Pi a full graphical interface: chat, sessions, model switching, editor context, and voice dictation — all inside your editor. This guide takes you from a clean machine to a working Pi setup in VS Code, step by step.
Prerequisites
Two things before you start:
- VS Code 1.105 or newer and Pi CLI 1.4.0+. PiLot Studio installs from the VS Code Marketplace and Open VSX.
- A model to talk to. An API key from Anthropic, OpenAI, Google, xAI, or OpenRouter — or a local setup such as Ollama or llama.cpp, which needs no key at all.
A microphone is optional and only needed if you want voice dictation.
Step 1: Install the Pi CLI
PiLot Studio drives the official pi coding agent, so it must be on your machine first:
# macOS & Linux
curl -fsSL https://pi.dev/install.sh | sh
# Windows (PowerShell)
powershell -c "irm https://pi.dev/install.ps1 | iex"
Already installed? PiLot Studio auto-detects the binary — including versions managed by MISE — and can keep it updated for you.
Step 2: Install PiLot Studio in VS Code
Open the Extensions panel, search for “PiLot Studio”, and install. It's free, open source (Apache-2.0), and available on both the VS Code Marketplace and Open VSX.
Step 3: Configure a provider or local model
Pi is BYOK (bring your own key). Export an API key — ANTHROPIC_API_KEY, OPENAI_API_KEY, GEMINI_API_KEY — or add it in PiLot's settings panel. Running local models? Point Pi at Ollama or llama.cpp and skip the cloud entirely. Provider-by-provider setup notes live on the providers page.
Step 4: Open Pi inside VS Code
Press Ctrl+Shift+Alt+P (Cmd+Shift+Alt+P on macOS) or run “PiLot Studio: Open Panel” from the command palette. The Pi coding agent opens as a side panel next to your code:
Step 5: Start your first session
Type a request into the chat input and the agent goes to work. A few interactions worth knowing on day one:
- Slash commands — type
/to list available commands and skills. - File mentions — type
@to attach a file, or use the paperclip. - Editor context — right-click a selection and choose “Explain Code with PI”, “Refactor Code with PI”, or “Analyze Project with PI”.
- Model switching — the provider dropdown changes models mid-conversation without losing your session.
Step 6: Work with sessions, history, and branching
Every conversation is kept in a session tree. Click any node to revisit past work, branch or fork from an earlier point, and rename sessions to keep projects organized. Search chat history with Ctrl+F, edit your last message instead of retyping it, and export any session to Markdown or JSON. Token meters show input/output usage per exchange, thinking-level control adjusts reasoning for supported models, and Light Mode strips skills, extensions, and context files when you want a lean agent.
Step 7: Extend with packages and skills
Open the command palette and run “Manage Resources” to install community packages and skills — or browse them visually from the panel's package tab. Skills teach the agent procedures; packages add tools. See Pi packages & skills for details.
Step 8 (optional): Enable voice dictation
Press Ctrl+Shift+; (Cmd+Shift+; on macOS) to toggle the microphone. On first use, PiLot downloads a local whisper.cpp speech-to-text model (a few dozen MB for the default one) — after that one-time download, transcription runs entirely on your device. You can pick a different model, including English-only variants, in the extension settings.
Step 9 (optional): Connect MCP servers
Press 0 to open the MCP tab. It lists servers from PI's global mcp.json and, in a trusted project, .pi/mcp.json, with live connection state and available tools. Add stdio or HTTP servers, enable or disable them, choose per-server exposure (codemode, deferred, direct, or hidden), and sign in to OAuth servers. Preferences → MCP & Codemode controls codemode's mode and inline tool budget.
Troubleshooting first-run issues
- Pi not detected? Ensure
piis on your PATH, or setpi-agent.binaryPathin VS Code settings. - API errors? Verify the key is valid and restart the extension after changing keys.
- Dictation unavailable? Enable
pi-agent.voice.enabledand grant microphone access to VS Code. On Linux, thelibasound2package is required for microphone input. - Still stuck? Open an issue on GitHub.
Next steps
If you're deciding whether to use Pi through the terminal or a graphical interface, see our Pi CLI GUI guide for what each workflow is like. You can also explore what the Pi coding agent can do, or review the full install checklist.