feat(overview): plain-text monthly usage overview command#528
Merged
Conversation
Add 'codeburn overview', a copy-pasteable text report. Defaults to the current month, with --from/--to to filter and --no-color for plain output. Renders Totals, By tool, Top models, Highest-value days, Top projects, a daily table, By activity, and Tools, with colored section headings (stripped under --no-color or when piped). Reuses the existing session aggregation. Cost gains thousands separators and tokens roll up to a B unit for readability via display-only wrappers, without changing the shared formatters. Project names use the path basename instead of the sanitized full path.
Piping output to a reader that closes early (| head, quitting less, a missing command) made stdout writes throw EPIPE and crash with an unhandled error event. Handle EPIPE on process.stdout and exit 0 so piping the overview and other commands behaves normally.
Add a 'Your month at a glance' section featuring codeburn overview with examples and sample output, a Commands-table entry, and the provider flag note.
ac48a9a to
178e233
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
codeburn overview, a copy-pasteable plain-text usage report.--from/--tofilters any range, plus--provider,--project, and--exclude.--no-colorfor plain output; colored cyan section headings otherwise (also stripped automatically when the output is piped).Notes
report --format jsonvalidity issue (unescaped control characters and aNaN/Infinity-style literal) found while building this. That serializer bug is worth fixing separately.Bunit, via local wrappers that do not change the sharedformatCost/formatTokens, so other commands' output and tests are untouched.Verification
tscclean; full suite green (1242) including 3 new tests intests/overview.test.ts.Example