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:
loadCodeAssistretrieveUserQuota
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_IDandGEMINI_OAUTH_CLIENT_SECRET, or rerungeminiand retry. statusandjsonalways build fresh data.statuslinereads the cache by default; use--refreshor--max-age 0to force a live refresh.refreshis 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
remainingAmountand a usable fraction. Otherwise the tool reports% usedplus 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 forstatusline--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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gemini_cli_usage-0.1.6.tar.gz.
File metadata
- Download URL: gemini_cli_usage-0.1.6.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
700336f5ef9660da991e85fe7bb20ee8b0a1929b9b0e22f153f8d9e7cc8f85ac
|
|
| MD5 |
cd15ed5b9498f748fb6187435369fe0c
|
|
| BLAKE2b-256 |
bcd8dfc2d00eae8567f3d0d47926591bc61b14517ebc8311c3c9f390283e40eb
|
Provenance
The following attestation bundles were made for gemini_cli_usage-0.1.6.tar.gz:
Publisher:
publish.yml on wakamex/gemini-cli-usage
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gemini_cli_usage-0.1.6.tar.gz -
Subject digest:
700336f5ef9660da991e85fe7bb20ee8b0a1929b9b0e22f153f8d9e7cc8f85ac - Sigstore transparency entry: 1114461090
- Sigstore integration time:
-
Permalink:
wakamex/gemini-cli-usage@a54c4cb9400e68c6624438a3ae264eb85d5714dc -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/wakamex
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a54c4cb9400e68c6624438a3ae264eb85d5714dc -
Trigger Event:
release
-
Statement type:
File details
Details for the file gemini_cli_usage-0.1.6-py3-none-any.whl.
File metadata
- Download URL: gemini_cli_usage-0.1.6-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd184ac63cbc27dad842332a29c28ad9e8d9d146e18c69c668c952a7aad9e252
|
|
| MD5 |
25de85c7f14dcb8567d5e34ea8de1e2a
|
|
| BLAKE2b-256 |
e816492339590532ce5d9c47560e3113d0668a9fe4b1bcaa1619abd0a579bf7b
|
Provenance
The following attestation bundles were made for gemini_cli_usage-0.1.6-py3-none-any.whl:
Publisher:
publish.yml on wakamex/gemini-cli-usage
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gemini_cli_usage-0.1.6-py3-none-any.whl -
Subject digest:
fd184ac63cbc27dad842332a29c28ad9e8d9d146e18c69c668c952a7aad9e252 - Sigstore transparency entry: 1114461093
- Sigstore integration time:
-
Permalink:
wakamex/gemini-cli-usage@a54c4cb9400e68c6624438a3ae264eb85d5714dc -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/wakamex
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a54c4cb9400e68c6624438a3ae264eb85d5714dc -
Trigger Event:
release
-
Statement type: