Skip to content

Add Antigravity CLI provider#477

Open
zabrodsk wants to merge 3 commits into
robinebers:mainfrom
zabrodsk:antigravity-cli-provider
Open

Add Antigravity CLI provider#477
zabrodsk wants to merge 3 commits into
robinebers:mainfrom
zabrodsk:antigravity-cli-provider

Conversation

@zabrodsk
Copy link
Copy Markdown

@zabrodsk zabrodsk commented May 20, 2026

Summary

  • Add a separate antigravity-cli bundled provider for Google Antigravity CLI (agy)
  • Read CLI auth from macOS keychain service gemini, account antigravity, with raw, JSON, and go-keyring-base64: token support
  • Query Cloud Code quota endpoints and map model pools to Gemini Pro, Gemini Flash, and Claude
  • Document setup/data sources and add README supported-provider entry
  • Extend readGenericPassword(service, account?) host API docs and implementation for explicit account lookup

Testing

  • bun run test plugins/antigravity-cli/plugin.test.js
  • bun run test plugins

Notes

  • cargo/rustc are not installed in this shell, so I could not run a local Rust compile/test for the host API change.
  • No screenshots: provider-only change, no rendered UI layout change.

Summary by cubic

Adds the antigravity-cli provider to track Google Antigravity CLI (agy) Cloud Code quotas for Gemini Pro, Gemini Flash, and Claude. Extends the macOS keychain host API to support account-scoped reads, and hardens auth and request handling.

  • New Features

    • Bundled antigravity-cli provider calling loadCodeAssist, fetchAvailableModels, and retrieveUserQuota; maps model pools to Gemini Pro, Gemini Flash, and Claude; merges buckets by the lowest remaining.
    • Reads auth from macOS keychain service gemini, account antigravity; supports raw tokens, JSON, and go-keyring-base64:; no fallback to service-wide creds; only reads non-secret CLI context ~/.gemini/antigravity-cli/ and ignores legacy Gemini OAuth files.
    • Extended host API to host.keychain.readGenericPassword(service, account?) with account-level lookup and updated docs; added plugin docs, icon, and tests.
  • Bug Fixes

    • Hardened HTTP/auth flow: 15s timeouts, auth failure detection shows the agy login message, and clearer network/HTTP/invalid JSON errors.
    • Fallback to retrieveUserQuota when fetchAvailableModels lacks quotas; shows a "No quota data" badge when none are available.

Written for commit 942ee60. Summary will update on new commits. Review in cubic

Copilot AI review requested due to automatic review settings May 20, 2026 21:06
@zabrodsk zabrodsk requested a review from davidarny as a code owner May 20, 2026 21:06
@github-actions github-actions Bot added rust Pull requests that update rust code plugin docs labels May 20, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new bundled antigravity-cli provider plugin to track Google Antigravity CLI (agy) quota usage via Cloud Code quota endpoints, along with documentation updates and a small macOS keychain host API enhancement to support account-scoped lookups.

Changes:

  • Add plugins/antigravity-cli bundled plugin (manifest, implementation, icon) plus Vitest coverage.
  • Add user-facing documentation for setup/data sources and link it from the main README.
  • Extend host.keychain.readGenericPassword(service, account?) to support explicit account scoping, and document the new signature.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src-tauri/src/plugin_engine/host_api.rs Adds optional account parameter to readGenericPassword and scopes the security find-generic-password call accordingly.
README.md Adds Antigravity CLI to the supported providers list.
plugins/antigravity-cli/README.md Documents plugin-specific setup/auth expectations and data sources.
plugins/antigravity-cli/plugin.test.js Adds unit tests for keychain token parsing and quota parsing/fallback behaviors.
plugins/antigravity-cli/plugin.json Adds plugin manifest (id/name/icon/overview lines).
plugins/antigravity-cli/plugin.js Implements keychain token extraction + quota endpoint querying and mapping to overview lines.
plugins/antigravity-cli/icon.svg Adds provider icon asset.
docs/providers/antigravity-cli.md Adds provider documentation page.
docs/plugins/api.md Updates keychain API docs to include the optional account parameter.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread plugins/antigravity-cli/plugin.js Outdated
Comment on lines +120 to +139
var resp = request({
method: "POST",
url: url,
headers: {
Authorization: "Bearer " + token,
Accept: "application/json",
"Content-Type": "application/json",
"User-Agent": "agy",
},
bodyText: JSON.stringify(body || {}),
timeoutMs: 15000,
})
if (ctx.util.isAuthStatus(resp.status)) {
throw LOGIN_MESSAGE
}
if (resp.status < 200 || resp.status >= 300) {
throw "Antigravity CLI quota request failed (HTTP " + String(resp.status) + "). Try again later."
}
var data = ctx.util.tryParseJson(resp.bodyText)
return data && typeof data === "object" ? data : null
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 9 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread plugins/antigravity-cli/plugin.js Outdated
@zabrodsk
Copy link
Copy Markdown
Author

@copilot check latest commit

@robinebers
Copy link
Copy Markdown
Owner

Thank you @zabrodsk - I don't use Antigravity. Could you explain how this is different from the existing plugin? They renamed the CLI geminiagy or something right?

@robinebers robinebers linked an issue May 22, 2026 that may be closed by this pull request
5 tasks
@zabrodsk
Copy link
Copy Markdown
Author

Yeah, the naming is confusing.

This PR is for the new Antigravity CLI, the agy command. It’s separate from the existing Antigravity plugin, which tracks the desktop/IDE-style app
through the local language server.

The CLI seems to work more like a terminal client: it stores its own state under ~/.gemini/antigravity-cli/, uses the OS keychain for auth, and
talks to the Cloud Code quota endpoints directly. So it doesn’t fit cleanly into the existing Antigravity plugin, which is mostly built around
probing a running local app process.

My understanding is that Gemini CLI is transitioning toward agy, but I didn’t want to replace or change the existing Gemini provider because people
may still have Gemini CLI installed (it's not deprecated yet), and the auth/config paths are different. So this adds antigravity-cli as its own provider instead of trying to
merge it into either gemini or antigravity.

So short version: existing antigravity = app/IDE path, existing gemini = Gemini CLI path, this PR = new agy / Antigravity CLI path.
I considered merging it with the existing Antigravity provider, especially because the quota pools are probably shared at the account/model level.

The reason I kept it separate is that the data path is totally different. The existing Antigravity provider is app/IDE-oriented: it looks for a
running local language server and can use the app’s local OAuth/SQLite fallback. The CLI does not seem to expose that same local process path. It has
its own config directory, keychain auth, and calls the Cloud Code quota endpoints directly.

@validatedev
Copy link
Copy Markdown
Collaborator

I feel like we should consolidate everything into one Antigravity and use IDE -> App -> CLI fallbacks to gather the data since they share the same quota.
Gemini should stay for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs plugin rust Pull requests that update rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Antigravity CLI plugin support (Google IO 2026)

4 participants