NOTE: THIS WAS VIBE CODED BY AADISH V (mail@aadishv.dev) USING CLAUDE OPUS 4.5 AS A FUN TEST OF CLAUDE CODE.
Antigravity OAuth + CLIProxyAPI integration for Pi coding agent.
Antigravity provides access to various AI models (Claude, Gemini) through Google's cloudcode-pa.googleapis.com API using your Google account subscription. It uses Google OAuth for authentication.
Since Antigravity uses a custom Gemini-like API format (not OpenAI or Anthropic format), we need CLIProxyAPI to translate between Anthropic API (which Pi speaks) and Antigravity's format.
┌─────────┐ ┌─────────────────┐ ┌─────────────────────┐
│ Pi │────▶│ CLIProxyAPI │────▶│ cloudcode-pa. │
│ Agent │◀────│ (localhost:8317)│◀────│ googleapis.com │
└─────────┘ └─────────────────┘ └─────────────────────┘
│ │
│ Anthropic API │ Custom Gemini-like format
│ │ + Google OAuth token
▼ ▼
~/.pi/agent/ ~/.pi-agy/
models.json credentials.json
cd pi-agy
bun installbun run dev loginThis opens your browser to authenticate with Google. The OAuth credentials used are from Antigravity (Google OAuth client ID 1071006060591-...).
bun run dev runThis automatically starts the proxy in the background and launches Pi. When you exit Pi, the proxy stops automatically.
OR manually:
bun run dev proxy startThis downloads CLIProxyAPI (if needed) and starts it on port 8317. Keep this running in a terminal.
bun run dev configThis adds Antigravity models to Pi's ~/.pi/agent/models.json.
Start Pi and select an Antigravity model (e.g., gemini-claude-opus-4-5-thinking).
| Command | Description |
|---|---|
pi-agy login |
Authenticate with Google OAuth |
pi-agy logout |
Clear stored credentials |
pi-agy status |
Show auth, proxy, and config status |
pi-agy refresh |
Manually refresh access token |
pi-agy config |
Add Antigravity models to Pi |
pi-agy remove |
Remove Antigravity from Pi config |
pi-agy run |
Start proxy in background and run Pi together |
pi-agy proxy start |
Start CLIProxyAPI server |
pi-agy proxy stop |
Stop CLIProxyAPI server |
pi-agy proxy install |
Download CLIProxyAPI binary |
pi-agy help |
Show help message |
- gemini-claude-opus-4-5-thinking - Claude Opus 4.5 with extended thinking
- gemini-claude-sonnet-4-5-thinking - Claude Sonnet 4.5 with extended thinking
- gemini-claude-sonnet-4-5 - Claude Sonnet 4.5
- gemini-3-pro-preview - Gemini 3 Pro
- OAuth Login - Uses Google OAuth with Antigravity's client ID to get access tokens
- Project Discovery - Calls
loadCodeAssistAPI to get your GCP project ID - CLIProxyAPI - Runs as local proxy to translate Anthropic API → Antigravity format
- Pi Configuration - Updates
models.jsonto point Pi at the local proxy
~/.pi-agy/credentials.json- OAuth tokens from Google~/.pi-agy/proxy/- CLIProxyAPI binary and config~/.pi/agent/models.json- Pi's model configuration
OAuth flow and CLIProxyAPI integration based on:
- CLIProxyAPI - The translation proxy
- CCS - Claude Code Switch (inspiration for this project)