Quota panels for the Kimi, Claude Code and Codex CLIs, in one terminal command. Shows plan usage (percent used, time to reset) and, where the provider exposes it, pay-as-you-go balance -- without opening a browser.
┌ Kimi Usage ──────────────────────────────────────────────────────────────┐
│ Plan usage │
│ Weekly limit ████░░░░░░░░░░░░░░ 23% used resets in 6d 3h 33m │
│ 5h limit █████████░░░░░░░░░ 49% used resets in 1h 33m │
│ Extra Usage │
│ Used this month $183.04 │
│ Monthly limit Unlimited │
│ Balance $ 6.96 │
└──────────────────────────────────────────────────────────────────────────┘
tokematics-cli currently runs on macOS only. The blocker is the Claude Code
panel: it reads the CLI's OAuth token out of the macOS Keychain via
security find-generic-password, which has no equivalent on Linux or
Windows. The Kimi and Codex panels have no macOS-specific dependency -- they
read plain JSON/token files on disk (~/.kimi-code/..., ~/.codex/auth.json)
and would already work anywhere those CLIs run.
See "Porting to other platforms" below if you want to fix that.
- bash
- python3 (stdlib only -- no pip installs)
- one or more of the CLIs it reports on:
kimi,claude,codex. A tool with no binary on PATH is skipped silently; you don't need all three.
curl -fsSL https://raw.githubusercontent.com/cloudyventures/tokematics-cli/main/tokematics-cli \
-o ~/.local/bin/tokematics-cli
chmod +x ~/.local/bin/tokematics-cliOr clone and symlink, if you'd rather track updates via git:
git clone https://github.com/cloudyventures/tokematics-cli.git
ln -s "$(pwd)/tokematics-cli/tokematics-cli" ~/.local/bin/tokematics-cliEither way, ~/.local/bin needs to be on your PATH.
tokematics-cli show all three panels (Kimi, Claude, Codex)
tokematics-cli kimi show only the Kimi panel
tokematics-cli claude show only the Claude panel
tokematics-cli codex show only the Codex panel
tokematics-cli --watch [name] refresh every 5 minutes (all panels, or one); q/esc to exit
tokematics-cli server start start the local Kimi web server in the background
tokematics-cli server stop stop it
tokematics-cli --help this help
A tool with no binary installed is skipped silently. A tool with a binary but
missing or stale credentials prints a one-line hint naming the login command
(claude login, codex login, ...) instead of an error. The Kimi panel needs
its local usage server running first (tokematics-cli server start); it talks to
kimi web over 127.0.0.1, not a public API.
- Kimi -- reads the auth token at
~/.kimi-code/server.tokenand the most recently active server instance under~/.kimi-code/server/instances/*.json, then calls that local server's/api/v1/oauth/usage. - Claude -- reads the OAuth token from the macOS Keychain (service
Claude Code-credentials) and callsapi.anthropic.com/api/oauth/usage. - Codex -- reads the access token from
~/.codex/auth.jsonand callschatgpt.com/backend-api/wham/usage.
All three calls use each provider's own CLI OAuth token -- there's no separate API key to configure.
The only macOS-specific piece is the Claude panel's Keychain read. To port:
- Linux: Claude Code writes its OAuth token to
~/.claude/.credentials.jsondirectly (no system keychain in the picture), so the fix is a plainos.path.exists+json.loadin place of thesecurity find-generic-passwordsubprocess call, branched onsys.platform. - Windows: untested. Claude Code's Windows credential storage would need the same kind of lookup as the Linux path, or its own branch if it uses Windows Credential Manager instead of a plain file.
The Kimi and Codex panels need no changes to run on either platform; they already just read local files.
Contributions welcome for either.