Skip to content

feat(stats): render report as tables; add --json/--markdown to stats & report#54

Merged
jiunbae merged 1 commit into
mainfrom
feat/report-table-formats
Jun 15, 2026
Merged

feat(stats): render report as tables; add --json/--markdown to stats & report#54
jiunbae merged 1 commit into
mainfrom
feat/report-table-formats

Conversation

@jiunbae

@jiunbae jiunbae commented Jun 15, 2026

Copy link
Copy Markdown
Member

What

  • muxa report now renders like muxa stats — a range header followed by one bordered table per breakdown (day/project/agent/session), each with the shared TOTAL footer, instead of always emitting Markdown.
  • Added --json and --markdown to both stats and report. They're mutually exclusive at the clap layer. On stats they override --format; on report they opt out of the new default tables (Markdown output is unchanged, just no longer the default).
  • report also gains --theme and -v/--verbose so its table mode matches stats (notes hidden behind --verbose).

How

  • OutputFormat::resolve(base, json, markdown) folds the boolean shortcuts onto a base format (--format for stats, Table for report).
  • render_table split into shared helpers (print_range_header, print_notes, compaction_hint); new render_report_tables reuses the existing render_stats_table per section.
  • report --json emits a JSON array of the four section documents.

Test

  • cargo fmt --all -- --check, cargo clippy --workspace --all-targets -- -D warnings, cargo test -p muxa-cli all green.
  • New unit test output_format_resolve_applies_shortcut_precedence; manual smoke test against the live daemon for table/json/markdown + the --json --markdown conflict guard.

🤖 Generated with Claude Code

…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>
@jiunbae jiunbae merged commit 797f71e into main Jun 15, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant