Skip to main content

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. When GEMINI_CLI_HOME is set, it follows Gemini CLI and uses $GEMINI_CLI_HOME/.gemini instead.

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 the global settings file under the effective Gemini CLI home.

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

Metadata

Release files for gemini-cli-usage 0.1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gemini-cli-usage 0.1.9
File Size Uploaded
gemini_cli_usage-0.1.9.tar.gz 12.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gemini-cli-usage 0.1.9
File Interpreter ABI Platform
gemini_cli_usage-0.1.9-py3-none-any.whl Python 3 none any Details

Total release size: 21.9 kB

Release files / gemini_cli_usage-0.1.9.tar.gz

Download URL gemini_cli_usage-0.1.9.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1f97441d5523b4d93f24ff607fc4fd0de3fd3bd29e64e9ebeb4d68134bf41626
BLAKE2b-256 checksum
How to use checksums
1f605674c5c580d52f3952d4f0ff7051a395b2f0756e86210910633e76e440a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / gemini_cli_usage-0.1.9-py3-none-any.whl

Download URL gemini_cli_usage-0.1.9-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
471cba17cb87adeb498483104d17b8455b206e782d47c2ce65d7ce0e136ef408
BLAKE2b-256 checksum
How to use checksums
d5a8e47f129c611bbd3941034e254b3fe8e8bb7410c5403f41559afabc46015c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.1.9 This release

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page