You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 39fefa2
Browse filesBrowse the repository at this point in the historyBrowse files
fix(cli): accept --start-of-week on top-level weekly (ccusage#1945)
Since 20.x, `ccusage weekly` is the unified all-agent report and was parsed by the generic all-agent path, which only accepted shared flags. Only `ccusage claude weekly` still handled `-w/--start-of-week`, so the documented `ccusage weekly -w monday` failed with "Unknown option '-w'" and the flag was missing from `ccusage weekly --help`.
Parse `-w/--start-of-week` (and `commands.weekly.startOfWeek` config) for the top-level weekly report, carry it on AgentCommandArgs, and use it for both the unified week bucketing and the `--last` window. The default stays Monday, so existing output is unchanged. Docs and loader tests cover the new behaviour.
Co-authored-by: jgorres <[email protected]>
Copy file name to clipboardExpand all lines: docs/guide/cli-options.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,7 @@ ccusage daily --last 7
42
42
ccusage monthly --last 3
43
43
```
44
44
45
-
The count is inclusive of the current period, so `--last 2` on a daily report covers yesterday and today. Weeks start on the same day the report buckets by, which is Monday everywhere except `ccusage claude weekly`, where `--start-of-week`decides.
45
+
The count is inclusive of the current period, so `--last 2` on a daily report covers yesterday and today. Weeks start on the same day the report buckets by: Monday by default and Sunday for `ccusage claude weekly`, unless `commands.weekly.startOfWeek` in a [configuration file](/guide/config-files) or `--start-of-week`on `ccusage weekly` or `ccusage claude weekly` sets another day, with the flag taking precedence.
46
46
47
47
`--last` works on every daily, weekly, and monthly report, including the per-agent ones such as `ccusage codex daily --last 1`. It is not available on `session`, `blocks`, or `statusline`, which have no calendar period, and it cannot be combined with `--since`, `--until`, or `--sections`.
0 commit comments