pi-antigravity
v0.15.0
Published
Personal Antigravity / Cloud Code Assist provider for Pi Coding Agent
Maintainers
Readme
pi-antigravity
pi-antigravity is a Pi Coding Agent 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.
Using OpenCode instead of Pi? Install the companion plugin @rahularya01/opencode-antigravity.
Want to equip Pi with MCP, web access, subagents, and todos? Install pi-essentials (currently in beta), an all-in-one companion extension designed for Pi.
[!WARNING] Unofficial integration & Terms of Service risk. This project is not affiliated with or endorsed by Google. Section 6 of the Google Antigravity Additional Terms of Service prohibits using third-party software, tools, or harnesses to access consumer Antigravity OAuth endpoints, and Google has suspended or disabled consumer accounts for doing so (see #154). Use this extension at your own risk only with accounts and services you are authorized to access, review the source before granting OAuth permissions, and consider the official
agyCLI or a licensed Gemini Enterprise setup if account compliance is required.
Contents
- Requirements
- Install
- Quick start
- Authentication and credential safety
- Commands
- Tools
- Models and routing
- Configuration
- Troubleshooting
- Development
Requirements
- Node 22.19.0 or later
- Pi Coding Agent and Pi AI version 0.80.0 or later
- A Google account that can use the relevant Cloud Code Assist / Antigravity services
- 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).
Install
Install from npm:
pi install npm:pi-antigravityOr install the latest repository version:
pi install git:github.com/Rahularya01/pi-antigravityOn Oh My Pi, install the same package with omp plugin install npm:pi-antigravity.
Restart Pi (or run /reload) after installation. To update the npm package later, use pi update npm:pi-antigravity.
Quick start
Start Pi and run
/login antigravity.Complete Google sign-in in your browser.
Select a model, for example:
/model antigravity/gemini-3.8-flashStart working. If a request fails, run
/antigravity.doctorfor sanitized diagnostics.
To link another account without losing the existing one, run /login antigravity
again and complete Google sign-in with the other account. Manage linked accounts with:
/antigravity.accounts
/antigravity.accounts switch <index|email>
/antigravity.accounts remove <index|email>On a hard quota wall (HTTP 429 with a reset hint), the provider automatically tries the next linked account.
Authentication and credential safety
The provider uses the OAuth 2.0 Authorization Code flow with PKCE, so credentials are only ever exchanged with Google — never typed into Pi.
/login antigravityopens Google sign-in and starts a temporary callback listener athttp://localhost:51121/oauth-callback.- 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). - Pi refreshes access tokens automatically when they expire — you shouldn't need to sign in again unless a token is revoked.
- Successful logins and token rotations are also kept in
~/.pi/agent/antigravity-accounts.jsonwith owner-only permissions so linked accounts can be switched without re-authenticating. - Access is quota-backed by the signed-in Google account rather than billed per token, so Pi marks Antigravity models as subscription-backed (
(sub)in the footer); any cost Pi shows for them is a catalog estimate.
The callback listener binds only to a loopback host, so it isn't reachable from outside your machine. The auth and account files it writes to contain sensitive access and refresh tokens: do not commit them, paste them into issues, or share their contents.
Signing in requests these Google OAuth scopes:
| Scope | Why it's needed |
| --- | --- |
| aicode | Access to the Cloud Code Assist / Antigravity model catalog and endpoints |
| cloud-platform | General Cloud Code Assist API access |
| userinfo.email, userinfo.profile | Identify the signed-in Google account |
| cclog | Cloud Code Assist logging/telemetry endpoints used by the API |
| experimentsandconfigs | Server-side experiment and config flags for the API |
Review these permissions before approving access. If your credentials expire or are revoked, just re-run /login antigravity to sign in again.
Commands
| Command | Description |
| --- | --- |
| /login antigravity | Sign in to Google and configure the provider. |
| /model antigravity/<model-id> | Choose a registered Antigravity model. |
| /antigravity.usage | Show the server-reported shared quota groups and reset times. |
| /antigravity.models | List available runtime models, remaining shared-pool quota, and capabilities. |
| /antigravity.accounts | List linked accounts; use switch or remove with an index or email to manage them. |
| /antigravity.credits [on\|off] | Check or toggle automatic fallback to AI credits when standard quotas are exhausted. |
| /antigravity.models all | Include tab/chat models normally hidden from the model list. |
| /antigravity.refresh | Force refresh the dynamic model catalog from Antigravity. |
| /antigravity.doctor | Show sanitized provider diagnostics, including the endpoint, status, and resolved runtime model. |
| /antigravity.image <prompt> | Generate an image via Antigravity and save it under .pi/generated-images/. Optional --ratio 16:9, --model, --path. |
| /antigravity.search <query> | Search the web using Google Search Grounding via Antigravity. Optional --thinking, --url <url>. |
| /antigravity.fetch <url> | Read a public web page through the Antigravity fetch service and print it as markdown. Optional --raw keeps the crawled source. |
Model 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.
Tools
Image generation
The extension registers a generate_image tool the model can call. Images are written inside the project directory (default .pi/generated-images/). Image generation defaults to gemini-3.1-flash-image; model availability is account-dependent. Requests use the direct image endpoint, with the legacy streaming endpoint tried on HTTP 404. Existing model and endpoint fallbacks remain available.
The generate_image tool accepts an optional referenceImages array of project-relative paths. Reference images are sent to Google alongside the prompt; only include images you intend to upload. PNG, JPEG, WebP, and GIF are supported, with MIME types detected from file contents. Each reference must be at most 10 MB, and at most four references are sent. Paths must remain inside the working directory, including symlink targets. For example:
{
"prompt": "Design a deep bowl using the colors and artwork in these references",
"referenceImages": ["references/oatmeal.png", "references/plate.jpg"],
"path": "designs/bowl.png"
}Omit referenceImages (or pass []) for text-only generation. /antigravity.image remains text-only; reference paths are supported by the tool, not the slash command.
Search
The google_search tool allows models to perform real-time web search and URL analysis using Google Search Grounding over Cloud Code Assist. The default model is gemini-3.5-flash-lite (fallbacks: gemini-3.1-flash-lite, gemini-3-flash) and the default reply is a short evidence brief. It supports optional lead agent directives (instruction), specific target URLs (urls), and deep reasoning (thinking: true or /antigravity.search --thinking).
Read a page
Use the reader when you already know the page URL; use google_search to find sources. The answer is Google's crawled copy and can be stale or incomplete. For login pages, interactive applications, and unsupported formats, use a browser or another permitted local tool. Check /antigravity.doctor after a failed or degraded read. The reader guarantees map its limits to offline regression checks.
The read_url_content tool reads public pages. Fetching runs through Google's Cloud Code Assist endpoints, so the machine never contacts the target site. The character budget covers returned text and serialized details; small budgets may omit older attempt details, with an explicit omission count. /antigravity.doctor retains the bounded retrieval history. The tool resolves redirects with v1internal:rewriteUri, reads v1internal:fetchFromTrawlerCache, and retries with liveFetch: true when the cache is missing, clearly cut off, empty, or suspected to contain only a shell or access wall. A shared 10-second network deadline bounds redirects, endpoint failover, and recovery; useful content is retained if the deadline expires or recovery fails. Short readable fragments with unknown completeness do not trigger a retry. Endpoint failover is limited to transport failures; a read makes at most ten Google requests and tries at most one publisher representation URL. HTML conversion accepts at most 2,000,000 characters, 50,000 markup tokens, and 128 nested elements. More complex pages are not converted; Google's HTML is saved to a temp file instead.
Before converting HTML to Markdown, the tool reads page metadata, bounded JSON-LD matched to the article, and advertised alternate representations. If cache and live results are inadequate, it tries at most one same-origin Markdown or supported article-JSON representation, preferring the page language and then Markdown; a mismatched-language fallback updates the reported language and retrieval outcome. JSON recovery supports GitHub Docs article bodies and WordPress single-post responses with matching article identity. Inadequate MDN copies can use the publisher's same-origin index.json representation within the same one-representation budget. Cut-off Wikipedia articles use Wikipedia's parse API for the same article, and cut-off raw.githubusercontent.com files use the full line list from the matching GitHub file page; both are used only when they name the requested article or file. Wikipedia titles are matched the way MediaWiki does (first letter capitalized, redirects followed); revisions, queries, and special pages are not recovered. These copies are tried even when Google cannot serve the original URL. MDN's JSON may supply a canonical article URL within the same origin and locale's /docs/ prefix; results report that redirect. Recovery requires verified publisher identity and complete supported article sections; if Google cuts only the later sidebar JSON, the source is still reported as incomplete. Unknown section types or a cut-off article body are not silently repaired. Results report the article URL, any alternate representation URL, retrieval attempts, and available title, author, publication date, modification date, and language. Structured data is parsed, never executed.
Conversion keeps headings, lists, links, code blocks, and data tables. Table grids are limited to 10,000 cells per page; nested or oversized grids are flattened without expanding their spans. It removes navigation and hidden decorations (a block named like chrome, such as sidebar or menu, is kept when it holds the article or most of the page's text), then selects a substantive <main>, role="main", or <article> region, skipping empty placeholders. Source completeness, suspected content problems, and our own output truncation are reported separately. A closed HTML document is not proof that Google supplied the entire article. Empty results do not establish that the page requires JavaScript: Google's response may be cut off, blocked, or a shell.
Output is capped by ANTIGRAVITY_WEB_FETCH_MAX_CHARS (default 60000), including the provenance header and saved-page footer. A long URL is elided inside the header so provenance cannot take the page's share of the budget away. Page-controlled metadata is stripped of line breaks and bounded before it reaches the header. When a page does not fit, the tool returns its beginning and saves the full Markdown, with the provenance header, to a private temp file (pi-url-*/page.md, mode 0600), the same way Pi saves long tool output. The answer ends with the file path, and details.fullOutputPath holds it; the agent reads or searches that file instead of fetching again. Pages beyond the conversion limits are refused, and Google's unconverted HTML is saved to page.html for searching. Raw mode is not bound by those limits: it returns the crawled source as it is, so the page's size limits the answer, not the read. A raw page that does not fit is saved as the source alone, without the provenance header. If a page cannot be saved (for example, the temp directory is not writable), the answer says so and still shows the beginning. Temp files are not deleted automatically. Service responses over 5 MB are refused before parsing. A live 401/403 or other recovery failure keeps an already usable cached copy.
/antigravity.fetch [--raw] <url> exposes the same fetch interactively. Raw mode preserves the requested page's crawled source and does not substitute alternate representations. Literal private/local addresses, local hostnames, non-HTTP URLs, and URLs with embedded username/password are refused. Known sensitive query and fragment values, and token-shaped values, are redacted from provenance, progress messages, and errors, but remain part of the request sent to the fetch service. DNS names are resolved by Google's service rather than locally, so this check is a filter for obvious local/private targets, not a guarantee against every name that resolves internally. The service resolves the initial redirect chain, so local validation sees the final URI it reports rather than every remote hop: a final URI that names a private or local address fails closed and aborts the read, while a malformed one is ignored and the requested page is read. Explicit non-HTTP or credential-bearing redirects are refused. PDF URLs, PDF content types, and line-start PDF signatures within the first 1024 characters fail with guidance to download the URL directly and read the local file with an available PDF reader, subject to normal permissions. Alternate .pdf links are ignored rather than substituted. The tool itself does not download or extract PDFs. This remains a best-effort Google crawler tool, without a local HTTP or browser fallback, cookies, or login support.
Native image API
On Pi versions that support mixed-operation provider registration (type: "image" and images handlers), Antigravity exposes gemini-3.1-flash-image to codemode and ctx.modelRegistry.generateImages(). Older Pi versions can continue using the existing image tool and command; the native API is not available there.
const model = await models.getModelOfType("image", "antigravity", "gemini-3.1-flash-image");
const result = await models.generateImages(model, {
input: [{ type: "text", text: "A red square on white" }],
});
if (result.stopReason !== "stop") return result.errorMessage;
for (const block of result.output) if (block.type === "image") image(block);The native API returns in-memory image/text blocks and does not save files. Input image blocks are accepted without local path loading. Extensions can pass metadata: { aspectRatio: "16:9" } through image options. Credentials are resolved by Pi. Backend usage is not currently reported by this adapter.
Models and routing
After you sign in, the provider refreshes its catalog from Antigravity (fetchAvailableModels) and groups runtime thinking variants into public Pi model IDs. Newly enabled models — for example Gemini 4 Argon or Gemini 4 Hydrogen — become selectable after that refresh without waiting for an extension release. A last-known-good cache is kept for offline/cold start; the static table below is only the conservative fallback and a routing reference.
Gemini 4 Argon is advertised only when the client version is current and the account is entitled. After upgrading, run /antigravity.refresh (or start any session; print mode refreshes before the prompt) and select antigravity/gemini-4-argon. Updating the client version does not grant entitlement. Headless pi -p resolves --model before extensions run, so the first invocation after an upgrade can still print Using custom model id; the request is routed from the refreshed catalog, and the next invocation reads the persisted list.
Long sessions that switch providers are the highest-risk setup for tool-observation mimicry on Gemini 3.x. Foreign tool calls are flattened into [Observation from ...] text, and a model can imitate those logs instead of making a real tool call. Finish a task on one provider before switching.
A tier that answers with a generic resource-exhausted error is retried on the other Antigravity endpoints and then on a sibling tier of the same generation (-low can move to -high or -medium). The live fallback (runtimeModel, endpoint) is cached per account for 10 minutes so later turns skip dead-tier hops and keep prompt cache warm. A hard quota message that includes a reset time does not do this. When every endpoint and tier answers with a load-shaped refusal — generic 429 RESOURCE_EXHAUSTED, or 503 No capacity available — the whole set is retried on an abort-aware backoff ladder (3 s, 8 s, 15 s, 25 s by default) before the turn fails. ANTIGRAVITY_CAPACITY_BACKOFF_MS and ANTIGRAVITY_CAPACITY_ATTEMPTS resize that ladder.
A successful refresh replaces the catalog with advertised models and routes, removing entries absent from all responding endpoints. Live capabilities and token limits override static defaults; grouped variants use the smallest advertised limits. Known thinking variants such as gemini-4-hydrogen-low / -medium / -high / -xhigh become one public model. Unfamiliar suffixes and opaque IDs stay usable as exact runtime IDs when they pass the catalog filters.
Use /antigravity.refresh to bypass the four-hour cache, or /antigravity.models to view live availability and quota. Account/project changes and older cache formats trigger discovery on the next network-enabled refresh. Failed or unrecognized responses keep the last-known-good catalog; forced refreshes report the error. Arbitrary API schema changes can still require an extension update. ANTIGRAVITY_USER_AGENT overrides the default client fingerprint when a newer CLI version is required.
Why Claude and GPT-OSS appear
Antigravity / 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.
The 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. All supported models send integer thinkingBudget (Gemini 3.8/3.7/3.6: -1/4000/1000/0, Gemini 3.5: 10000/4000/1000/0, Gemini 3.1 Pro: 10001/1001/0, Claude: 1024/0, GPT-OSS: 8192/0) matching the official Antigravity CLI wire format.
| Public model ID | Input | Thinking levels shown | Max output tokens | Request routing |
| --- | --- | --- | --- | --- |
| gemini-3.8-flash | Text, image | Low, Medium, High | 65,536 | low → gemini-3.8-flash-low; medium → gemini-3.8-flash-medium; high → gemini-3.8-flash-high |
| 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 |
| 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 |
| 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 |
| gemini-3.1-pro | Text, image | Low, High | 65,535 | low → gemini-3.1-pro-low; high → gemini-pro-agent |
| claude-sonnet-4-6 | Text, image | High | 64,000 | high → claude-sonnet-4-6 |
| claude-opus-4-6 | Text, image | High | 64,000 | high → claude-opus-4-6-thinking |
| gpt-oss-120b | Text | Medium | 32,768 | medium → gpt-oss-120b-medium |
To limit which models Pi cycles through, enable specific entries in ~/.pi/agent/settings.json:
{
"models": {
"antigravity/gemini-3.8-flash": { "enabled": true },
"antigravity/gemini-3.7-flash": { "enabled": true },
"antigravity/gemini-3.6-flash": { "enabled": true },
"antigravity/gemini-3.5-flash": { "enabled": true },
"antigravity/gemini-3.1-pro": { "enabled": true },
"antigravity/claude-sonnet-4-6": { "enabled": true }
}
}Configuration
All primary environment variables start with ANTIGRAVITY_. The legacy NOAGY_ prefix is also accepted for compatibility.
| Variable | Purpose |
| --- | --- |
| ANTIGRAVITY_BASE_URL | Override the API base URL. It must be HTTPS, contain no URL credentials, and target an allowed Google APIs host. Ignored for inference once Gemini Enterprise routing is active. |
| ANTIGRAVITY_LOCATION | eu, us, or global. eu and us send inference only to businessaicode.<location>.rep.googleapis.com and never fall back to the consumer cloudcode-pa hosts. Also read from ~/.gemini/antigravity-cli/settings.json when that file stores location. |
| ANTIGRAVITY_ENTERPRISE | Set to 1 to force Gemini Enterprise routing, including global (businessaicode.googleapis.com). |
| ANTIGRAVITY_ENTERPRISE_PROJECT | Google Cloud project id for the selected Gemini Enterprise license. Required when enterprise routing is on. Also read from the CLI settings project / projectId. |
| ANTIGRAVITY_USER_TIER | License tier id required with enterprise routing. Also read from the CLI settings userTier. |
| ANTIGRAVITY_PROJECT_ID | Use a specific Cloud Code Assist project ID instead of discovery or the stable account fallback. |
| ANTIGRAVITY_CALLBACK_HOST | Bind OAuth callback to 127.0.0.1, ::1, or localhost only. Defaults to 127.0.0.1. |
| ANTIGRAVITY_USER_AGENT | Override the request user-agent. |
| ANTIGRAVITY_RUNTIME_MODEL | Pin requests to a runtime model ID, bypassing discovered/fallback routing. |
| ANTIGRAVITY_CATALOG_REFRESH_INTERVAL_MS | Override catalog refresh TTL in ms. Defaults to 4 hours (14400000). Set to 0 to always refresh. |
| ANTIGRAVITY_CLIENT_ID | Use a custom Google OAuth client ID. |
| ANTIGRAVITY_CLIENT_SECRET | Use a custom Google OAuth client secret. Keep it out of source control and shell history. |
| ANTIGRAVITY_STREAM_STALL_TIMEOUT_MS | Maximum silence between stream chunks; default 300000 ms. Set 0 to disable. |
| ANTIGRAVITY_CAPACITY_BACKOFF_MS | Comma-separated backoff steps in ms for load-shaped refusals (generic 429, 503 No capacity available); default 3000,8000,15000,25000. Invalid entries are ignored. |
| ANTIGRAVITY_CAPACITY_ATTEMPTS | Total attempts across the capacity ladder, 1–10; defaults to the number of backoff steps plus one. |
| ANTIGRAVITY_STREAM_HEADER_TIMEOUT_MS | Response-header deadline; default 180000 ms. Set 0 to disable. |
| ANTIGRAVITY_NO_KEEPALIVE | Set to 1 to skip the keep-alive connection pool. |
| ANTIGRAVITY_NO_PREWARM | Set to 1 to skip the TLS pre-warm request made on the first Antigravity request. |
| ANTIGRAVITY_INLINE_SYSTEM | 1 / true / on forces folding the system prompt into the first user turn; 0 / false / off keeps wire-native systemInstruction; unset folds automatically whenever the assembled system parts exceed 126 characters (also honors ANTIGRAVITY_PROMPT_GUARD=off). |
| ANTIGRAVITY_NO_EXTRA_TOOLS | Set to 1 to stop registering the model-facing google_search, read_url_content, and generate_image tools. The /antigravity.search, /antigravity.fetch, and /antigravity.image commands stay available. |
| ANTIGRAVITY_USE_CREDITS | Set to 1 (or 0) to explicitly enable (or disable) automatic AI credit overages when standard quota is depleted. Defaults to inheriting useG1Credits from ~/.gemini/antigravity-cli/settings.json only when that file sets the flag. Otherwise credit overages stay off. |
| ANTIGRAVITY_NO_SEARCH_TOOL | Set to 1 to skip only the google_search tool, e.g. when another extension provides web search. |
| ANTIGRAVITY_NO_FETCH_TOOL | Set to 1 to skip only the read_url_content tool, e.g. when another extension already fetches URLs. |
| ANTIGRAVITY_NO_IMAGE_TOOL | Set to 1 to skip only the generate_image tool. |
| ANTIGRAVITY_WEB_FETCH_MAX_CHARS | Character budget for one read_url_content result. Defaults to 60000, roughly 15k tokens. |
| ANTIGRAVITY_DEFER_TOOLS | Set to 1 to register google_search, read_url_content, and generate_image as deferred: they aren't declared to the model, but codemode scripts can call them and tool_search can load them. Needs codemode or tool_search active, e.g. "defaultTools": ["+codemode"]. Requires Pi 0.99.2+; older Pi keeps them direct. |
pi config can disable each model-facing tool without disabling the provider. The package loads four extension resources: src/index.ts (provider, OAuth, and slash commands), src/features/google-search.ts (google_search), src/features/read-url-content.ts (read_url_content), and src/features/generate-image.ts (generate_image). Turn off a feature resource there to stop registering that tool. /antigravity.search, /antigravity.fetch, and /antigravity.image stay available from the provider extension.
Environment variables still force a loaded tool off, including in scripts and headless runs. They cannot turn a resource back on after pi config disables it, because that file is not loaded. Either control is enough to hide the tool from the model. Run /reload after changing pi config.
By default, the provider tries https://daily-cloudcode-pa.googleapis.com and then https://cloudcode-pa.googleapis.com. Prefer the built-in OAuth client unless you have a reason to use your own credentials.
System prompt placement
Requests normally send short system prompts in the wire-native request.systemInstruction field. Some consumer endpoints reject systemInstruction exceeding 126 characters (whether in one part or split across multiple parts) with a generic 429 RESOURCE_EXHAUSTED, regardless of wording, while accepting the same text inside contents at any length.
All assembled system parts (including extracted Skill blocks) are measured together. Whenever the total exceeds 126 characters, buildRequest() automatically folds the system prompt into the first user turn and omits systemInstruction. Tool declarations, thinking config, and multi-turn conversion are unaffected.
ANTIGRAVITY_INLINE_SYSTEM overrides the automatic decision: 1 (or true / on) forces folding even for short prompts, while 0 (or false / off, or ANTIGRAVITY_PROMPT_GUARD=off) keeps wire-native systemInstruction (with Pi / Pi-Bolt opener and <docs> phrase sanitization still applied).
Latency
Provider 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 opened on the first Antigravity request rather than at Pi startup, so other extensions are not stalled by an unauthenticated handshake. For the lowest time-to-first-token, pick a fast runtime: gemini-3.8-flash with reasoning off routes to gemini-3.8-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.
Troubleshooting
- No credentials / 401 / 403: Run
/login antigravityagain, then check/antigravity.doctor. - 403
VALIDATION_REQUIRED/ "Verify your account": Open theaccounts.google.comlink in the error, in a browser signed in to the same Google account, and finish verification. Re-login alone does not clear it./antigravity.doctoromits that link because it carries session parameters. - 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:- Paste (no extra setup): Run
/login antigravity, open the shown URL and complete Google sign-in in any browser. When it redirects tohttp://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. - 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 antigravityon the server. The redirect tolocalhost:51121tunnels through to the local callback automatically.
- Paste (no extra setup): Run
- OAuth callback will not start: Ensure port
51121is free andANTIGRAVITY_CALLBACK_HOSTis a permitted loopback address. - Model is unavailable: Run
/antigravity.refresh, then select a model from the updated list. Availability is account- and service-dependent; a generic resource-exhausted response alone does not prove a model was retired. Discovery uses the backend's recommended model list when supplied, since the raw catalog can retain old runtime IDs. If a resumed session selects a model removed by discovery, select another model; static routes and compatibility fallbacks do not restore models absent from the refreshed catalog. - 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.
- Quota or rate limit: Run
/antigravity.usage. A429response usually indicates quota or rate limiting; changing models may still draw from the same shared pool. - Need a safe diagnostic:
/antigravity.doctorredacts recognized secrets from its error output. Still review output before sharing it publicly. - Oh My Pi says
registerApiProvideris not exported: Upgrade to 0.8.1 or later. Older builds statically import a Pi compat export that Oh My Pi's bundled runtime does not provide. The provider still registers throughpi.registerProvideron that host.
Development
This repo uses Yarn 4 via Corepack for install, scripts, and CI. The published extension itself runs on Node (Pi's CLI).
corepack enable
yarn install --immutable
yarn checkFor an optional live fetch check, run yarn smoke:fetch after /login antigravity. It exercises the registered tool on three public URLs and checks that reading a saved page needs neither network nor credentials. Missing expected page text is a failure unless explicit retrieval failures explain a degraded copy, which is an upstream-availability warning. An unobserved MDN canonical alias is also a warning; when that alias is observed, redirect provenance is checked. It uses saved Pi credentials (PI_AUTH_PATH can select another auth file), leaves saved pages in the temp directory, and is excluded from yarn check and default CI. Exit codes: 0 for successful coverage, 1 for integration failures, 2 when upstream availability limits coverage, no page passes, or no saved page can be checked.
Installs are hardened against common supply-chain attacks: lifecycle scripts are off, lockfile checksums must match the npm registry, and package versions younger than three days are rejected. Do not add a second registry or enable enableScripts without a review.
The package declares its Pi extension in package.json under pi.extensions. See the Pi package documentation for package installation, manifest, and gallery conventions.
Support the project
If pi-antigravity is useful to you, consider sponsoring the project on GitHub.
