Gemini CLI & Antigravity¶
Sidekick monitors sessions and subscription quota for both Google coding agents as separate providers so their sessions, rate limits, and quota history never collide:
| Product | Provider ID | CLI alias | Quota source | Session source | Multi-account switching |
|---|---|---|---|---|---|
| Google Gemini CLI | gemini |
gemini-cli |
Google Cloud Code Assist API (loadCodeAssist + retrieveUserQuota) |
~/.gemini/tmp/<project>/chats/session-*.jsonl (and legacy .json) |
Supported (GEMINI_CLI_HOME profiles) |
| Google Antigravity | antigravity |
agy |
Official agy -p /usage --output-format json CLI probe (plus optional sidekick statusline cache) |
~/.gemini/antigravity[-cli]/brain/<id>/.system_generated/logs/transcript.jsonl |
Not supported (OS-keychain-managed) |
Monitoring and quota only in 0.34.0
Gemini CLI and Antigravity are session and quota providers. Sidekick's own inline-completion and summary inference provider (sidekick.inferenceProvider) continues to use claude-max, claude-api, opencode, or codex, and auto-detection skips gemini and antigravity.
Gemini CLI (gemini / gemini-cli)¶
Subscription Quota¶
- Sign in with
geminiso~/.gemini/oauth_creds.jsonexists (Sidekick also honoursGEMINI_CLI_HOME). - Run
sidekick quota --provider gemini(orsidekick quota --all).
Sidekick calls Google Cloud Code Assist's v1internal:loadCodeAssist (to discover the Cloud AI Companion project and tier: Free, Gemini Code Assist Standard, or Gemini Code Assist Enterprise) and v1internal:retrieveUserQuota (for 24-hour per-model quota buckets):
- Headline gauges:
Pro (24h)(most constrainedgemini-*-pro*bucket) andFlash (24h)(most constrainedgemini-*-flash*bucket), with reset countdowns and end-of-window projections. - Per-model breakdown: Every individual model bucket is preserved in
limits[](kind: 'daily_model') and rendered beneath the headline gauges in the CLI and VS Code dashboard. - Automatic OAuth token refresh: When the access token in
oauth_creds.jsonhas expired, Sidekick acquires a file lock and refreshes it if OAuth client credentials are configured (GEMINI_OAUTH_CLIENT_ID/GEMINI_OAUTH_CLIENT_SECRET) or discovered from your locally installedgeminiCLI package. Sidekick never hardcodes Google OAuth secrets; if client credentials are unavailable, it falls back cleanly to any cached snapshot or prompts you to rungeminiagain.
Session Monitoring¶
Set sidekick.sessionProvider to gemini (or leave on auto) in VS Code, or pass --provider gemini / --provider gemini-cli on the CLI. Sidekick reads both streaming session-*.jsonl and legacy monolithic session-*.json transcripts under ~/.gemini/tmp/, normalizing inclusive tokens.input (subtracting cached tokens to avoid double-counting) and separating thoughts tokens.
Multi-Account Management¶
Manage multiple Gemini CLI accounts in VS Code (Accounts view / Ctrl+K Ctrl+Shift+A) or the CLI:
sidekick accounts add --provider gemini --label Work
sidekick accounts add --provider gemini --current --label Personal
sidekick accounts switch work
sidekick accounts shell work -- gemini
eval "$(sidekick accounts env work)"
sidekick accounts undo --provider gemini
Each saved profile stores an isolated GEMINI_CLI_HOME backup under ~/.config/sidekick/accounts/gemini/. Switching swaps oauth_creds.json and google_accounts.json atomically into your live Gemini home.
Antigravity (antigravity / agy)¶
Subscription Quota (agy -p /usage + Optional statusLine Cache)¶
Sidekick fetches live Antigravity quota out of the box whenever the agy CLI is installed and signed in—no statusLine setup required:
- On-demand live fetch: Sidekick runs the official
agy -p /usage --output-format jsonprint command withAGY_CLI_DISABLE_AUTO_UPDATE=true(zero tokens consumed, no conversation created, and no background auto-update downloads) and caches the snapshot in~/.config/sidekick/quota-snapshots.json. - Clear per-family buckets everywhere: Both Gemini Models (
5-Hour (Gemini),Weekly (Gemini)) and Claude and GPT models (5-Hour (Claude/GPT),Weekly (Claude/GPT)) are labeled distinctly acrosssidekick quota,sidekick dashboard,sidekick statusline,state.json, notifications, and the VS Code Session Analytics dashboard. - Optional zero-latency
statusLinecache: Just like Claude Code, you can optionally point Antigravity'sstatusLineat Sidekick in~/.gemini/antigravity-cli/settings.jsonso fresh (<5 minute) snapshots are already warm without spawningagy:
{
"statusLine": {
"type": "command",
"command": "sidekick statusline",
"stack_with_default": true
}
}
Setting "stack_with_default": true renders Sidekick's line cleanly underneath Antigravity's built-in status line instead of replacing it.
On every prompt, sidekick statusline:
- Parses the documented Antigravity JSON payload (
product: "antigravity",quota,rate_limits,context_window,model,conversation_id,cwd). - Persists quota snapshots to
~/.config/sidekick/quota-snapshots.jsonand daily history samples toquota-history/<workspaceId>/antigravity.jsonl. - Updates
~/.config/sidekick/state.json(quota.antigravity) and records the conversation's workspace path. - Prints a compact one-line footer.
Every other Sidekick surface — sidekick quota --provider antigravity (or agy), sidekick quota --all, sidekick quota history, sidekick dashboard, and the VS Code Session Analytics dashboard — reads those snapshots with zero network calls and without probing any undocumented local services.
Session Monitoring¶
Set sidekick.sessionProvider to antigravity (or leave on auto) in VS Code, or pass --provider antigravity / --provider agy on the CLI. Sidekick discovers conversations under ~/.gemini/antigravity-cli/brain/<id>/.system_generated/logs/transcript.jsonl and ~/.gemini/antigravity/brain/<id>/.system_generated/logs/transcript.jsonl, mapping USER_INPUT, PLANNER_RESPONSE (thinking, tool calls, additive token usage), and GENERIC tool outputs onto the canonical session timeline.
Cross-Provider Quota Visibility¶
You do not need to switch your active session provider to keep an eye on Gemini CLI or Antigravity quota:
- VS Code Dashboard: Whenever two or more providers have quota data (for instance, monitoring a Claude Code or Codex session while signed into Gemini CLI or Antigravity), the Subscription Quota card shows compact provider pills (Claude, Codex, Gemini, Antigravity, z.ai) so you can toggle between them in place.
- CLI Dashboard:
sidekick dashboardpolls Gemini CLI quota in the background when credentials exist, reads Antigravity snapshots locally, and displays an Other Subscriptions summary in the Sessions panel. - One-shot CLI:
sidekick quota --allshows every detected provider side by side (Antigravity is included once a status-line sample exists orstatusLineis configured for Sidekick; usesidekick quota --provider agyanytime to inspect or see setup instructions).