CodexBar icon indicating copy to clipboard operation
CodexBar copied to clipboard

Support Google Antigravity CLI usage limits

Open erseco opened this issue 6 months ago • 7 comments

Summary

Please consider adding support for Google Antigravity CLI usage limits in CodexBar.

Google has introduced Antigravity CLI as the lightweight terminal interface for invoking, monitoring, and interacting with Antigravity agents. Google also announced that Gemini CLI is being transitioned to Antigravity CLI for individual users, with Gemini CLI / Gemini Code Assist for individuals stopping service on June 18, 2026.

Why this matters

CodexBar already tracks quota / usage visibility for many AI coding providers. As Gemini CLI users migrate to Antigravity CLI, it would be useful to surface Antigravity limits, remaining quota, and reset windows in the menu bar as well.

Useful links

  • Google Antigravity CLI introduction: https://antigravity.google/blog/introducing-google-antigravity-cli
  • Getting started with Antigravity CLI: https://antigravity.google/docs/cli-getting-started
  • Google Developers Blog: transitioning Gemini CLI to Antigravity CLI: https://developers.googleblog.com/an-important-update-transitioning-gemini-cli-to-antigravity-cli/
  • Google Antigravity site: https://antigravity.google/

Possible implementation notes

I do not know yet whether Antigravity CLI exposes a local usage endpoint, a config/cache file, or an API suitable for CodexBar integration. A first step could be to inspect where Antigravity CLI stores auth/session and usage metadata, then map it similarly to the existing provider integrations.

Potentially useful data to expose:

  • Current Antigravity CLI plan / account status
  • Remaining quota or rate-limit buckets, if exposed
  • Reset time / countdown
  • Separate display from Gemini CLI, since Google is moving individual users toward Antigravity CLI

Acceptance criteria

  • CodexBar can show Antigravity CLI usage/limits when available.
  • The provider can be enabled/disabled independently.
  • The UI makes clear that this is Antigravity CLI, not the legacy Gemini CLI integration.
  • Missing or unavailable quota data fails gracefully.

erseco avatar May 27 '26 04:05 erseco

Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed May 27, 2026, 1:05 AM ET / 05:05 UTC.

Summary Keep open: current main and v0.29.1 already have Antigravity local IDE and OAuth quota support, but the code/docs do not prove support for the new Antigravity CLI credential/session surface, and the repository profile calls for conservative non-closure.

Reproducibility: not applicable. this is a provider feature request, not a report of broken current behavior. Source inspection shows existing Antigravity quota support, but not a failing current-main reproduction path for the new CLI-specific source.

Ways to help us reproduce this

  • Add a screenshot or short recording showing the behavior.
  • Add expected vs actual behavior.
  • Include redacted logs or terminal output.

Next step Maintainer review should decide whether the new Antigravity CLI has a distinct supported quota/auth surface beyond the shipped Antigravity local/OAuth provider.

Review details

Best possible solution:

Fold any real Antigravity CLI credential or quota discovery into the existing Antigravity provider/source strategy after maintainer sign-off on auth and privacy, reusing the current quota mapping and tests.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this is a provider feature request, not a report of broken current behavior. Source inspection shows existing Antigravity quota support, but not a failing current-main reproduction path for the new CLI-specific source.

Is this the best way to solve the issue?

Unclear for implementation: existing local IDE and OAuth support already covers much of Antigravity quota display, but a CLI-specific source should only be added if the new CLI exposes data not already covered.

AGENTS.md: found and applied where relevant.

Remaining risk / open question:

  • A new CLI-specific path could duplicate the existing Antigravity local/OAuth provider behavior unless the Antigravity CLI exposes data that current sources cannot cover.
  • The requested CLI auth/session storage and quota API are not confirmed in the issue, and VISION.md treats provider auth, data storage, and privacy changes as sign-off work.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 589b77ca83a3.

Label changes

Label changes:

  • add P2: This is a normal provider-coverage improvement with limited blast radius but meaningful value for users migrating from Gemini CLI.
  • add impact:auth-provider: The remaining work is about provider support and likely Antigravity CLI auth/session or credential discovery.
  • add issue-rating: 🌊 off-meta tidepool: Current issue advisory state selects this label.
  • add clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.
  • add clawsweeper:needs-maintainer-review: Current issue advisory state selects this label.
  • add clawsweeper:needs-product-decision: Current issue advisory state selects this label.

Label justifications:

  • P2: This is a normal provider-coverage improvement with limited blast radius but meaningful value for users migrating from Gemini CLI.
  • impact:auth-provider: The remaining work is about provider support and likely Antigravity CLI auth/session or credential discovery.
Evidence reviewed

What I checked:

Likely related people:

  • steipete: Recent Antigravity fixes and related issue cleanup point to this person for provider behavior and release decisions. (role: recent area contributor and related issue closer; confidence: high; commits: 2e4cb422bf0a, 7e78f3d3800e, a541828ac0f1; files: Sources/CodexBarCore/Providers/Antigravity/AntigravityRemoteUsageFetcher.swift, Sources/CodexBarCore/Providers/Antigravity/AntigravityStatusProbe.swift, CHANGELOG.md)
  • abnormal749: The changelog credits this handle for the merged work that added OAuth-backed Antigravity remote usage, and git history shows that commit created the fetcher and tests. (role: remote OAuth feature introducer; confidence: medium; commits: e98c8f5e4c0d; files: Sources/CodexBarCore/Providers/Antigravity/AntigravityRemoteUsageFetcher.swift, Sources/CodexBar/Providers/Antigravity/AntigravityLoginRunner.swift, Tests/CodexBarTests/AntigravityRemoteUsageFetcherTests.swift)
  • Larry Hao: Added Antigravity account switching and token-account coverage on top of the OAuth usage path. (role: account switching contributor; confidence: medium; commits: a15df5ca5964; files: Sources/CodexBar/Providers/Antigravity/AntigravitySettingsStore.swift, Sources/CodexBarCore/Providers/Antigravity/AntigravityRemoteUsageFetcher.swift, docs/antigravity.md)
  • guhyun9454: Recently changed Antigravity per-model quota windows, which is adjacent to any CLI quota display work. (role: recent quota display contributor; confidence: medium; commits: 352f0b19cfb5; files: Sources/CodexBar/MenuCardView.swift, Sources/CodexBarCore/Providers/Antigravity/AntigravityStatusProbe.swift, Tests/CodexBarTests/MenuCardAntigravityTests.swift)
How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

clawsweeper[bot] avatar May 27 '26 05:05 clawsweeper[bot]

Thanks for filing this. Current main already has Antigravity as a separate provider with two usage sources:

  • Local IDE API, which probes the running Antigravity language server for quota/model windows.
  • Google OAuth, which calls the Cloud Code / Code Assist quota APIs and maps all model quotas into the menu via named extra rate windows.

So I do not want to add a duplicate "Antigravity CLI" path unless the new CLI exposes quota/auth data that the existing Antigravity local/OAuth provider cannot see.

Could you share a little concrete CLI evidence, with secrets redacted?

command -v antigravity || command -v agy
antigravity --version 2>/dev/null || agy --version 2>/dev/null
find ~/.gemini/antigravity-cli -maxdepth 2 -type f 2>/dev/null | sort

Also useful:

  • A screenshot or redacted transcript showing whether /usage or /quota exists in Antigravity CLI.
  • If there is a non-interactive command for usage/quota, the exact command and redacted output.
  • Whether CLI login reuses the same Google OAuth account as Antigravity.app, or stores a separate session/credential file.
  • A redacted listing of ~/.gemini/antigravity-cli file names only; please do not paste token, OAuth, cookie, browser profile, or database contents.

If CLI quota is backed by the same Cloud Code quota API, the best fix may just be documentation / source-label wording around the existing Antigravity provider. If the CLI has a new machine-readable quota/session source, we can fold that into the existing Antigravity provider rather than creating another provider.

steipete avatar May 27 '26 05:05 steipete

Thanks for the review. I checked a local Antigravity CLI installation and it does seem to have a distinct CLI surface from the existing local IDE / OAuth paths.

Redacted terminal output:

$ pwd
/Users/<user>/Downloads/git/<repo>

$ command -v antigravity || command -v agy
/Users/<user>/.local/bin/agy

$ antigravity --version 2>/dev/null || agy --version 2>/dev/null
1.0.2

$ find ~/.gemini/antigravity-cli -maxdepth 2 -type f 2>/dev/null | sort
/Users/<user>/.gemini/antigravity-cli/bin/agentapi
/Users/<user>/.gemini/antigravity-cli/bin/webm_encoder
/Users/<user>/.gemini/antigravity-cli/cache/last_conversations.json
/Users/<user>/.gemini/antigravity-cli/cache/onboarding.json
/Users/<user>/.gemini/antigravity-cli/conversations/<uuid>.pb
/Users/<user>/.gemini/antigravity-cli/conversations/<uuid>.pb
/Users/<user>/.gemini/antigravity-cli/conversations/<uuid>.pb
/Users/<user>/.gemini/antigravity-cli/history.jsonl
/Users/<user>/.gemini/antigravity-cli/implicit/<uuid>.pb
/Users/<user>/.gemini/antigravity-cli/implicit/<uuid>.pb
/Users/<user>/.gemini/antigravity-cli/implicit/<uuid>.pb
/Users/<user>/.gemini/antigravity-cli/implicit/<uuid>.pb
/Users/<user>/.gemini/antigravity-cli/implicit/<uuid>.pb
/Users/<user>/.gemini/antigravity-cli/implicit/<uuid>.pb
/Users/<user>/.gemini/antigravity-cli/implicit/<uuid>.pb
/Users/<user>/.gemini/antigravity-cli/import_manifest.json
/Users/<user>/.gemini/antigravity-cli/installation_id
/Users/<user>/.gemini/antigravity-cli/keybindings.json
/Users/<user>/.gemini/antigravity-cli/knowledge/knowledge.lock
/Users/<user>/.gemini/antigravity-cli/last_check.timestamp
/Users/<user>/.gemini/antigravity-cli/log/cli-<timestamp>.log
/Users/<user>/.gemini/antigravity-cli/log/cli-<timestamp>.log
/Users/<user>/.gemini/antigravity-cli/log/cli-<timestamp>.log
/Users/<user>/.gemini/antigravity-cli/log/cli-<timestamp>.log
/Users/<user>/.gemini/antigravity-cli/log/cli-<timestamp>.log
/Users/<user>/.gemini/antigravity-cli/settings.json
/Users/<user>/.gemini/antigravity-cli/updater/update_status.json
/Users/<user>/.gemini/antigravity-cli/updater/update.lock

erseco avatar May 27 '26 05:05 erseco

Investigated the Antigravity CLI (agy) auth + quota surface — TL;DR: it hits the same Cloud Code backend this provider already uses, so no separate data source is needed; the only CLI-specific bit is where it stores credentials.

Tested agy (installed via curl -fsSL https://antigravity.google/cli/install.sh | bash) on macOS (Apple Silicon). Answering the questions raised above:

1. Binary / version

$ command -v agy
~/.local/bin/agy
$ agy --version
1.0.3

Top-level subcommands are only changelog / help / install / plugin / update — there is no usage/quota/login/auth subcommand. Login and quota are handled inside the interactive TUI; quota itself is fetched internally (see #4), not exposed as a non-interactive command.

2. Quota backend = same as the existing OAuth source From the CLI logs, agy calls:

https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist
https://cloudcode-pa.googleapis.com/v1internal:fetchAvailableModels

(observed on the daily-cloudcode-pa… staging host). These are the same v1internal Cloud Code endpoints AntigravityRemoteUsageFetcher already calls — so the CLI exposes no quota data the existing Antigravity OAuth source can't already see. This matches @steipete's earlier hypothesis.

3. Auth is independent of the IDE With Antigravity.app fully quit, agy stays logged in; /logout (TUI) clears it; a fresh login runs its own consumer OAuth browser flow (browser.go: consumerOAuth … authenticated successfully → ChainedAuth: interactive auth completed via consumer). client_id 1071006060591-…apps.googleusercontent.com, redirect https://antigravity.google/oauth-callback (manual code paste), scopes incl. cloud-platform, userinfo.email/profile, cclog, experimentsandconfigs, openid; authMethod=consumer. It does not reuse ~/.gemini/oauth_creds.json (removing that file had no effect on agy).

4. Where credentials live (the only CLI-specific surface)

  • Normal macOS: stored in the macOS Keychain, service name antigravity (auth.go: ChainedAuth: authenticated via keyring (effective: keyring); confirmed by the OS dialog "cannot find a keychain to store 'antigravity'" when run against a HOME with no login keychain). No credential file is written under ~/.gemini/.
  • Fallback (no OS keyring — e.g. headless Linux, or a Mac with no usable login keychain): a plaintext file ~/.gemini/antigravity-cli/antigravity-oauth-token (perms 0600):
    { "token": { "access_token": "…", "token_type": "Bearer", "refresh_token": "…", "expiry": "…" }, "auth_method": "consumer" }
    

Redacted ~/.gemini/antigravity-cli/ listing (file names only): settings.json, keybindings.json, installation_id, last_check.timestamp, cache/{onboarding,last_conversations}.json, conversations/*.pb, implicit/*.pb, knowledge/knowledge.lock, log/cli-*.log, updater/* — plus antigravity-oauth-token only in the keyring-fallback case.

Conclusion / suggestion

  • No new provider or data source is warranted — the existing Antigravity OAuth source already covers CLI users (identical Cloud Code backend). A CLI-only user just needs to sign into CodexBar's own Antigravity OAuth.
  • The CLI's Keychain item is ACL'd to agy, so CodexBar can't read it without a macOS access prompt — not worth it.
  • Optional, low priority: CodexBar could opportunistically read ~/.gemini/antigravity-cli/antigravity-oauth-token if it exists (it contains a usable refresh_token). But that file only appears when the OS keyring is unavailable, which is rare on a normal Mac, so it'd be a best-effort convenience rather than a reliable source.
  • Unrelated cleanup this surfaced: the AntigravityUsageDataSource.cli case is labeled "Local IDE API" and refers to the IDE language server, not this CLI — worth renaming now that a real agy CLI exists, to avoid confusion.

guhyun9454 avatar May 29 '26 07:05 guhyun9454

  • No new provider or data source is warranted — the existing Antigravity OAuth source already covers CLI users (identical Cloud Code backend). A CLI-only user just needs to sign into CodexBar's own Antigravity OAuth.

But it requires Antigravity app, so only with TUI 'agy' it will not work

dendenlarin avatar May 29 '26 16:05 dendenlarin

The running agy CLI exposes the same local language_server Connect-RPC endpoint the existing Local IDE source already uses — so CLI-only users can be covered by the existing local source, no new provider/path needed. Building on @guhyun9454's analysis (same Cloud Code backend) and answering @dendenlarin (the OAuth route still needs a separate CodexBar login; this local route doesn't).

Tested on macOS (Apple Silicon), Antigravity CLI agy 1.0.5, with Antigravity.app fully quit.

1. agy serves the language-server Connect-RPC locally (no CSRF)

The running agy process listens on two loopback ports (one HTTPS, one HTTP). Hitting the same endpoint CodexBar's local probe already calls — with no X-Codeium-Csrf-Token — returns full per-model quota:

$ ps -ax -o pid=,command= | grep -E '[a]gy'
<pid> agy        # argv is literally "agy": no path, no --csrf_token

$ curl -sk -X POST "https://127.0.0.1:<port>/exa.language_server_pb.LanguageServerService/GetUserStatus" \
    -H 'Content-Type: application/json' -H 'Connect-Protocol-Version: 1' \
    -d '{"metadata":{"ideName":"antigravity","extensionName":"antigravity","locale":"en"}}'
# 200 OK -> userStatus.cascadeModelConfigData.clientModelConfigs (8 models incl. Claude / GPT-OSS,
#           each with quotaInfo.remainingFraction) + userTier.availableCredits (GOOGLE_ONE_AI)

This is the exact request shape AntigravityStatusProbe already builds. The only reasons the current local source misses it:

  • process detection requires the command to match language_server and carry an antigravity path marker and a --csrf_token flag — agy has none of these;
  • the CLI endpoint needs no CSRF, but the probe always sends the header.

2. The newer "Antigravity IDE.app" is also missed (separate, plain bug)

Its language server runs as …/extensions/antigravity/bin/language_server_macos_arm (and _macos_x64). The current detection regex language_server(_macos|\.exe)? doesn't match the _arm/_x64 suffix, so the new IDE's local server isn't detected either. (The older Antigravity.app's plain language_server still matches.)

3. Proposed minimal fix — fold into the existing local source (no new provider/path)

  • Broaden the language_server name regex to accept arch suffixes (language_server_macos_arm / _macos_x64).
  • Recognize the agy process as a local candidate; make the --csrf_token optional and try both http/https on its loopback ports.
  • Reuse the existing GetUserStatus parsing / quota mapping / tests unchanged.

This keeps everything in the current Antigravity Local source and quota pipeline, matching your "fold it in rather than a new provider" preference. Happy to open a PR if you're good with this direction. (Also +1 on renaming the AntigravityUsageDataSource.cli "Local IDE API" label now that a real agy CLI exists.)

akunzai avatar Jun 04 '26 10:06 akunzai

+1 on @akunzai's direction. Detection regex broadening + treating agy as a local candidate looks like the cleanest fold-in, especially since the wire shape and GetUserStatus mapping are already battle-tested in AntigravityStatusProbe.

Happy to test the PR on a Mac with only agy CLI installed (no Antigravity.app, no Antigravity IDE.app) — that's the @dendenlarin scenario this unlocks, and a useful third-party verification surface alongside the existing Antigravity.app path.

Two small notes from poking at this locally:

  • The --csrf_token flag absence on agy matches what @akunzai shows; making the header optional and falling back to http:// on the second loopback port is also what worked for me when I poked the endpoint manually.
  • +1 on renaming AntigravityUsageDataSource.cli ("Local IDE API"). Now that a real agy CLI exists, that label name is going to confuse anyone reading provider settings. Could be a one-liner in the same PR or a follow-up.

LeoLin990405 avatar Jun 04 '26 10:06 LeoLin990405