mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-05-17 03:56:45 +00:00
A single dense table of every (provider, model) you have used in the selected period, sorted by cost. Inspired by tokscale's per-model output and ccusage's responsive cli-table3 layout, ported to plain Node with no new runtime dependency. Default view: one row per (provider, model) with a Top Task cell showing the dominant task category and its cost share, e.g. `Coding (42%)`. `--by-task` explodes each model into one row per task type, with provider/model cells blanked on subsequent rows of the same group and a horizontal divider between groups so the sections read as distinct units. Output formats: table (Unicode box-drawn, default), markdown (GitHub-flavored, copy-paste friendly), json, csv. Filters: --period (today/week/30days/month/all, default 30days), --from/--to, --provider, --task, --top, --min-cost, --no-totals. The table renderer auto-sizes every column to its content (no fixed widths leaving trailing whitespace) and drops cache columns as a pair when the terminal is narrow, then input/output, then top-task, in that order. Provider, model, total, and cost stay regardless. Visible-width math uses strip-ansi (already a dependency) so styled cells pad correctly. Cyan headers, yellow totals, dim provider name. The aggregator walks every parsed turn and attributes each assistant call to its (provider, model, task) bucket, computing real input / output / cache_write / cache_read tokens and cost. Output tokens include reasoning. Cached input tokens are folded into cache_read so the column matches what users intuitively expect. 19 fixture-based tests cover aggregation correctness, byTask grouping, taskFilter, topN/minCost filters, reasoning-as-output, all four renderers (table/markdown/json/csv), narrow-terminal column dropping, CSV/markdown escaping, totals row toggle, and visible-width math under styled cells. |
||
|---|---|---|
| .. | ||
| fixtures/security | ||
| providers | ||
| security | ||
| bash-commands.test.ts | ||
| classifier.test.ts | ||
| cli-date.test.ts | ||
| cli-export-date-range.test.ts | ||
| cli-plan.test.ts | ||
| compare-stats.test.ts | ||
| currency-rounding.test.ts | ||
| daily-cache.test.ts | ||
| dashboard.test.ts | ||
| date-range-filter.test.ts | ||
| day-aggregator.test.ts | ||
| export.test.ts | ||
| fs-utils.test.ts | ||
| mcp-coverage.test.ts | ||
| menubar-json.test.ts | ||
| minimax.test.ts | ||
| model-efficiency.test.ts | ||
| models-hoist.test.ts | ||
| models-report.test.ts | ||
| models.test.ts | ||
| optimize-fs.test.ts | ||
| optimize.test.ts | ||
| parser-claude-cwd.test.ts | ||
| parser-filter.test.ts | ||
| parser-mcp-inventory.test.ts | ||
| plan-usage.test.ts | ||
| plans.test.ts | ||
| provider-registry.test.ts | ||