cmduse
Live Command Code usage dashboard for your terminal.
Plan dashboard, account-wide usage reports (all harnesses), offline local reports, and a customisable statusline.
Command Code Usage · GOAT · active
Period ends 2026-09-27
Credits $59.12 / $70.00 monthly · $0.00 purchased · $0.00 free
Usage windows
Monthly 15.1% ━━╱╱╱╱╱╱╱╱ $10.56 / $70.00 · resets in 22d 9h · window 28% elapsed
5-hour 1.5% ╱╱╱╱╱╱╱╱╱╱ $0.21 / $14.00 · resets in 4h 58m · window 0% elapsed
Weekly 15.8% ━╱╱╱╱╱╱╱╱╱ $5.54 / $35.00 · resets in 6d 5h · window 11% elapsed · on pace to hit cap in 4d 3h
This billing period
Requests 856 · Cost $10.69 · Tokens 89.5M in / 265.7K out · Success 100%
Install
Usage
# --days max 365, fetched 8-at-a-time
-1 --json emits a single dashboard object (plan, credits, both windows,
billing summary). --gated --json on models emits every model with
allowed and reason instead of filtering.
Cap alerts: in watch mode a desktop notification fires once when a window
crosses into overflow (macOS osascript, Linux notify-send). Disable with
cmduse config set notify=false.
Burn-rate: windows show on pace to hit cap in … when the current spend rate projects hitting the cap before the window resets, and only once the window is ≥10% elapsed (flat-rate projection is unreliable early). ponytail: assumes flat spend rate; bursty sessions shift the ETA.
Watch mode: a spend bursts (N samples) sparkline shows $ spent per refresh.
It is on by default, hidden while idle (all-zero deltas), and its sample count
is configurable. Session-only: a fresh run starts a fresh trend (no stale
data from earlier runs):
Statusline
Template-driven via config. Placeholders:
| Placeholder | Shows |
|---|---|
{plan} |
plan name (GOAT, Pro, …) |
{credits} |
remaining monthly credits |
{cap} |
monthly cap |
{credits_bar} |
monthly usage bar |
{5h_bar} {5h_pct} {5h_used} {5h_cap} {5h_eta} |
5-hour window (eta = pace text, empty when none) |
{wk_bar} {wk_pct} {wk_used} {wk_cap} {wk_eta} |
weekly window |
Multi-line templates work (newlines allowed). Unknown placeholders are dropped. Wire into your shell prompt or tmux status:
# .zshrc / tmux status-right
CMD_API_KEY env var overrides the stored key — point cmduse at any account without touching ~/.commandcode/auth.json.
Config
~/.config/cmd-usage/config.json:
CLI flags override config. cmduse config set interval=<s> width=<n> sl=<tpl> sl_colors=<bool> sl_ascii=<bool>.
Data sources
- Dashboard / daily / hourly / statusline: Command Code API with your account key. Daily and hourly cover every harness that used the key (CLI, Provider API, other agents).
- model / session / daily --local: local session logs at
~/.commandcode/projects— offline, but only what the CLI recorded.
Requirements
Logged-in Command Code CLI — reads your API key from ~/.commandcode/auth.json (run cmd login if missing), or set CMD_API_KEY.
Notes
- Window bars: green <70%, yellow 70–90%, red ≥90%, plus
LIMIT EXCEEDEDflag. - Spend-burst sparkline appears in watch mode after 2 refreshes (bars = $ spent between refreshes, ~3 min of history at 5s interval, capped at 40 samples; tall = burst, flat = idle).
- On Monthly caps: monthly pool is the plan total (e.g. $70 on GOAT). Docs describe per-model allowances, but the CLI and API meter one shared pool — verified empirically.