Spend per bucket (day or hour), oldest first — cmduse daily/hourly.
lookback_ms is the read window and size_ms the bucket width (which also
names the first CSV/JSON column: day for a ≥24h bucket, else hour). The
Csv columns are that key plus the store’s numeric fields
(…,requests,tokens_in,tokens_out,cache_read,cost_usd; no cache-write), the
Json form {scope,source,total,days|hours}, and Table is the original
framing but for Ink’s colour. Json/Csv are never coloured.
Minimal one-line dashboard for terminals too small for the full frame:
period spend, rolling windows, and the burst sparkline inlined when active.
No trailing newline — the caller appends its own status line, exactly like
watch_frame.
Per-model report — ocuse model on the whole period (or one id). The
machine formats project the report’s models: Json mirrors cmduse’s
model --json envelope ({source, sinceMs, models:{id: totals}}, with the
Go limit added), Csv is one row per model
(model,requests,tokens_in,tokens_out,cache_read,cost_usd). The Table form
is the caller’s — the dashboard (no id) or the single-model detail (with an
id) — which needs the db path and row cap, so it is rendered there.
ocuse models --json: one JSON object per line (matching cmduse’s
models --json), each model’s id, name, $/1M rates, plan limit (null
when not granted) and the granted verdict.
ocuse models: the Go catalogue for one plan — name, id, $/1M in / out /
cache-read, and that plan’s monthly limit. Without gated, every catalogued
model is listed and the GRANTED column marks which the plan allows.
The Go/Zen catalogue as one JSON object — the machine twin of plans_text:
both plans (label, price, per-model monthly allowances), the shared window
shares, and the Go and Zen rate tables.
Spend per session, newest first. The Csv form is one row per session
(session,requests,tokens_in,tokens_out,cache_read,cost_usd), Json a
{scope,source,sessions} object whose entries add the last-used instant and
the distinct-model count; Table keeps its own (last, models) columns.
ocuse statusline --json: the same numbers the template resolves, in one
object — plan and period label, period/month spend, the two rolling windows,
and the top model. The *Cap keys are retired (always null): Go grants
limits per model, so no account-wide pool exists, and the summed ceiling
they carried read as a budget the console does not have.
ocuse’s statusline: cmduse’s {key} template engine (report_render:: render_template) resolved against this report’s own placeholders, so both
binaries are driven by statusline_template in their config.
One watch frame: the dashboard, then a burst sparkline when the 5-hour spend
has moved since the previous refresh. No trailing newline — the caller
appends its own status line and redraw_frame (cmduse’s) parks the cursor
there, which is what lets the countdown rewrite a single line per second.