gemini-cli-usage 0.1.9__tar.gz → 0.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,4 @@
1
+ __pycache__/
2
+ .venv/
3
+ dist/
4
+ dist-wrappers/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mihai
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,25 @@
1
+ Metadata-Version: 2.5
2
+ Name: gemini-cli-usage
3
+ Version: 0.4.0
4
+ Summary: Gemini CLI model quota monitor
5
+ Project-URL: Homepage, https://github.com/wakamex/clanker-usage
6
+ Project-URL: Source, https://github.com/wakamex/clanker-usage
7
+ License-Expression: MIT
8
+ License-File: LICENSE
9
+ Keywords: cli,gemini,gemini-cli,google,quota,statusline,usage
10
+ Requires-Python: >=3.12
11
+ Requires-Dist: clanker-usage==0.4.0
12
+ Description-Content-Type: text/markdown
13
+
14
+ # gemini-cli-usage
15
+
16
+ Monitor your Gemini CLI quota from the terminal: current usage, a one-line statusline, and a daemon that keeps a cache fresh.
17
+
18
+ ```sh
19
+ uv tool install gemini-cli-usage
20
+ gemini-cli-usage # current quotas
21
+ gemini-cli-usage statusline # one line, from a cache less than five minutes old
22
+ gemini-cli-usage json # the usage-v1 document
23
+ ```
24
+
25
+ `gemini-cli-usage` is the Gemini CLI command of [clanker-usage](https://github.com/wakamex/clanker-usage), so it installs clanker-usage at the same version. The documentation lives there.
@@ -0,0 +1,12 @@
1
+ # gemini-cli-usage
2
+
3
+ Monitor your Gemini CLI quota from the terminal: current usage, a one-line statusline, and a daemon that keeps a cache fresh.
4
+
5
+ ```sh
6
+ uv tool install gemini-cli-usage
7
+ gemini-cli-usage # current quotas
8
+ gemini-cli-usage statusline # one line, from a cache less than five minutes old
9
+ gemini-cli-usage json # the usage-v1 document
10
+ ```
11
+
12
+ `gemini-cli-usage` is the Gemini CLI command of [clanker-usage](https://github.com/wakamex/clanker-usage), so it installs clanker-usage at the same version. The documentation lives there.
@@ -0,0 +1,7 @@
1
+ """gemini-cli-usage: the Gemini CLI command of clanker-usage."""
2
+
3
+ from clanker_usage import run
4
+
5
+
6
+ def main():
7
+ return run("gemini")
@@ -0,0 +1,3 @@
1
+ from . import main
2
+
3
+ raise SystemExit(main())
@@ -0,0 +1,24 @@
1
+ [build-system]
2
+ requires = ["hatchling==1.32.4"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "gemini-cli-usage"
7
+ version = "0.4.0"
8
+ description = "Gemini CLI model quota monitor"
9
+ readme = "README.md"
10
+ keywords = ["gemini", "gemini-cli", "google", "usage", "quota", "statusline", "cli"]
11
+ requires-python = ">=3.12"
12
+ license = "MIT"
13
+ license-files = ["LICENSE"]
14
+ dependencies = ["clanker-usage==0.4.0"]
15
+
16
+ [project.urls]
17
+ Homepage = "https://github.com/wakamex/clanker-usage"
18
+ Source = "https://github.com/wakamex/clanker-usage"
19
+
20
+ [project.scripts]
21
+ gemini-cli-usage = "gemini_cli_usage:main"
22
+
23
+ [tool.hatch.build.targets.wheel]
24
+ packages = ["gemini_cli_usage"]
@@ -1,29 +0,0 @@
1
- name: Publish to PyPI
2
-
3
- on:
4
- push:
5
- tags:
6
- - "v*"
7
-
8
- jobs:
9
- publish:
10
- runs-on: ubuntu-latest
11
- environment: pypi
12
- permissions:
13
- contents: read
14
- id-token: write
15
- steps:
16
- - name: Checkout
17
- uses: actions/checkout@v7.0.1
18
- - name: Install uv
19
- uses: astral-sh/setup-uv@v9.0.0
20
- with:
21
- enable-cache: false
22
- - name: Verify version tag
23
- run: test "$GITHUB_REF_NAME" = "v$(uv --no-config version --short)"
24
- - name: Test
25
- run: uv --no-config run --locked python -m unittest discover -s tests
26
- - name: Build
27
- run: uv --no-config build --no-sources
28
- - name: Publish
29
- run: uv publish --trusted-publishing always
@@ -1,2 +0,0 @@
1
- __pycache__/
2
- *.py[cod]
@@ -1,120 +0,0 @@
1
- Metadata-Version: 2.5
2
- Name: gemini-cli-usage
3
- Version: 0.1.9
4
- Summary: Gemini CLI quota monitor — fetches Code Assist quota data from Google's backend
5
- Project-URL: Homepage, https://github.com/wakamex/gemini-cli-usage
6
- Project-URL: Source, https://github.com/wakamex/gemini-cli-usage
7
- Requires-Python: >=3.12
8
- Description-Content-Type: text/markdown
9
-
10
- # gemini-cli-usage
11
-
12
- Gemini CLI quota monitor. Fetches live Code Assist quota data from Google's
13
- backend when Gemini is using Google login.
14
-
15
- ## Example output
16
-
17
- `gemini-cli-usage` command:
18
-
19
- ```text
20
- Project: gemini-cli-usage
21
- Auth: Google login
22
- gemini-2.5-pro 3.5% used resets 19h38m
23
- gemini-2.5-flash-lite 0.07% used resets 19h37m
24
- ```
25
-
26
- `gemini-cli-usage statusline` command:
27
-
28
- ```text
29
- q:3.5% reset:19h38m
30
- ```
31
-
32
- ## Install
33
-
34
- ```bash
35
- uv tool install gemini-cli-usage
36
- ```
37
-
38
- For local development from a checkout:
39
-
40
- ```bash
41
- uv tool install .
42
- ```
43
-
44
- Then run:
45
-
46
- ```bash
47
- # Check usage once
48
- gemini-cli-usage
49
-
50
- # Raw JSON
51
- gemini-cli-usage json
52
-
53
- # Compact shell/statusline output
54
- gemini-cli-usage statusline
55
-
56
- # Force a fresh cache rebuild and print full status
57
- gemini-cli-usage refresh
58
-
59
- # Keep ~/.gemini/usage-limits.json fresh
60
- gemini-cli-usage daemon
61
- ```
62
-
63
- ## Commands
64
-
65
- | Command | Description |
66
- |---------|-------------|
67
- | `gemini-cli-usage` | Show current usage (colored terminal output) |
68
- | `gemini-cli-usage status` | Same as above |
69
- | `gemini-cli-usage json` | Print raw JSON |
70
- | `gemini-cli-usage daemon [-i SECS]` | Run in foreground, refresh every 5 min |
71
- | `gemini-cli-usage statusline` | Compact statusline (reads cache, refreshes if stale) |
72
- | `gemini-cli-usage refresh` | Force a fresh fetch, rewrite cache, and print status |
73
- | `gemini-cli-usage install` | Print setup instructions |
74
-
75
- ## Data source
76
-
77
- ### `account_quota`
78
-
79
- When Gemini CLI is configured for Google login (`oauth-personal`), it calls
80
- Google's internal Code Assist API:
81
-
82
- - `loadCodeAssist`
83
- - `retrieveUserQuota`
84
-
85
- This tool mirrors that flow using the OAuth credentials in
86
- `~/.gemini/oauth_creds.json`. When `GEMINI_CLI_HOME` is set, it follows Gemini
87
- CLI and uses `$GEMINI_CLI_HOME/.gemini` instead.
88
-
89
- ## Notes
90
-
91
- - Quota fetches are best-effort. If auth is not Google login, or quota lookup
92
- fails, the tool reports the auth state plus the quota error.
93
- - If the Google OAuth access token expires, the tool reuses Gemini CLI's
94
- installed OAuth client metadata when available. If Gemini is installed in a
95
- nonstandard location, set `GEMINI_OAUTH_CLIENT_ID` and
96
- `GEMINI_OAUTH_CLIENT_SECRET`, or rerun `gemini` and retry.
97
- - `status` and `json` always build fresh data.
98
- - `statusline` reads the cache by default; use `--refresh` or `--max-age 0` to
99
- force a live refresh.
100
- - `refresh` is a convenience command that rebuilds the cache and prints the full
101
- status output.
102
- - Absolute quota counts are only shown when Google's response includes both
103
- `remainingAmount` and a usable fraction. Otherwise the tool reports `% used`
104
- plus reset time.
105
- - Auth detection follows Gemini CLI precedence: environment variables first,
106
- then workspace `.gemini/settings.json`, then the global settings file under
107
- the effective Gemini CLI home.
108
-
109
- ## Options
110
-
111
- ```text
112
- usage: gemini-cli-usage [-h] [--root ROOT] [--interval INTERVAL]
113
- [--max-age MAX_AGE] [--refresh]
114
- {status,json,daemon,statusline,refresh,install}
115
- ```
116
-
117
- - `--root ROOT`: inspect a different project root instead of the current
118
- directory
119
- - `--max-age MAX_AGE`: cache TTL for `statusline`
120
- - `--refresh`: ignore the cache and rebuild fresh data where applicable
@@ -1,111 +0,0 @@
1
- # gemini-cli-usage
2
-
3
- Gemini CLI quota monitor. Fetches live Code Assist quota data from Google's
4
- backend when Gemini is using Google login.
5
-
6
- ## Example output
7
-
8
- `gemini-cli-usage` command:
9
-
10
- ```text
11
- Project: gemini-cli-usage
12
- Auth: Google login
13
- gemini-2.5-pro 3.5% used resets 19h38m
14
- gemini-2.5-flash-lite 0.07% used resets 19h37m
15
- ```
16
-
17
- `gemini-cli-usage statusline` command:
18
-
19
- ```text
20
- q:3.5% reset:19h38m
21
- ```
22
-
23
- ## Install
24
-
25
- ```bash
26
- uv tool install gemini-cli-usage
27
- ```
28
-
29
- For local development from a checkout:
30
-
31
- ```bash
32
- uv tool install .
33
- ```
34
-
35
- Then run:
36
-
37
- ```bash
38
- # Check usage once
39
- gemini-cli-usage
40
-
41
- # Raw JSON
42
- gemini-cli-usage json
43
-
44
- # Compact shell/statusline output
45
- gemini-cli-usage statusline
46
-
47
- # Force a fresh cache rebuild and print full status
48
- gemini-cli-usage refresh
49
-
50
- # Keep ~/.gemini/usage-limits.json fresh
51
- gemini-cli-usage daemon
52
- ```
53
-
54
- ## Commands
55
-
56
- | Command | Description |
57
- |---------|-------------|
58
- | `gemini-cli-usage` | Show current usage (colored terminal output) |
59
- | `gemini-cli-usage status` | Same as above |
60
- | `gemini-cli-usage json` | Print raw JSON |
61
- | `gemini-cli-usage daemon [-i SECS]` | Run in foreground, refresh every 5 min |
62
- | `gemini-cli-usage statusline` | Compact statusline (reads cache, refreshes if stale) |
63
- | `gemini-cli-usage refresh` | Force a fresh fetch, rewrite cache, and print status |
64
- | `gemini-cli-usage install` | Print setup instructions |
65
-
66
- ## Data source
67
-
68
- ### `account_quota`
69
-
70
- When Gemini CLI is configured for Google login (`oauth-personal`), it calls
71
- Google's internal Code Assist API:
72
-
73
- - `loadCodeAssist`
74
- - `retrieveUserQuota`
75
-
76
- This tool mirrors that flow using the OAuth credentials in
77
- `~/.gemini/oauth_creds.json`. When `GEMINI_CLI_HOME` is set, it follows Gemini
78
- CLI and uses `$GEMINI_CLI_HOME/.gemini` instead.
79
-
80
- ## Notes
81
-
82
- - Quota fetches are best-effort. If auth is not Google login, or quota lookup
83
- fails, the tool reports the auth state plus the quota error.
84
- - If the Google OAuth access token expires, the tool reuses Gemini CLI's
85
- installed OAuth client metadata when available. If Gemini is installed in a
86
- nonstandard location, set `GEMINI_OAUTH_CLIENT_ID` and
87
- `GEMINI_OAUTH_CLIENT_SECRET`, or rerun `gemini` and retry.
88
- - `status` and `json` always build fresh data.
89
- - `statusline` reads the cache by default; use `--refresh` or `--max-age 0` to
90
- force a live refresh.
91
- - `refresh` is a convenience command that rebuilds the cache and prints the full
92
- status output.
93
- - Absolute quota counts are only shown when Google's response includes both
94
- `remainingAmount` and a usable fraction. Otherwise the tool reports `% used`
95
- plus reset time.
96
- - Auth detection follows Gemini CLI precedence: environment variables first,
97
- then workspace `.gemini/settings.json`, then the global settings file under
98
- the effective Gemini CLI home.
99
-
100
- ## Options
101
-
102
- ```text
103
- usage: gemini-cli-usage [-h] [--root ROOT] [--interval INTERVAL]
104
- [--max-age MAX_AGE] [--refresh]
105
- {status,json,daemon,statusline,refresh,install}
106
- ```
107
-
108
- - `--root ROOT`: inspect a different project root instead of the current
109
- directory
110
- - `--max-age MAX_AGE`: cache TTL for `statusline`
111
- - `--refresh`: ignore the cache and rebuild fresh data where applicable
@@ -1,24 +0,0 @@
1
- [project]
2
- name = "gemini-cli-usage"
3
- version = "0.1.9"
4
- description = "Gemini CLI quota monitor — fetches Code Assist quota data from Google's backend"
5
- readme = "README.md"
6
- requires-python = ">=3.12"
7
- dependencies = []
8
-
9
- [tool.uv]
10
- package = true
11
-
12
- [build-system]
13
- requires = ["hatchling"]
14
- build-backend = "hatchling.build"
15
-
16
- [tool.hatch.build.targets.wheel]
17
- packages = ["src/gemini_cli_usage"]
18
-
19
- [project.urls]
20
- Homepage = "https://github.com/wakamex/gemini-cli-usage"
21
- Source = "https://github.com/wakamex/gemini-cli-usage"
22
-
23
- [project.scripts]
24
- gemini-cli-usage = "gemini_cli_usage:main"