feat(stats): render report as tables; add --json/--markdown to stats & report#54
Merged
Conversation
…ts and report `muxa report` now mirrors `muxa stats`: a range header followed by one bordered table per breakdown (day/project/agent/session) with the same TOTAL footer, instead of always emitting Markdown. Both `stats` and `report` gain `--json` and `--markdown` shortcut flags (mutually exclusive at the clap layer). On `stats` they override `--format`; on `report` they opt out of the default tables. `report` also gains `--theme` and `-v/--verbose` so its table mode matches `stats`. - OutputFormat::resolve folds the boolean shortcuts onto a base format. - render_table is split into shared helpers (print_range_header, print_notes, compaction_hint) reused by the new render_report_tables, which renders each section via the existing render_stats_table. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
muxa reportnow renders likemuxa stats— a range header followed by one bordered table per breakdown (day/project/agent/session), each with the sharedTOTALfooter, instead of always emitting Markdown.--jsonand--markdownto bothstatsandreport. They're mutually exclusive at the clap layer. Onstatsthey override--format; onreportthey opt out of the new default tables (Markdown output is unchanged, just no longer the default).reportalso gains--themeand-v/--verboseso its table mode matchesstats(notes hidden behind--verbose).How
OutputFormat::resolve(base, json, markdown)folds the boolean shortcuts onto a base format (--formatfor stats,Tablefor report).render_tablesplit into shared helpers (print_range_header,print_notes,compaction_hint); newrender_report_tablesreuses the existingrender_stats_tableper section.report --jsonemits a JSON array of the four section documents.Test
cargo fmt --all -- --check,cargo clippy --workspace --all-targets -- -D warnings,cargo test -p muxa-cliall green.output_format_resolve_applies_shortcut_precedence; manual smoke test against the live daemon for table/json/markdown + the--json --markdownconflict guard.🤖 Generated with Claude Code