Requirements
Node.js
Version 20.0.0 or later requiredCheck version:
node --versionBash Shell
Required for executing bash tool commandsBuilt-in on macOS/Linux. Git Bash on Windows.
Install Pi
- npm (Global)
- npm (Local)
- From Source
Install Pi globally to use the Verify installation:
pi command anywhere:Platform-Specific Setup
macOS
macOS
Pi works out of the box on macOS with Node.js 20+ installed.Install Node.js:Install Pi:
For clipboard support with images, the
@mariozechner/clipboard optional dependency is automatically installed.Linux
Linux
Pi requires Node.js 20+ and a bash shell (usually pre-installed).Install Node.js:Install Pi:
Windows
Windows
Pi requires a bash shell on Windows. The easiest option is Git Bash from Git for Windows.Custom Shell Path:If you use Cygwin, MSYS2, or WSL, specify the bash path in Windows Terminal Note:In Windows Terminal, use
Install Git for Windows
Download and install from git-scm.comThis includes Git Bash at
C:\Program Files\Git\bin\bash.exeInstall Node.js
~/.pi/agent/settings.json:Ctrl+Enter for multi-line input instead of Shift+Enter.Termux (Android)
Termux (Android)
Pi runs on Android through Termux, a Linux terminal emulator.Termux Limitations:
Install Termux
Download from GitHub or F-Droid (NOT Google Play)
Install Termux:API
Install Termux:API for clipboard support
- No image clipboard (text only)
- Some native dependencies unavailable on ARM64
- Storage access requires
termux-setup-storage
API Key Setup
API Key Providers
Most providers use API keys set via environment variables:| Provider | Environment Variable |
|---|---|
| Anthropic | ANTHROPIC_API_KEY |
| OpenAI | OPENAI_API_KEY |
| Google Gemini | GEMINI_API_KEY |
| Mistral | MISTRAL_API_KEY |
| Groq | GROQ_API_KEY |
| Cerebras | CEREBRAS_API_KEY |
| xAI | XAI_API_KEY |
| OpenRouter | OPENROUTER_API_KEY |
| Vercel AI Gateway | AI_GATEWAY_API_KEY |
| ZAI | ZAI_API_KEY |
| OpenCode Zen | OPENCODE_API_KEY |
| Hugging Face | HF_TOKEN |
| Kimi For Coding | KIMI_API_KEY |
| MiniMax | MINIMAX_API_KEY |
| MiniMax China | MINIMAX_CN_API_KEY |
Making API Keys Permanent
Add to your shell configuration file:- Bash
- Zsh
- Fish
Add to
~/.bashrc:Using Auth File
Store credentials in~/.pi/agent/auth.json instead of environment variables:
0600 permissions (user read/write only).
Advanced: Key Resolution
The key field supports three formats:
Cloud Provider Setup
Azure OpenAI
Azure OpenAI
Azure OpenAI uses the Responses API. Set these environment variables:Then run:
Amazon Bedrock
Amazon Bedrock
Bedrock supports multiple authentication methods:Option 1: AWS ProfileOption 2: IAM KeysOption 3: Bearer TokenOptional region (defaults to us-east-1):Using Bedrock:Bedrock Proxy Configuration:If connecting through a proxy:
Google Vertex AI
Google Vertex AI
Vertex AI uses Application Default Credentials (ADC):Local Development:Production/CI:Using Vertex:
OAuth Provider Setup
Several providers require OAuth authentication for subscription-based access:Start login
- Claude Pro/Max - Anthropic subscription
- ChatGPT Plus/Pro - OpenAI Codex models
- GitHub Copilot - Copilot subscription
- Google Gemini CLI - Free or paid Cloud Code Assist
- Google Antigravity - Free Gemini 3, Claude, GPT-OSS
GitHub Copilot
GitHub Copilot
- Press Enter for github.com, or enter your GitHub Enterprise Server domain
- If you get “model not supported”, enable it in VS Code:
- Open Copilot Chat
- Click model selector
- Select the model (warning icon)
- Click “Enable”
Google Providers
Google Providers
Gemini CLI:
- Standard Gemini models via Cloud Code Assist
- Free tier or paid subscription
- For paid: set
GOOGLE_CLOUD_PROJECTenv var
- Free sandbox with Gemini 3, Claude, GPT-OSS
- Any Google account, subject to rate limits
OpenAI Codex
OpenAI Codex
- Requires ChatGPT Plus or Pro subscription
- Access to GPT-5.x Codex models with extended context
- Personal use only; for production, use OpenAI Platform API
Custom Providers
- OpenAI-Compatible
- Custom Extensions
Use any OpenAI-compatible API (Ollama, vLLM, LM Studio) via Use the model:
models.json:Create ~/.pi/agent/models.json:Environment Variables
Pi supports several environment variables for configuration:| Variable | Description |
|---|---|
PI_CODING_AGENT_DIR | Override config directory (default: ~/.pi/agent) |
PI_PACKAGE_DIR | Override package directory (for Nix/Guix) |
PI_SKIP_VERSION_CHECK | Skip version check at startup |
PI_CACHE_RETENTION | Set to long for extended prompt cache (Anthropic: 1h, OpenAI: 24h) |
VISUAL or EDITOR | External editor for Ctrl+G |
Configuration Directories
Pi uses these directories:Verify Installation
Test your installation:Next Steps
Interactive Mode
Learn the terminal UI, commands, and keyboard shortcuts
Providers & Models
Detailed provider setup and model selection
Settings
Configure thinking levels, themes, and behavior
Customization
Extend Pi with skills, extensions, and packages
Troubleshooting
Permission denied on npm install
Permission denied on npm install
If you get permission errors during global install:Option 1: Use nvm (recommended)Option 2: Change npm’s default directory
Cannot find module errors
Cannot find module errors
If you see module errors after installation:
Bash not found (Windows)
Bash not found (Windows)
Pi requires bash on Windows. Install Git for Windows:
- Download from git-scm.com
- Install with default options
- Restart your terminal
- Run
piagain
shellPath in ~/.pi/agent/settings.json.