feat: add daily dashboard with CLI/model grouping#7
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new dashboard-based terminal output for codetok daily with configurable grouping dimensions. It introduces model-based aggregation as an opt-in alternative to the default CLI/provider grouping, extracts model names across all three providers (Kimi, Claude, Codex), and normalizes common model aliases for stable grouping.
Changes:
- Introduced three-section dashboard layout (Daily Trend, Group Ranking, Top Share) replacing the previous table output for
codetok daily - Added
--group-byflag (cli/model) and--topflag to control aggregation dimension and share section size - Populated
SessionInfo.ModelNameacross parsers with fallback extraction from multiple sources (wire events, metadata, Kimi logs)
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
cmd/daily.go |
Implements dashboard rendering with three sections, adds --group-by and --top flags, changes default unit from k to m |
cmd/daily_test.go |
Unit tests for new flags, dashboard output validation, and edge case handling |
stats/aggregator.go |
Dimension-aware aggregation with model/CLI grouping support, model alias normalization, and multi-provider group handling |
stats/aggregator_test.go |
Comprehensive test coverage for model/CLI grouping, multi-provider scenarios, unknown model handling, and alias normalization |
provider/provider.go |
Extends data model with ModelName in SessionInfo and grouping fields (GroupBy, Group, Providers) in DailyStats |
provider/provider_test.go |
JSON serialization tests for single and multi-provider grouping semantics |
provider/kimi/parser.go |
Model extraction from wire StatusUpdate, metadata JSON, and fallback from Kimi log files with session-to-model index |
provider/kimi/parser_test.go |
Tests for model extraction from all sources and normalization of Kimi-specific aliases |
provider/claude/parser.go |
Model extraction from Claude event messages |
provider/claude/parser_test.go |
Tests for Claude model extraction |
provider/codex/parser.go |
Recursive model extraction from Codex event payloads with multiple field name candidates |
provider/codex/parser_test.go |
Tests for Codex model extraction from various payload structures |
e2e/e2e_test.go |
Integration tests for JSON output with both grouping modes and dashboard output validation |
README.md |
Updated documentation for new dashboard output, flags, and JSON semantics |
AGENTS.md |
Updated contract documentation for new defaults and grouping behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
codetok dailydefault terminal output to a three-section dashboard.--group-by(clidefault,modelopt-in).--topto control share section size and propagate grouping metadata in JSON (group_by,group,providers).SessionInfo.ModelNameacross Kimi/Claude/Codex parsers and normalize common model aliases for stable model grouping.Changes
cmd/daily.go: introduce dashboard rendering,--group-by,--top, and updated unit default (m).stats/aggregator.go: add dimension-aware aggregation and model alias normalization.provider/provider.go: extend data model withModelNameand grouping fields inDailyStats.provider/kimi/parser.go,provider/claude/parser.go,provider/codex/parser.go: add model extraction/fallback paths.cmd/daily_test.go,stats/aggregator_test.go,provider/*_test.go,e2e/e2e_test.go,provider/provider_test.go: expand coverage for new flags, dashboard output, JSON semantics, parser model extraction, and alias behavior.README.md,AGENTS.md: sync docs/contracts with new defaults and output semantics.Validation
make testmake lintmake buildmake vetRisks / Notes
--topvalidation is now skipped for--jsonmode to keep JSON behavior aligned with--unit(ignored in JSON path).