{"_id":"@dereknex/pi-antigravity","_rev":"3-5bdb6ae5be8bb16075a18d030d4c7ed2","name":"@dereknex/pi-antigravity","dist-tags":{"latest":"0.8.0"},"versions":{"0.6.0":{"name":"@dereknex/pi-antigravity","version":"0.6.0","keywords":["pi-package","pi-extension","antigravity","google","oauth","provider"],"author":{"name":"Rahul Arya"},"license":"MIT","_id":"@dereknex/pi-antigravity@0.6.0","maintainers":[{"name":"dereknex","email":"derek@nextty.com"}],"homepage":"https://github.com/dereknex/pi-antigravity#readme","bugs":{"url":"https://github.com/dereknex/pi-antigravity/issues"},"pi":{"extensions":["./src/index.ts"]},"dist":{"shasum":"c767d11e27fad7b46cf36062920b22c739703617","tarball":"https://registry.npmjs.org/@dereknex/pi-antigravity/-/pi-antigravity-0.6.0.tgz","fileCount":27,"integrity":"sha512-ReQIxPeAwC8emChjZICUHNY4ODXGH/YJF7i4upFW8nxJSUVQECK9/XBV/StOCQheaF5kUNEo7fqrKJQijmvO/g==","signatures":[{"sig":"MEQCIFRrfnE0JAGUHYgBht+dFmdaJcgOPz9iFlR74SZ8J+w7AiB6CW4AhrCLyvBo8SI7MmAAVi3FZP3U+Y1vWz+D/W1UdQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":180744},"main":"./src/index.ts","type":"module","gitHead":"9ee03aad2763b0088a5cde1ea8c5e0a819469256","scripts":{"lint":"eslint src","test":"bun scripts/test-accounts.ts && bun scripts/test-model-sync.ts && bun scripts/test-model-routing.ts && bun scripts/test-usage-formatter.ts && bun scripts/test-stream-sse.ts && bun scripts/test-http-proxy.ts","check":"bun run typecheck && bun run lint && bun run format:check && bun run security-check && bun run test","format":"prettier --write .","release":"changeset publish","lint:fix":"eslint src --fix","changeset":"changeset","typecheck":"tsc --noEmit","smoke:tools":"bun scripts/smoke-tool-schema.ts","format:check":"prettier --check .","smoke:models":"bun scripts/smoke-all-models.mjs","security-check":"bun scripts/security-check.ts","version-packages":"changeset version"},"_npmUser":{"name":"dereknex","email":"derek@nextty.com"},"repository":{"url":"git+https://github.com/dereknex/pi-antigravity.git","type":"git"},"_npmVersion":"11.16.0","description":"Personal Antigravity / Cloud Code Assist provider for Pi Coding Agent","directories":{},"_nodeVersion":"24.18.0","dependencies":{"undici":"^8.10.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"bun@1.4.0","devDependencies":{"eslint":"^10.7.0","globals":"^17.7.0","prettier":"^3.9.5","@eslint/js":"^10.0.1","typescript":"^6.0.3","@types/node":"^26.1.1","@changesets/cli":"^3.0.2","typescript-eslint":"^8.64.0","@earendil-works/pi-ai":"^0.84.2","eslint-config-prettier":"^10.1.8"},"peerDependencies":{"@earendil-works/pi-ai":">=0.80.0","@earendil-works/pi-coding-agent":">=0.80.0"},"_npmOperationalInternal":{"tmp":"tmp/pi-antigravity_0.6.0_1789098948321_0.11358403664288597","host":"s3://npm-registry-packages-npm-production"}},"0.7.0":{"name":"@dereknex/pi-antigravity","version":"0.7.0","keywords":["pi-package","pi-extension","antigravity","google","oauth","provider"],"author":{"name":"Rahul Arya"},"license":"MIT","_id":"@dereknex/pi-antigravity@0.7.0","maintainers":[{"name":"dereknex","email":"derek@nextty.com"}],"homepage":"https://github.com/dereknex/pi-antigravity#readme","bugs":{"url":"https://github.com/dereknex/pi-antigravity/issues"},"pi":{"extensions":["./src/index.ts"]},"dist":{"shasum":"f47fe04182317391fd676119ccdadd7361b005d1","tarball":"https://registry.npmjs.org/@dereknex/pi-antigravity/-/pi-antigravity-0.7.0.tgz","fileCount":27,"integrity":"sha512-xeVTFztufDhvf9e2ikqTHk7k+DJ0Wt1jD8TUCWSAIytZ4bSN6rTcPqbCA1JVTT+3+Ee7/tD9w5lHsNH7F+844Q==","signatures":[{"sig":"MEUCIBO1FmIQMiWwk4v0XgjebhsSX/0BhEiGmhvDdOT2wkg2AiEAu2kD20ICwaKEIPoFizhhdSH5AI8BCwdVXYT8/bJL+Rw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQCCN8e7foYXEoCxQ1BLBD9Stmg5+FD+7XqyVVpbnM0hkwIhAMjd88j3EfOT90I3sssgY/jWno1ZJXQJQuOUZzCX/Ojl","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dereknex%2fpi-antigravity@0.7.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":183218},"main":"./src/index.ts","type":"module","gitHead":"81a6292c115765214a8779c8f40ee7922f89df69","scripts":{"lint":"eslint src","test":"bun scripts/test-accounts.ts && bun scripts/test-model-sync.ts && bun scripts/test-model-routing.ts && bun scripts/test-usage-formatter.ts && bun scripts/test-stream-sse.ts && bun scripts/test-http-proxy.ts","check":"bun run typecheck && bun run lint && bun run format:check && bun run security-check && bun run test","format":"prettier --write .","release":"changeset publish","lint:fix":"eslint src --fix","changeset":"changeset","typecheck":"tsc --noEmit","smoke:tools":"bun scripts/smoke-tool-schema.ts","format:check":"prettier --check .","smoke:models":"bun scripts/smoke-all-models.mjs","security-check":"bun scripts/security-check.ts","version-packages":"changeset version"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:dd5a6ed1-7423-4e28-88ab-e144e5d643e7"}},"repository":{"url":"git+https://github.com/dereknex/pi-antigravity.git","type":"git"},"_npmVersion":"12.0.2","description":"Personal Antigravity / Cloud Code Assist provider for Pi Coding Agent","directories":{},"_nodeVersion":"22.23.2","dependencies":{"undici":"^8.10.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"bun@1.4.0","devDependencies":{"eslint":"^10.7.0","globals":"^17.7.0","prettier":"^3.9.5","@eslint/js":"^10.0.1","typescript":"^6.0.3","@types/node":"^26.1.1","@changesets/cli":"^3.0.2","typescript-eslint":"^8.64.0","@earendil-works/pi-ai":"^0.84.2","eslint-config-prettier":"^10.1.8"},"peerDependencies":{"@earendil-works/pi-ai":">=0.80.0","@earendil-works/pi-coding-agent":">=0.80.0"},"_npmOperationalInternal":{"tmp":"tmp/pi-antigravity_0.7.0_1789115652438_0.14973206725203037","host":"s3://npm-registry-packages-npm-production"}},"0.8.0":{"pi":{"extensions":["./src/index.ts"]},"_id":"@dereknex/pi-antigravity@0.8.0","bugs":{"url":"https://github.com/dereknex/pi-antigravity/issues"},"dist":{"shasum":"ce4eedf1485dbd8e52acc3b018a91d7def0ee5ba","tarball":"https://registry.npmjs.org/@dereknex/pi-antigravity/-/pi-antigravity-0.8.0.tgz","fileCount":31,"integrity":"sha512-lnrzyQIyr3d8enzqzuhDYoUHzYDBEozcBubSmc7AanCWTnIzMVdkThLs7v5YM81YhcM1PqG2QUkQ3GNB8AF9HA==","signatures":[{"sig":"MEQCIClM9Bq8L6e30sNI45EDTP4emvQF3NeEm1ubQacIHKF5AiANuoYMVNbwLkspLHHLYWWEh8QCqgXVy0k4JkhWuTsgGA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCg2jQxjStMti+Gr22KCydQ6T/iKDWyirQcdI6r+bbTewIhAJ6R99QqZRmHY+aiiHoZm/1goZ4MBxTOtvWArQVCLNgJ"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dereknex%2fpi-antigravity@0.8.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":241293},"main":"./src/index.ts","name":"@dereknex/pi-antigravity","type":"module","author":{"name":"Rahul Arya"},"gitHead":"5c9c1cdab71aa8eeffb38bd1fa9a0eb58aaab97f","license":"MIT","scripts":{"lint":"eslint src","test":"bun scripts/test-accounts.ts && bun scripts/test-model-discovery.ts && bun scripts/test-model-routing.ts && bun scripts/test-usage-formatter.ts && bun scripts/test-stream-sse.ts && bun scripts/test-stream-header-deadline.ts && bun scripts/test-transcript-context.ts && bun scripts/test-image-gen.ts && bun scripts/test-http-proxy.ts","check":"bun run typecheck && bun run lint && bun run format:check && bun run security-check && bun run test","format":"prettier --write .","release":"changeset publish","lint:fix":"eslint src --fix","changeset":"changeset","typecheck":"tsc --noEmit","smoke:tools":"bun scripts/smoke-tool-schema.ts","format:check":"prettier --check .","smoke:models":"bun scripts/smoke-all-models.mjs","security-check":"bun scripts/security-check.ts","version-packages":"changeset version"},"version":"0.8.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:dd5a6ed1-7423-4e28-88ab-e144e5d643e7"}},"homepage":"https://github.com/dereknex/pi-antigravity#readme","keywords":["pi-package","pi-extension","antigravity","google","oauth","provider"],"repository":{"url":"git+https://github.com/dereknex/pi-antigravity.git","type":"git"},"_npmVersion":"12.0.2","description":"Personal Antigravity / Cloud Code Assist provider for Pi Coding Agent","directories":{},"maintainers":[{"name":"dereknex","email":"derek@nextty.com"}],"_nodeVersion":"22.23.2","dependencies":{"undici":"^8.10.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"bun@1.4.0","devDependencies":{"eslint":"^10.7.0","globals":"^17.7.0","prettier":"^3.9.5","@eslint/js":"^10.0.1","typescript":"^6.0.3","@types/node":"^26.1.1","@changesets/cli":"^3.0.2","typescript-eslint":"^8.64.0","@earendil-works/pi-ai":"^0.84.2","eslint-config-prettier":"^10.1.8"},"peerDependencies":{"@earendil-works/pi-ai":">=0.80.0","@earendil-works/pi-coding-agent":">=0.80.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-antigravity_0.8.0_1789984581194_0.19079355370527584"}}},"time":{"created":"2026-09-11T03:55:48.111Z","modified":"2026-09-21T09:56:21.727Z","0.6.0":"2026-09-11T03:55:48.443Z","0.7.0":"2026-09-11T08:34:12.532Z","0.8.0":"2026-09-21T09:56:21.295Z"},"bugs":{"url":"https://github.com/dereknex/pi-antigravity/issues"},"author":{"name":"Rahul Arya"},"license":"MIT","homepage":"https://github.com/dereknex/pi-antigravity#readme","keywords":["pi-package","pi-extension","antigravity","google","oauth","provider"],"repository":{"url":"git+https://github.com/dereknex/pi-antigravity.git","type":"git"},"description":"Personal Antigravity / Cloud Code Assist provider for Pi Coding Agent","maintainers":[{"name":"dereknex","email":"derek@nextty.com"}],"readme":"# pi-antigravity\n\n[![npm version](https://img.shields.io/npm/v/pi-antigravity?logo=npm)](https://www.npmjs.com/package/pi-antigravity)\n[![license](https://img.shields.io/npm/l/pi-antigravity)](LICENSE)\n\n**pi-antigravity** is a [Pi Coding Agent](https://pi.dev) provider that lets Pi talk directly to Google Antigravity / Cloud Code Assist models — Gemini, plus the Claude and GPT-OSS models Antigravity also advertises. Sign in with Google, pick a model, and go. Under the hood it handles OAuth login, native streaming, model routing, and quota diagnostics itself, so it never shells out to an external Antigravity CLI.\n\n> **Unofficial integration.** This project is not affiliated with or endorsed by Google. Use it only with an account and services you are authorized to access, and review its source before granting OAuth permissions.\n\n## Contents\n\n- [Requirements](#requirements)\n- [Install](#install)\n- [Quick start](#quick-start)\n- [Differences from upstream](#differences-from-upstream)\n- [Authentication and credential safety](#authentication-and-credential-safety)\n- [Multiple accounts](#multiple-accounts)\n- [Usage and status bar display](#usage-and-status-bar-display)\n- [Commands](#commands)\n- [Models and routing](#models-and-routing)\n- [Configuration](#configuration)\n- [Troubleshooting](#troubleshooting)\n- [Development](#development)\n\n## Requirements\n\n- Pi Coding Agent and Pi AI version **0.80.0 or later**\n- A Google account that can use the relevant Cloud Code Assist / Antigravity services\n- A browser to complete the Google sign-in. Same-machine is best (the browser hits the local callback automatically); on a remote/headless machine, complete sign-in anywhere and paste the resulting callback URL back into Pi (see [Troubleshooting](#troubleshooting)).\n\n## Install\n\nInstall from npm:\n\n```bash\npi install npm:@dereknex/pi-antigravity\n```\n\nOr install the latest repository version:\n\n```bash\npi install git:github.com/dereknex/pi-antigravity\n```\n\nRestart Pi (or run `/reload`) after installation. To update the npm package later, use `pi update npm:@dereknex/pi-antigravity`.\n\n## Quick start\n\n1. Start Pi and run `/login antigravity`.\n2. Complete Google sign-in in your browser.\n3. Select a model, for example:\n\n   ```text\n   /model antigravity/gemini-3.7-flash\n   ```\n\n4. Start working. If a request fails, run `/antigravity.doctor` for sanitized diagnostics.\n\n## Differences from upstream\n\nCompared to upstream [`Rahularya01/pi-antigravity`](https://github.com/Rahularya01/pi-antigravity), this fork keeps an account-slot architecture and adds its own quota/status presentation. Upstream now also discovers models dynamically and ships image generation, streaming watchdogs, and tool-schema isolation; those are shared with this fork (see the changelog for the merge).\n\n| Feature                     | Upstream (`Rahularya01/pi-antigravity`)                                                                                             | This Fork (`pi-antigravity`)                                                                                                                                                                                                                                |\n| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **Dynamic Model Discovery** | Fetches `fetchAvailableModels`, groups runtime variants into public IDs, and persists the catalog in Pi's per-provider model store. | Fetches the same catalog **per account slot** (each account's entitlement differs), groups runtime variants the same way, persists each slot's catalog in Pi's per-provider model store, and re-syncs via `/antigravity.models sync`.                       |\n| **Usage & Status Bar**      | Only supports basic text dump in `/antigravity.usage`.                                                                              | **Live status bar footer** (`antigravity.quota`) with 5-hour and weekly quota percentages, auto-refreshing on turn end/model switch, visual reset countdowns, and configurable Opus display & reset time toggles (`statusShowOpus`, `statusShowReset`).     |\n| **Multi-Account Slots**     | Single Google account slot only (`antigravity`).                                                                                    | **1–8 independent account slots** (`antigravity`, `antigravity-2`, ...) with separate OAuth tokens, isolated quota pools, per-account catalog cache files, status bar account tags, and quick account switching (`/antigravity.account use <slot\\|email>`). |\n\n### 1. Dynamic Model Discovery & Derivation\n\n- **Backend Catalog Discovery**: Automatically queries the Google Cloud Code Assist `fetchAvailableModels` endpoint at session startup and on demand via `/antigravity.models sync`.\n- **Automatic Derivation (`applyDerivedModels`)**: When Google rolls out new model families (such as `gemini-3.8-flash` or new third-party models), the extension dynamically maps runtime tiers to Pi thinking levels, configures context windows and input modalities, and exposes them in `/model` without requiring an extension update.\n- **Offline Cache & Resilience**: Raw backend rows are persisted to `~/.pi/agent/antigravity-models-cache[.slot].json`. On offline restarts, models are restored instantly from disk cache. Background refresh failures gracefully retain existing models (\"retain on failure\").\n\n### 2. Live Quota & Status Bar Display\n\n- **Real-Time Status Bar**: Integrated directly into Pi's footer (`antigravity.quota`), showing 5-hour and weekly usage percentages (e.g. `Gemini 5h:17.2% w:6.2%`).\n- **Opus Usage Visibility Control**: By default, Claude / Opus / 3P quotas are hidden in the status bar to keep it concise. You can enable them via:\n  - In `settings.json`: `\"antigravity\": { \"statusShowOpus\": true }`\n  - Via environment variable: `export ANTIGRAVITY_STATUS_SHOW_OPUS=true` (or `1` / `on` / `yes`)\n- **Reset Time Visibility Control**: Optionally append bucket reset countdowns in the status bar (e.g. `Gemini 5h:17.2%(3h 12m) w:6.2%(4d 8h)`):\n  - In `settings.json`: `\"antigravity\": { \"statusShowReset\": true }`\n  - Via environment variable: `export ANTIGRAVITY_STATUS_SHOW_RESET=true`\n- **Rich Quota Inspector**: `/antigravity.usage` displays visual progress bars, percentage used, and precise reset countdowns for Gemini and third-party quota buckets.\n\n### 3. Multi-Account Slots & Isolation\n\n- **Slot Provisioning**: Register up to 8 slots (`antigravity`, `antigravity-2`, ..., `antigravity-8`) using `ANTIGRAVITY_ACCOUNTS` (default `3`).\n- **Quota & Credential Isolation**: Each slot signs in with its own Google account (`/login antigravity-2`) and draws from its own quota pool.\n- **Per-Account Catalog**: Because entitlements differ across Google accounts, each slot maintains its own isolated model cache file.\n- **Quick Switching**: Switch accounts seamlessly via `/antigravity.account use <slot|email>` or by selecting an account's model directly in `/model`. Non-primary accounts display an informative tag in the status bar (e.g. `#2 work`).\n\n## Authentication and credential safety\n\nThe provider uses the OAuth 2.0 Authorization Code flow with PKCE, so credentials are only ever exchanged with Google — never typed into Pi.\n\n1. `/login antigravity` opens Google sign-in and starts a temporary callback listener at `http://localhost:51121/oauth-callback`.\n2. After you approve access, Pi exchanges the callback code for tokens and stores the provider credentials in Pi's auth store (normally `~/.pi/agent/auth.json`).\n3. Pi refreshes access tokens automatically when they expire — you shouldn't need to sign in again unless a token is revoked.\n\nThe callback listener binds only to a loopback host, so it isn't reachable from outside your machine. The auth file it writes to contains sensitive access and refresh tokens: **do not commit it, paste it into issues, or share its contents.**\n\nSigning in requests these Google OAuth scopes:\n\n| Scope                                | Why it's needed                                                           |\n| ------------------------------------ | ------------------------------------------------------------------------- |\n| `aicode`                             | Access to the Cloud Code Assist / Antigravity model catalog and endpoints |\n| `cloud-platform`                     | General Cloud Code Assist API access                                      |\n| `userinfo.email`, `userinfo.profile` | Identify the signed-in Google account                                     |\n| `cclog`                              | Cloud Code Assist logging/telemetry endpoints used by the API             |\n| `experimentsandconfigs`              | Server-side experiment and config flags for the API                       |\n\nReview these permissions before approving access. If your credentials expire or are revoked, just re-run `/login antigravity` to sign in again.\n\n## Multiple accounts\n\nPi stores exactly one credential per provider ID, so this extension registers several\nAntigravity provider IDs — one per account slot. Slot 1 keeps the plain `antigravity`\nID, and further slots are `antigravity-2`, `antigravity-3`, … Every slot shares the same\nimplementation, endpoints, and model routing; only the Google credential differs.\n\nSign in to a second account:\n\n```text\n/login antigravity-2\n```\n\nModels and the account's email appear immediately after login — no `/reload` needed. To\nswitch the current session between accounts:\n\n```text\n/antigravity.account                  # list slots, sign-in state, and the active one\n/antigravity.account use 2            # switch to slot 2, keeping the current model\n/antigravity.account use work@gmail   # or match on the account email\n```\n\n`/model antigravity-2/gemini-3.7-flash` works too, and the switch takes effect on the next\nrequest. The footer prefixes non-primary accounts (`#2`) so it is clear which quota is being\nspent. Quota, entitlement, and the model catalog are per account, so each slot caches its own\ncatalog (`~/.pi/agent/antigravity-models-cache.antigravity-2.json`; slot 1 keeps the original\n`antigravity-models-cache.json`).\n\nSlots you have not signed in to register no models, so they stay out of `/model` while\nremaining available to `/login`. Set `ANTIGRAVITY_ACCOUNTS` to change how many slots are\nregistered (1–8, default 3).\n\nTwo caveats:\n\n- After `/logout antigravity-2`, that slot's models stay listed until Pi restarts. Pi marks\n  them unavailable, so selecting one fails cleanly rather than sending a request.\n- Switching accounts does not migrate conversation state; it only changes which credential\n  and quota the next request uses.\n\n## Usage and status bar display\n\nThe extension keeps you informed about your Google Cloud Code Assist quota consumption without interrupting your flow.\n\n### Status bar quota line\n\nWhen an Antigravity model is active, the footer status bar automatically shows the current account's quota consumption:\n\n```text\nGemini 5h:17.2% w:6.2%\n```\n\n- **Account Tag**: Secondary account slots show a prefix such as `#2 ` or `#2 work `, so you always know which account is being charged.\n- **5h Window**: Rolling 5-hour quota consumption percentage.\n- **Weekly Window (`w:`)**: Rolling 7-day quota consumption percentage.\n- **Auto-Refresh**: Updated automatically at session start, turn end, model switch, and after `/antigravity.usage` or `/antigravity.models`.\n\n### Controlling Opus / 3P visibility in the status bar\n\nBy default, Opus / Claude / 3P quota is hidden in the status bar to keep the footer compact. To show Opus usage alongside Gemini (`Gemini 5h:... · Opus 5h:...`), configure `statusShowOpus`:\n\n- In `~/.pi/agent/settings.json` (global) or `.pi/settings.json` (project):\n  ```json\n  {\n    \"antigravity\": {\n      \"statusShowOpus\": true\n    }\n  }\n  ```\n- Or via environment variable:\n  ```bash\n  export ANTIGRAVITY_STATUS_SHOW_OPUS=true   # or 1 / on / yes\n  ```\n\n### Controlling Reset Time visibility in the status bar\n\nBy default, reset countdowns are omitted from the status bar. To display reset countdowns (e.g. `Gemini 5h:17.2%(3h 12m) w:6.2%(4d 8h)`), configure `statusShowReset`:\n\n- In `~/.pi/agent/settings.json` (global) or `.pi/settings.json` (project):\n  ```json\n  {\n    \"antigravity\": {\n      \"statusShowReset\": true\n    }\n  }\n  ```\n- Or via environment variable:\n  ```bash\n  export ANTIGRAVITY_STATUS_SHOW_RESET=true   # or 1 / on / yes\n  ```\n\n### Detailed quota command (`/antigravity.usage`)\n\nRun `/antigravity.usage` to inspect full quota groups with visual progress bars and reset countdowns:\n\n```text\nGemini Models\n  [==------------------] Five Hour Limit: 17.2% used · resets in 3h 12m\n  [=-------------------] Weekly Limit: 6.2% used · resets in 4d 8h\n\nClaude and GPT models\n  [====================] Five Hour Limit: 99.3% used · resets in 1h 45m\n  [=======-------------] Weekly Limit: 34.2% used · resets in 2d 14h\n```\n\n## Commands\n\n| Command                                      | Description                                                                                      |\n| -------------------------------------------- | ------------------------------------------------------------------------------------------------ |\n| `/login antigravity`                         | Sign in to Google and configure the provider.                                                    |\n| `/model antigravity/<model-id>`              | Choose a registered Antigravity model.                                                           |\n| `/antigravity.account`                       | List the account slots, which are signed in, and which one this session is using.                |\n| `/antigravity.account use <slot\\|email>`     | Switch this session to another signed-in account, keeping the current model.                     |\n| `/antigravity.usage`                         | Show the server-reported shared quota groups and reset times.                                    |\n| `/antigravity.models`                        | List available runtime models, used shared-pool quota, and capabilities.                         |\n| `/antigravity.models sync`                   | Re-sync the model catalog from the backend, then list.                                           |\n| `/antigravity.models all`                    | Include tab/chat models normally hidden from the model list.                                     |\n| `/antigravity.image [--ratio 16:9] <prompt>` | Generate an image with the signed-in account and save it under `.pi/generated-images/`.          |\n| `/antigravity.doctor`                        | Show sanitized provider diagnostics, including the endpoint, status, and resolved runtime model. |\n\nAgents can also call the `generate_image` tool (same backend, `--path`-style `path` argument) when a task asks for generated imagery.\n\nModel availability, entitlement, quota groups, and resets are returned by the service and can differ by account. The quota percentage shown for a model can represent a shared pool, not a private per-model allowance.\n\n## Models and routing\n\nThe static model IDs registered by this extension match the Antigravity CLI catalog (`agy models`). Use `/antigravity.models` to see live availability and quota for your account — the table below is a reference for what each public model ID maps to.\n\nNew model families advertised by the backend are picked up automatically: on every session start (and via `/antigravity.models sync`) the extension fetches the live catalog and registers unknown runtime families as selectable models, deriving their thinking levels from the advertised tiers. The seven curated models below keep their hand-tuned routing; offline or on fetch failure the extension falls back to them.\n\n`agy models` advertises display entries across Gemini Flash (3.8, 3.7, 3.6, 3.5), Gemini Pro, Claude Sonnet/Opus Thinking, and GPT-OSS Medium. Pi collapses those into eight public model IDs, each showing only the thinking level(s) that model advertises.\n\n### Why Claude and GPT-OSS appear\n\nAntigravity / Cloud Code Assist exposes a multi-provider catalog. Depending on your account, its Google-authenticated API can advertise Google Gemini models alongside Claude models served through Anthropic Vertex and GPT-OSS served through OpenAI Vertex. This extension intentionally exposes those advertised Claude and GPT-OSS models through the single `antigravity` provider; they are not separate Pi providers and do not use a separate Anthropic or OpenAI login.\n\nThe backend's display labels do not always match its runtime IDs. For example, `gemini-3.5-flash-extra-low`, `gemini-3.5-flash-low`, and `gemini-3-flash-agent` can be displayed as Gemini 3.5 Flash Low, Medium, and High. Gemini 3.6 and 3.7 Flash use per-effort runtime IDs and send `thinkingLevel`; Gemini 3.5 Flash and 3.1 Pro send `thinkingBudget`.\n\n| Public model ID     | Input       | Thinking levels shown | Max output tokens | Request routing                                                                                    |\n| ------------------- | ----------- | --------------------- | ----------------- | -------------------------------------------------------------------------------------------------- |\n| `gemini-3.7-flash`  | Text, image | Low, Medium, High     | 65,536            | low → `gemini-3.7-flash-low`; medium → `gemini-3.7-flash-medium`; high → `gemini-3.7-flash-high`   |\n| `gemini-3.6-flash`  | Text, image | Low, Medium, High     | 65,536            | low → `gemini-3.6-flash-low`; medium → `gemini-3.6-flash-medium`; high → `gemini-3.6-flash-high`   |\n| `gemini-3.5-flash`  | Text, image | Low, Medium, High     | 65,536            | low → `gemini-3.5-flash-extra-low`; medium → `gemini-3.5-flash-low`; high → `gemini-3-flash-agent` |\n| `gemini-3.1-pro`    | Text, image | Low, High             | 65,535            | low → `gemini-3.1-pro-low`; high → `gemini-pro-agent`                                              |\n| `claude-sonnet-4-6` | Text, image | High                  | 64,000            | high → `claude-sonnet-4-6`                                                                         |\n| `claude-opus-4-6`   | Text, image | High                  | 64,000            | high → `claude-opus-4-6-thinking`                                                                  |\n| `gpt-oss-120b`      | Text        | Medium                | 32,768            | medium → `gpt-oss-120b-medium`                                                                     |\n\nTo limit which models Pi cycles through, enable specific entries in `~/.pi/agent/settings.json`:\n\n```json\n{\n  \"models\": {\n    \"antigravity/gemini-3.7-flash\": { \"enabled\": true },\n    \"antigravity/gemini-3.6-flash\": { \"enabled\": true },\n    \"antigravity/gemini-3.5-flash\": { \"enabled\": true },\n    \"antigravity/gemini-3.1-pro\": { \"enabled\": true },\n    \"antigravity/claude-sonnet-4-6\": { \"enabled\": true }\n  }\n}\n```\n\n## Configuration\n\nAll primary environment variables start with `ANTIGRAVITY_`. The legacy `NOAGY_` prefix is also accepted for compatibility.\n\n| Variable                               | Purpose                                                                                                                                                                                         |\n| -------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `ANTIGRAVITY_BASE_URL`                 | Override the API base URL. It must be HTTPS, contain no URL credentials, and target an allowed Google APIs host.                                                                                |\n| `ANTIGRAVITY_PROJECT_ID`               | Use a specific Cloud Code Assist project ID instead of discovery or the stable account fallback.                                                                                                |\n| `ANTIGRAVITY_ACCOUNTS`                 | How many account slots to register, 1–8 (default 3). See [Multiple accounts](#multiple-accounts).                                                                                               |\n| `ANTIGRAVITY_CALLBACK_HOST`            | Bind OAuth callback to `127.0.0.1`, `::1`, or `localhost` only. Defaults to `127.0.0.1`.                                                                                                        |\n| `ANTIGRAVITY_USER_AGENT`               | Override the request user-agent.                                                                                                                                                                |\n| `ANTIGRAVITY_RUNTIME_MODEL`            | Pin requests to a runtime model ID, bypassing normal static routing.                                                                                                                            |\n| `ANTIGRAVITY_CLIENT_ID`                | Use a custom Google OAuth client ID.                                                                                                                                                            |\n| `ANTIGRAVITY_CLIENT_SECRET`            | Use a custom Google OAuth client secret. Keep it out of source control and shell history.                                                                                                       |\n| `ANTIGRAVITY_NO_KEEPALIVE`             | Set to `1` to skip the keep-alive connection pool.                                                                                                                                              |\n| `ANTIGRAVITY_NO_PREWARM`               | Set to `1` to skip the TLS pre-warm request made when the extension loads.                                                                                                                      |\n| `ANTIGRAVITY_STATUS_SHOW_OPUS`         | Set to `1` or `true` to show Opus usage in the status bar (default `false`). Also configurable via `antigravity.statusShowOpus` in `~/.pi/agent/settings.json` or `.pi/settings.json`.          |\n| `ANTIGRAVITY_STATUS_SHOW_RESET`        | Set to `1` or `true` to append reset countdowns in the status bar (default `false`). Also configurable via `antigravity.statusShowReset` in `~/.pi/agent/settings.json` or `.pi/settings.json`. |\n| `ANTIGRAVITY_STREAM_HEADER_TIMEOUT_MS` | Abort a streaming request that has not returned response headers within this window (default `180000`; `0` disables).                                                                           |\n| `ANTIGRAVITY_STREAM_STALL_TIMEOUT_MS`  | Abort a streaming request whose body stops sending bytes for this long (default `120000`; `0` disables). A healthy stream keeps sending, so only genuine silence aborts.                        |\n\nBy default, the provider tries `https://daily-cloudcode-pa.googleapis.com`, then the sandbox host, then `https://cloudcode-pa.googleapis.com`. Prefer the built-in OAuth client unless you have a reason to use your own credentials.\n\n### Latency\n\nProvider requests reuse a keep-alive connection pool when the runtime supports it, so consecutive turns do not repeat the DNS, TCP, and TLS handshake. When `HTTP_PROXY`, `HTTPS_PROXY`, or `ALL_PROXY` is set, that pool is skipped so Pi's proxy-aware dispatcher is used instead. The connection is also opened when the extension loads so the first message of a session skips the handshake too. For the lowest time-to-first-token, pick a fast runtime: `gemini-3.7-flash` with reasoning off routes to `gemini-3.7-flash-low` at thinking level `LOW`. Setting `ANTIGRAVITY_PROJECT_ID` also removes the project-discovery round-trip when credentials do not already carry a project ID.\n\n## Troubleshooting\n\n- **No credentials / 401 / 403:** Run `/login antigravity` again, then check `/antigravity.doctor`.\n- **Remote/headless machine — browser can't reach `localhost:51121`:** The callback binds to loopback only, so a browser on another machine can't hit it. You have two options:\n  - **Paste (no extra setup):** Run `/login antigravity`, open the shown URL and complete Google sign-in in _any_ browser. When it redirects to `http://localhost:51121/oauth-callback?…` and fails to load, copy that full URL from the address bar and paste it into the prompt Pi shows. The code is single-use and expires quickly, so paste promptly.\n  - **SSH tunnel (reusable):** From the machine with the browser, run `ssh -N -L 51121:127.0.0.1:51121 <user>@<server>` and keep it open, then run `/login antigravity` on the server. The redirect to `localhost:51121` tunnels through to the local callback automatically.\n- **OAuth callback will not start:** Ensure port `51121` is free and `ANTIGRAVITY_CALLBACK_HOST` is a permitted loopback address.\n- **Model is unavailable:** Run `/antigravity.models`; availability is account- and service-dependent.\n- **A second account shows no models:** Run `/login antigravity-2` (or the slot you want) and check `/antigravity.account`. Slots with no credential deliberately register no models.\n- **Claude/GPT tool-call schema error:** Upgrade to the latest package release. The provider adapts Pi's JSON Schema tool definitions for the Cloud Code Assist custom-tool bridge.\n- **Quota or rate limit:** Run `/antigravity.usage`. A `429` response usually indicates quota or rate limiting; changing models may still draw from the same shared pool.\n- **Need a safe diagnostic:** `/antigravity.doctor` redacts recognized secrets from its error output. Still review output before sharing it publicly.\n\n## Development\n\nThis repo uses [Bun](https://bun.sh) for install, scripts, and CI. The published extension itself runs on Node (Pi's CLI).\n\n```bash\nbun install\nbun run check\n```\n\nThe package declares its Pi extension in `package.json` under `pi.extensions`. See the [Pi package documentation](https://pi.dev/docs/latest/packages) for package installation, manifest, and gallery conventions.\n\n## License\n\n[MIT](LICENSE)\n","readmeFilename":"README.md"}