Skip to content

Commit f49a0c3

Browse files
jay-tauCopilot
andcommitted
feat(adapter/copilot): surface --mode in copilot subcommand --help output
Multi-model review seq-9 round 1c (GPT-5.5) found that `ccusage copilot daily --help` (and monthly/session) listed json/since/until/timezone/offline/compact/color/config but omitted `-m, --mode` — even though Copilot's entire era-aware billing surface (`auto` / `display` / `calculate` / `api`) is the headline user-facing knob this branch adds. The flag was accepted by the parser (`parse_shared_arg` handles `-m`/`--mode` globally), but users discovering Copilot via `--help` had no way to find it. Following the existing `pi_options` / `openclaw_options` precedent: - Add new `copilot_options` entry to cli-help.json containing only the `-m, --mode` flag with the four choices (auto/calculate/display/api) and a description that names the per-mode semantics (era-aware true bill vs source precomputed vs LiteLLM vs api alias). - Add `copilot_combined_options` to cli-commands.json combinedOptions: ["agent_options", "copilot_options"]. - Route `copilot daily` / `copilot monthly` / `copilot session` pages to use `copilot_combined_options` instead of bare `agent_options`. Verified `ccusage copilot {daily,monthly,session} --help` now lists `-m, --mode [mode]` with all four choices. No snapshot regen needed (no copilot-subcommand help snapshot exists; root help is unchanged). Co-authored-by: Copilot <[email protected]>
1 parent 133cd72 commit f49a0c3

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

‎rust/crates/ccusage-cli/src/cli-commands.json‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"claude_daily_options": ["shared_claude_options", "daily_options"],
66
"claude_session_options": ["shared_claude_options", "session_options"],
77
"claude_weekly_options": ["shared_claude_options", "weekly_options"],
8+
"copilot_combined_options": ["agent_options", "copilot_options"],
89
"openclaw_combined_options": ["agent_options", "openclaw_options"],
910
"pi_combined_options": ["agent_options", "pi_options"]
1011
},
@@ -567,19 +568,19 @@
567568
"path": ["copilot", "daily"],
568569
"description": "Show GitHub Copilot CLI usage grouped by date",
569570
"usage": "ccusage copilot daily <OPTIONS>",
570-
"options": "agent_options"
571+
"options": "copilot_combined_options"
571572
},
572573
{
573574
"path": ["copilot", "monthly"],
574575
"description": "Show GitHub Copilot CLI usage grouped by month",
575576
"usage": "ccusage copilot monthly <OPTIONS>",
576-
"options": "agent_options"
577+
"options": "copilot_combined_options"
577578
},
578579
{
579580
"path": ["copilot", "session"],
580581
"description": "Show GitHub Copilot CLI usage grouped by session",
581582
"usage": "ccusage copilot session <OPTIONS>",
582-
"options": "agent_options"
583+
"options": "copilot_combined_options"
583584
},
584585
{
585586
"path": ["gemini"],

‎rust/crates/ccusage-cli/src/cli-help.json‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,14 @@
214214
"description": "Comma-separated project aliases (e.g., 'ccusage=Usage Tracker,myproject=My Project')"
215215
}
216216
],
217+
"copilot_options": [
218+
{
219+
"flags": "-m, --mode [mode]",
220+
"description": "Cost calculation mode (auto = era-aware true bill; display = source precomputed only; calculate = LiteLLM token pricing; api is alias for calculate)",
221+
"default": "auto",
222+
"choices": ["auto", "calculate", "display", "api"]
223+
}
224+
],
217225
"pi_options": [
218226
{
219227
"flags": "--pi-path <pi-path>",

0 commit comments

Comments
 (0)