gemini-cli-usage 0.1.8__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.
- gemini_cli_usage-0.4.0/.gitignore +4 -0
- gemini_cli_usage-0.4.0/LICENSE +21 -0
- gemini_cli_usage-0.4.0/PKG-INFO +25 -0
- gemini_cli_usage-0.4.0/README.md +12 -0
- gemini_cli_usage-0.4.0/gemini_cli_usage/__init__.py +7 -0
- gemini_cli_usage-0.4.0/gemini_cli_usage/__main__.py +3 -0
- gemini_cli_usage-0.4.0/pyproject.toml +24 -0
- gemini_cli_usage-0.1.8/.github/workflows/publish.yml +0 -29
- gemini_cli_usage-0.1.8/.gitignore +0 -2
- gemini_cli_usage-0.1.8/PKG-INFO +0 -118
- gemini_cli_usage-0.1.8/README.md +0 -109
- gemini_cli_usage-0.1.8/pyproject.toml +0 -24
- gemini_cli_usage-0.1.8/src/gemini_cli_usage/__init__.py +0 -765
- gemini_cli_usage-0.1.8/src/gemini_cli_usage/__main__.py +0 -2
- gemini_cli_usage-0.1.8/tests/test_gemini_cli_usage.py +0 -397
- gemini_cli_usage-0.1.8/uv.lock +0 -8
|
@@ -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,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 version --short)"
|
|
24
|
-
- name: Test
|
|
25
|
-
run: uv run --locked python -m unittest discover -s tests
|
|
26
|
-
- name: Build
|
|
27
|
-
run: uv build --no-sources
|
|
28
|
-
- name: Publish
|
|
29
|
-
run: uv publish --trusted-publishing always
|
gemini_cli_usage-0.1.8/PKG-INFO
DELETED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: gemini-cli-usage
|
|
3
|
-
Version: 0.1.8
|
|
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`.
|
|
87
|
-
|
|
88
|
-
## Notes
|
|
89
|
-
|
|
90
|
-
- Quota fetches are best-effort. If auth is not Google login, or quota lookup
|
|
91
|
-
fails, the tool reports the auth state plus the quota error.
|
|
92
|
-
- If the Google OAuth access token expires, the tool reuses Gemini CLI's
|
|
93
|
-
installed OAuth client metadata when available. If Gemini is installed in a
|
|
94
|
-
nonstandard location, set `GEMINI_OAUTH_CLIENT_ID` and
|
|
95
|
-
`GEMINI_OAUTH_CLIENT_SECRET`, or rerun `gemini` and retry.
|
|
96
|
-
- `status` and `json` always build fresh data.
|
|
97
|
-
- `statusline` reads the cache by default; use `--refresh` or `--max-age 0` to
|
|
98
|
-
force a live refresh.
|
|
99
|
-
- `refresh` is a convenience command that rebuilds the cache and prints the full
|
|
100
|
-
status output.
|
|
101
|
-
- Absolute quota counts are only shown when Google's response includes both
|
|
102
|
-
`remainingAmount` and a usable fraction. Otherwise the tool reports `% used`
|
|
103
|
-
plus reset time.
|
|
104
|
-
- Auth detection follows Gemini CLI precedence: environment variables first,
|
|
105
|
-
then workspace `.gemini/settings.json`, then global `~/.gemini/settings.json`.
|
|
106
|
-
|
|
107
|
-
## Options
|
|
108
|
-
|
|
109
|
-
```text
|
|
110
|
-
usage: gemini-cli-usage [-h] [--root ROOT] [--interval INTERVAL]
|
|
111
|
-
[--max-age MAX_AGE] [--refresh]
|
|
112
|
-
{status,json,daemon,statusline,refresh,install}
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
- `--root ROOT`: inspect a different project root instead of the current
|
|
116
|
-
directory
|
|
117
|
-
- `--max-age MAX_AGE`: cache TTL for `statusline`
|
|
118
|
-
- `--refresh`: ignore the cache and rebuild fresh data where applicable
|
gemini_cli_usage-0.1.8/README.md
DELETED
|
@@ -1,109 +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`.
|
|
78
|
-
|
|
79
|
-
## Notes
|
|
80
|
-
|
|
81
|
-
- Quota fetches are best-effort. If auth is not Google login, or quota lookup
|
|
82
|
-
fails, the tool reports the auth state plus the quota error.
|
|
83
|
-
- If the Google OAuth access token expires, the tool reuses Gemini CLI's
|
|
84
|
-
installed OAuth client metadata when available. If Gemini is installed in a
|
|
85
|
-
nonstandard location, set `GEMINI_OAUTH_CLIENT_ID` and
|
|
86
|
-
`GEMINI_OAUTH_CLIENT_SECRET`, or rerun `gemini` and retry.
|
|
87
|
-
- `status` and `json` always build fresh data.
|
|
88
|
-
- `statusline` reads the cache by default; use `--refresh` or `--max-age 0` to
|
|
89
|
-
force a live refresh.
|
|
90
|
-
- `refresh` is a convenience command that rebuilds the cache and prints the full
|
|
91
|
-
status output.
|
|
92
|
-
- Absolute quota counts are only shown when Google's response includes both
|
|
93
|
-
`remainingAmount` and a usable fraction. Otherwise the tool reports `% used`
|
|
94
|
-
plus reset time.
|
|
95
|
-
- Auth detection follows Gemini CLI precedence: environment variables first,
|
|
96
|
-
then workspace `.gemini/settings.json`, then global `~/.gemini/settings.json`.
|
|
97
|
-
|
|
98
|
-
## Options
|
|
99
|
-
|
|
100
|
-
```text
|
|
101
|
-
usage: gemini-cli-usage [-h] [--root ROOT] [--interval INTERVAL]
|
|
102
|
-
[--max-age MAX_AGE] [--refresh]
|
|
103
|
-
{status,json,daemon,statusline,refresh,install}
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
- `--root ROOT`: inspect a different project root instead of the current
|
|
107
|
-
directory
|
|
108
|
-
- `--max-age MAX_AGE`: cache TTL for `statusline`
|
|
109
|
-
- `--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.8"
|
|
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"
|