Skip to content

aadishv/pi-agy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pi-agy

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.

What is Antigravity?

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.

Architecture

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

Installation

cd pi-agy
bun install

Usage

1. Login with Google OAuth

bun run dev login

This opens your browser to authenticate with Google. The OAuth credentials used are from Antigravity (Google OAuth client ID 1071006060591-...).

2. Quick Start - Run Pi with proxy

bun run dev run

This automatically starts the proxy in the background and launches Pi. When you exit Pi, the proxy stops automatically.

OR manually:

2a. Start the proxy

bun run dev proxy start

This downloads CLIProxyAPI (if needed) and starts it on port 8317. Keep this running in a terminal.

2b. Configure Pi (first time only)

bun run dev config

This adds Antigravity models to Pi's ~/.pi/agent/models.json.

2c. Use Pi

Start Pi and select an Antigravity model (e.g., gemini-claude-opus-4-5-thinking).

Commands

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

Available Models

  • 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

How it works

  1. OAuth Login - Uses Google OAuth with Antigravity's client ID to get access tokens
  2. Project Discovery - Calls loadCodeAssist API to get your GCP project ID
  3. CLIProxyAPI - Runs as local proxy to translate Anthropic API → Antigravity format
  4. Pi Configuration - Updates models.json to point Pi at the local proxy

Files

  • ~/.pi-agy/credentials.json - OAuth tokens from Google
  • ~/.pi-agy/proxy/ - CLIProxyAPI binary and config
  • ~/.pi/agent/models.json - Pi's model configuration

Credits

OAuth flow and CLIProxyAPI integration based on:

  • CLIProxyAPI - The translation proxy
  • CCS - Claude Code Switch (inspiration for this project)

About

Vibe coded minimal CLI to use Antigravity OAuth models via Pi coding agent. Heavily WIP

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors