Skip to main content

Gemini CLI quota monitor — fetches Code Assist quota data from Google's backend

Project description

gemini-cli-usage

Gemini CLI quota monitor. Fetches live Code Assist quota data from Google's backend when Gemini is using Google login.

Example output

gemini-cli-usage command:

Project: gemini-cli-usage
Auth: Google login
  gemini-2.5-pro        3.5% used  resets 19h38m
  gemini-2.5-flash-lite 0.07% used  resets 19h37m

gemini-cli-usage statusline command:

q:3.5% reset:19h38m

Install

uv tool install gemini-cli-usage

For local development from a checkout:

uv tool install .

Then run:

# Check usage once
gemini-cli-usage

# Raw JSON
gemini-cli-usage json

# Compact shell/statusline output
gemini-cli-usage statusline

# Force a fresh cache rebuild and print full status
gemini-cli-usage refresh

# Keep ~/.gemini/usage-limits.json fresh
gemini-cli-usage daemon

Commands

Command Description
gemini-cli-usage Show current usage (colored terminal output)
gemini-cli-usage status Same as above
gemini-cli-usage json Print raw JSON
gemini-cli-usage daemon [-i SECS] Run in foreground, refresh every 5 min
gemini-cli-usage statusline Compact statusline (reads cache, refreshes if stale)
gemini-cli-usage refresh Force a fresh fetch, rewrite cache, and print status
gemini-cli-usage install Print setup instructions

Data source

account_quota

When Gemini CLI is configured for Google login (oauth-personal), it calls Google's internal Code Assist API:

  • loadCodeAssist
  • retrieveUserQuota

This tool mirrors that flow using the OAuth credentials in ~/.gemini/oauth_creds.json.

Notes

  • Quota fetches are best-effort. If auth is not Google login, or quota lookup fails, the tool reports the auth state plus the quota error.
  • If the Google OAuth access token expires, the tool reuses Gemini CLI's installed OAuth client metadata when available. If Gemini is installed in a nonstandard location, set GEMINI_OAUTH_CLIENT_ID and GEMINI_OAUTH_CLIENT_SECRET, or rerun gemini and retry.
  • status and json always build fresh data.
  • statusline reads the cache by default; use --refresh or --max-age 0 to force a live refresh.
  • refresh is a convenience command that rebuilds the cache and prints the full status output.
  • Absolute quota counts are only shown when Google's response includes both remainingAmount and a usable fraction. Otherwise the tool reports % used plus reset time.
  • Auth detection follows Gemini CLI precedence: environment variables first, then workspace .gemini/settings.json, then global ~/.gemini/settings.json.

Options

usage: gemini-cli-usage [-h] [--root ROOT] [--interval INTERVAL]
                        [--max-age MAX_AGE] [--refresh]
                        {status,json,daemon,statusline,refresh,install}
  • --root ROOT: inspect a different project root instead of the current directory
  • --max-age MAX_AGE: cache TTL for statusline
  • --refresh: ignore the cache and rebuild fresh data where applicable

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gemini_cli_usage-0.1.3.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gemini_cli_usage-0.1.3-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file gemini_cli_usage-0.1.3.tar.gz.

File metadata

  • Download URL: gemini_cli_usage-0.1.3.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gemini_cli_usage-0.1.3.tar.gz
Algorithm Hash digest
SHA256 e7e8dab87cb9d4bda51dbed5fd7e17a0a02a1aabe0395f371a0947487bf2d5a5
MD5 855b4cacdc9f89462a1f27a8d98a3fe7
BLAKE2b-256 3853aad2ce829b342b36907e5abf68d74f88741085c62b1e61bfcd4a9eec75e3

See more details on using hashes here.

Provenance

The following attestation bundles were made for gemini_cli_usage-0.1.3.tar.gz:

Publisher: publish.yml on wakamex/gemini-cli-usage

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gemini_cli_usage-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for gemini_cli_usage-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c0025ed3046f8c5575f1407dce450bc518431ed308a2abcb4cc7fa6e45a590d9
MD5 e827ee73b5c95b78345f035f7580c685
BLAKE2b-256 ca46da1f11b8481634a59d6a5e841473cdcc248c582b96093dbe1b9ee3cc6784

See more details on using hashes here.

Provenance

The following attestation bundles were made for gemini_cli_usage-0.1.3-py3-none-any.whl:

Publisher: publish.yml on wakamex/gemini-cli-usage

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page