Output Formats
Terminal (default)
Section titled “Terminal (default)”llm-usage dailyTerminal output includes:
- boxed report header
- semantic header colors and source-aware row styling
- summary-row emphasis for combined and grand totals
- diagnostics on
stderr - data table on
stdout
llm-usage daily --jsonUse for scripting and automation pipelines.
Markdown
Section titled “Markdown”llm-usage daily --markdownUse for docs, changelogs, and issue/PR reporting.
Usage report tables rank per-period models by total tokens so the dominant models appear first in both terminal and Markdown output.
Share SVG
Section titled “Share SVG”Generate a dark-themed share image:
# Usage reports (daily, weekly, or monthly)llm-usage monthly --sharellm-usage daily --sharellm-usage weekly --share
# Efficiency (monthly only)llm-usage efficiency monthly --repo-dir /path/to/repo --share
# Optimize (monthly only)llm-usage optimize monthly --provider openai --candidate-model gpt-4.1 --share--share writes an SVG file to the current directory:
- Usage reports:
usage-{granularity}-share.svg(stacked area chart by source) - Efficiency:
efficiency-monthly-share.svg(commit bars + $/commit line) - Optimize:
optimize-monthly-share.svg(savings % heatmap)
All share images use a dark theme designed for social media sharing.
Efficiency reports
Section titled “Efficiency reports”llm-usage efficiency dailyllm-usage efficiency weekly --repo-dir /path/to/repo --jsonllm-usage efficiency monthly --repo-dir /path/to/repo --shareEfficiency outputs include usage totals, Git outcomes (Commits, +Lines, -Lines, ΔLines), and derived ratios.
Usage values are repo-attributed: only usage events mapped to the selected repository root are included.
Columns:
Input,Output,Reasoning,Cache Read,Cache Write,Total,Costcome from repo-attributed usage events.Commits,+Lines,-Lines,ΔLinescome from local Git shortstat outcomes for the configured Git author.Tokens/Commit=(Input + Output + Reasoning) / Commits(excludes cache read/write tokens).$/Commit=Cost / Commits.$/1k Lines=Cost / (ΔLines / 1000).Commits/$=Commits / Cost(only whenCost > 0).
Efficiency period rows are emitted only when both Git outcomes and repo-attributed usage signal exist for that period.
When a denominator is zero, derived values render as - in terminal/markdown and are omitted in JSON.
When pricing is incomplete, affected USD values are prefixed with ~ in terminal/markdown.
Usage filters (--source, --provider, --model, source-path overrides) also affect commit attribution: only commit days with matching repo-attributed usage events are counted.
--provider scopes by billing entity (for example, openai-codex is normalized to openai).
For deeper semantics (repo attribution, scope behavior, and interpretation guidance), see the Efficiency page.
--share is monthly-only for efficiency (see Share SVG above).
Optimize reports
Section titled “Optimize reports”llm-usage optimize monthly --provider openai --candidate-model gpt-4.1 --candidate-model gpt-5-codexllm-usage optimize weekly --provider openai --candidate-model gpt-4.1,gpt-5-codex --top 1 --jsonllm-usage optimize monthly --provider openai --candidate-model gpt-4.1 --candidate-model gpt-5-codex --shareOptimize output contains baseline and candidate rows per period:
- baseline rows: observed token totals and baseline cost
- candidate rows: hypothetical cost on each candidate model, savings delta, and notes for missing pricing/incomplete baselines
For JSON and Markdown, stdout includes only the report body; diagnostics and warnings remain on stderr.
--share is monthly-only for optimize (see Share SVG above).
Trends reports
Section titled “Trends reports”llm-usage trendsllm-usage trends --metric tokens --days 7llm-usage trends --by-source --json- Default terminal output renders a daily trend chart.
--jsonemits structured trend series (metric,dateRange,totalSeries, optionalsourceSeries).- Diagnostics stay on
stderr. - Markdown is not supported for this command.
Per-model columns
Section titled “Per-model columns”Detailed multiline metrics per model:
llm-usage monthly --per-model-columnsllm-usage monthly --markdown --per-model-columnsWhen model breakdowns are present, rows are ordered by descending total tokens before the final Σ TOTAL line.
stdout/stderr behavior
Section titled “stdout/stderr behavior”stdout: report body (terminal,json, ormarkdown)stderr: diagnostics (session summary, parse failures, skipped rows, pricing source)