All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Summary allowlist: Replaced
gemini-3.1-pro-highwithgemini-3.1-flash-imageand removedgemini-3-pro-imageandgemini-3-flash-previewfrom the summary table.
1.2.1 - 2026-02-23
- Access token caching: Tokens are now cached to disk (
cachedAccessToken/cachedExpiresAton each identity). Subsequent runs within the token's ~1 hour lifetime skip the OAuth refresh round-trip, reducing wall-clock time from ~6s to ~2s on warm runs. - Token refresh timeout: Added 10-second
AbortControllertimeout torefreshAccessToken(previously had no timeout, could hang indefinitely on slow networks).
UsageOpencodeIdentitytype now includes optionalcachedAccessTokenandcachedExpiresAtfields.StatusDepsinterface now includessaveStorefor persisting the token cache (fire-and-forget, best-effort).- Test count: Increased from 83 to 87 tests (added token cache hit, cache miss, cache persist, and cache skip tests).
1.2.0 - 2026-02-20
- User-Agent: Replaced incorrect
google-api-nodejs-client/9.15.1withGeminiCLI/<version>/<model> (<platform>; <arch>)matching the real Gemini CLI format fromcontentGenerator.ts. - Extraneous headers: Removed
X-Goog-Api-ClientandClient-Metadataheaders. The real gemini-cli does not send these as HTTP headers (ClientMetadatais a JSON body field used only for telemetry). - Endpoint strategy: Removed sandbox endpoint fallback (daily + autopush). The real gemini-cli uses only the production endpoint (
cloudcode-pa.googleapis.com). Now uses retry logic (3 attempts, 1s delay) matching the antigravity path. - Response type: Added
remainingAmount(string) andtokenType(string) fields toRetrieveUserQuotaResponsebucket type, matching gemini-cli'sBucketInfofromcode_assist/types.ts.
- Unified retry logic: Both antigravity and gemini-cli identities now use the same retry strategy (3 attempts, 1s delay, 403 throws immediately). Removed separate
fetchQuotaWithEndpointFallbackfunction. - Test count: Increased from 80 to 82 tests (added gemini-cli retry and 403 no-retry tests).
1.1.0 - 2026-02-20
- User-Agent: Replaced static
antigravity/1.11.5 windows/amd64with full Electron-style User-Agent matching the official Antigravity client (Mozilla/5.0 (...) Antigravity/1.16.5 Chrome/132.0.6834.160 Electron/39.2.3 Safari/537.36). The API rejects non-conforming User-Agent strings. - Extraneous headers: Removed
X-Goog-Api-ClientandClient-Metadataheaders from antigravity quota requests (the working Antigravity-Manager does not send them). - Endpoint strategy: Antigravity quota now uses only the production endpoint with retry logic (3 attempts, 1s delay) instead of trying 3 endpoints sequentially. This matches the Antigravity-Manager behavior.
- 403 handling: 403 Forbidden errors are still thrown immediately without retry.
- Primary endpoint: Switched from production to daily sandbox (
daily-cloudcode-pa.sandbox.googleapis.com) as primary, avoiding 429 rate limits. Production is now a fallback. - ideType: Changed from
IDE_UNSPECIFIEDtoANTIGRAVITYto match the working implementation. - User-Agent: Updated to use the same Electron-style User-Agent as quota requests.
- Fallback project: Updated default from
rising-fact-p41fctobamboo-precept-lgxtn.
- Model filter: Expanded from
/gemini|claude/ito/gemini|claude|image|imagen/ito include image generation models. - Fetch timeout: Increased from 10s to 15s per request, matching the Antigravity-Manager.
- Test count: Increased from 77 to 80 tests (added retry, 403 no-retry, and image model filter tests).
1.0.0 - 2026-01-31
First production-ready release of usage-google-opencode CLI tool for monitoring Google Cloud Code Assist quota.
- Dual Identity Support: Track quota for both Antigravity (IDE) and Gemini CLI identities
- OAuth2 Authentication: Secure login flow with PKCE support
- Quota Monitoring: Real-time quota checking with remaining percentage and reset times
- Multiple Output Formats: Table view (default) or JSON for automation
- Filtering: Filter by identity (
--only) or account (--account)
- Interactive Login: Browser-based OAuth flow with fallback manual paste
- Beautiful Tables: Summary and full detail views with formatted columns
- Clear Error Messages: Helpful messages for common issues (relogin, forbidden, etc.)
- Reset Time Formatting: Human-readable times (e.g., "2h30m" or "1d5h30m")
- Tracks quota for Gemini and Claude AI models
- Filters to relevant models only
- Project ID auto-discovery for Antigravity
- Manual project ID specification for Gemini CLI
- File Permissions: Storage file automatically set to
0600(owner read/write only) - URL Validation: Callback URLs validated to prevent malicious redirects
- Atomic Writes: Write-then-rename pattern prevents file corruption
- Input Validation: All user inputs and API responses validated
- Refresh Token Security: Tokens stored with restrictive permissions
- No Token Logging: Refresh tokens never printed to console
- Graceful Shutdown: SIGINT/SIGTERM handlers for clean exits
- Network Timeouts: 15-second timeouts prevent hanging on slow networks
- Parallel Fetching: Quota fetched in parallel for multiple accounts/identities
- Parallel Storage Loading: Current and legacy storage files loaded concurrently
- Efficient Table Rendering: Optimized column width calculations
- Fast Startup: Minimal dependencies and efficient file I/O
@openauthjs/openauth: PKCE support for OAuth flow- Node.js built-in modules:
fs,http,os,path,child_process - Zero runtime dependencies beyond OpenAuth
- Node.js: 20+
- Operating Systems: macOS, Linux, Windows
- Package Managers: npm, bun
- Location:
~/.config/opencode/usage-google-accounts.json - Format: JSON with version 1 schema
- Migration: Auto-migrates from legacy storage file
- Permissions: 0600 (owner read/write only)
- Comprehensive README with examples
- Security and privacy guidelines
- Installation instructions for npm and bun
- Development guide with testing instructions
- 80 passing unit tests
- Full test coverage for core modules
- Integration tests for CLI commands
- Mocked network calls for reliable testing
OAuth client credentials are hardcoded in src/oauth/constants.ts by design. These are public client credentials extracted from:
- Antigravity IDE - for IDE quota tracking
- Google Cloud SDK / Gemini CLI - for CLI quota tracking
Note: These credentials are intentionally public (standard for OAuth public clients) and pose no security risk. They are necessary for the tool to authenticate with Google's OAuth servers. See
src/oauth/constants.tsfor the actual credential values.
Antigravity Quota:
- Endpoint:
https://cloudcode-pa.googleapis.com/v1internal:fetchAvailableModels - Strategy: Retry up to 3 times with 1s delay (403 throws immediately)
Gemini CLI Quota:
- Endpoint:
https://cloudcode-pa.googleapis.com/v1internal:retrieveUserQuota - Strategy: Retry up to 3 times with 1s delay (403 throws immediately)
Project Discovery:
- Primary:
https://daily-cloudcode-pa.sandbox.googleapis.com/v1internal:loadCodeAssist - Fallback:
https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist - Default:
bamboo-precept-lgxtn(if all endpoints fail)
- Initial Planning: 2026-01-18
- Implementation: Tasks 1-10 completed with TDD approach
- E2E Verification: 2026-01-28
- Security Audit: 2026-01-31
- Production Release: 2026-01-31 (v1.0.0)
- Concurrent login commands may cause storage corruption (mitigated with atomic writes)
- Gemini CLI quota requires manual project ID specification
- Network requests timeout after 15 seconds per endpoint
- Email addresses displayed in output (privacy consideration)
- Interactive project ID selection for Gemini CLI
- Quota alerts and notifications
- Historical quota tracking
- Multi-account batch operations
- Configuration file support
This is the first production release. If you were using development versions:
- Storage Migration: Legacy storage files automatically migrated
- File Permissions: Existing storage files should be manually secured:
chmod 600 ~/.config/opencode/usage-google-accounts.json - Breaking Changes: None (first release)
- Development: Built with AI assistance
- OAuth Credentials: Extracted from Google Cloud SDK and Antigravity IDE
- API Integration: Uses Google Cloud Code Assist internal APIs
- Repository: https://github.com/YOUR_USERNAME/usage-google-opencode
- Issues: https://github.com/YOUR_USERNAME/usage-google-opencode/issues
- Documentation: See
docs/directory