feat(daily): default 7-day window and token display units#3
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Updates codetok daily to default to a rolling 7-day lookback and adds new flags to control history windowing and table token display units, with accompanying docs and test coverage.
Changes:
- Change
dailydefault behavior from full-history to a 7-day rolling window; add--alland--dayscontrols. - Add
--unit raw|k|m|gfor table token display scaling (JSON remains raw integers). - Update README/agent docs and expand unit/date-window test coverage (unit + e2e adjustments).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| e2e/e2e_test.go | Updates daily e2e invocations to use --all and adds coverage for --unit in table output. |
| cmd/daily_test.go | Adds unit tests for date-range resolution and token unit formatting/parsing. |
| cmd/daily.go | Implements new --days, --all, and --unit behavior; refactors date-range logic and table formatting. |
| README_zh.md | Documents new daily defaults/flags and clarifies stats scope in Chinese docs. |
| README.md | Documents new daily defaults/flags and clarifies stats scope in English docs. |
| CLAUDE.md | Adds guidance on stats scope, rebuild workflow, and daily command behavior contract. |
| AGENTS.md | Adds repository-level agent guidance including daily command contract and build/test workflow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- defer --unit validation until table output so --json ignores unit errors - prioritize --all conflict checks before invalid --days validation - compute default rolling window from UTC day boundary for consistency - add unit tests for UTC default window, conflict precedence, and json unit behavior
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 to a rolling 7-day window--alland--dayscontrols for full history and custom lookback--unit raw|k|m|gfor table token display (defaultk)README.md,README_zh.md,AGENTS.md,CLAUDE.md)Requirement Check
codetok daily --all--daysor--since/--untilraw,k,m,g)Validation
make testmake lint(skipped:golangci-lintnot installed in local env)make buildNotes
--allis mutually exclusive with--days,--since,--until--daysis mutually exclusive with--sinceand--until