@aiusage/cli 1.5.2 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -50,7 +50,7 @@ Project aliases are applied locally before upload. If two devices set the same a
50
50
  Local usage report. No cloud upload required.
51
51
 
52
52
  ```bash
53
- aiusage report # default: last 7 days, English, compact
53
+ aiusage report # default: last 7 days + today, English, compact
54
54
  aiusage report --range 1m # last 30 days
55
55
  aiusage report --range 3m # last 90 days
56
56
  aiusage report --range all # all history
@@ -64,13 +64,29 @@ Reads data from local tool data directories including `~/.claude/projects` (Clau
64
64
 
65
65
  **Compact mode** (default) shows Sources and Daily tables with merged Cache column and 2-decimal cost. **Detail mode** (`--detail`) expands all columns (CacheRead, CacheWrite, Reasoning), adds Top Models and Pricing Notes sections, and shows 4-decimal cost.
66
66
 
67
+ ### Shared date options
68
+
69
+ `scan`, `report`, and `sync` use the same date options:
70
+
71
+ ```bash
72
+ aiusage scan --today # today only
73
+ aiusage report --date 2026-03-31 # specific date
74
+ aiusage sync --range 1m # last 30 days
75
+ aiusage sync --lookback 14 # last 14 days + today
76
+ aiusage scan --from 2025-01-01 --to 2026-04-05
77
+ ```
78
+
79
+ Use `--range 1m`, not `range -1m`. `report` also supports `--range all`; `scan` and `sync` require explicit `--from/--to` for large historical ranges.
80
+
67
81
  ### scan
68
82
 
69
- Scan a single day and print the breakdown.
83
+ Scan local usage and print detailed breakdowns.
70
84
 
71
85
  ```bash
72
- aiusage scan --date 2026-03-31
73
- aiusage scan --date 2026-03-31 --json
86
+ aiusage scan # yesterday
87
+ aiusage scan --date 2026-03-31 # specific date
88
+ aiusage scan --range 1m # last 30 days
89
+ aiusage scan --date 2026-03-31 --json # JSON output
74
90
  ```
75
91
 
76
92
  Defaults to yesterday when `--date` is omitted.
@@ -111,6 +127,7 @@ Upload usage data to the Worker. Default: last 7 days + today.
111
127
  aiusage sync # last 7 days + today
112
128
  aiusage sync --today # today only
113
129
  aiusage sync --date 2026-03-31 # specific date
130
+ aiusage sync --range 1m # last 30 days
114
131
  aiusage sync --lookback 14 # last 14 days + today
115
132
  aiusage sync --from 2025-01-01 --to 2026-04-05 # date range
116
133
  ```
package/README.zh-CN.md CHANGED
@@ -50,7 +50,7 @@ aiusage project alias --remove myapp # 移除别名
50
50
  本地用量报告,无需服务端。
51
51
 
52
52
  ```bash
53
- aiusage report # 默认: 最近 7 天,英文,紧凑模式
53
+ aiusage report # 默认: 最近 7 天 + 今天,英文,紧凑模式
54
54
  aiusage report --range 1m # 最近 30 天
55
55
  aiusage report --range 3m # 最近 90 天
56
56
  aiusage report --range all # 全部历史
@@ -62,13 +62,29 @@ aiusage report --json # JSON 输出
62
62
 
63
63
  **紧凑模式**(默认)显示来源和每日汇总表,合并缓存列,保留 2 位小数成本。**详细模式**(`--detail`)展开所有列(CacheRead、CacheWrite、Reasoning),增加热门模型和定价说明,显示 4 位小数成本。
64
64
 
65
+ ### 统一日期参数
66
+
67
+ `scan`、`report`、`sync` 使用同一套日期参数:
68
+
69
+ ```bash
70
+ aiusage scan --today # 仅今天
71
+ aiusage report --date 2026-03-31 # 指定日期
72
+ aiusage sync --range 1m # 最近 30 天
73
+ aiusage sync --lookback 14 # 最近 14 天 + 今天
74
+ aiusage scan --from 2025-01-01 --to 2026-04-05
75
+ ```
76
+
77
+ 使用 `--range 1m`,不要写成 `range -1m`。`report` 额外支持 `--range all`;`scan` 和 `sync` 如需很长历史范围,请明确使用 `--from/--to`。
78
+
65
79
  ### scan
66
80
 
67
- 扫描单日数据并打印明细。
81
+ 扫描本地用量数据并打印明细。
68
82
 
69
83
  ```bash
70
- aiusage scan --date 2026-03-31
71
- aiusage scan --date 2026-03-31 --json
84
+ aiusage scan # 昨天
85
+ aiusage scan --date 2026-03-31 # 指定日期
86
+ aiusage scan --range 1m # 最近 30 天
87
+ aiusage scan --date 2026-03-31 --json # JSON 输出
72
88
  ```
73
89
 
74
90
  省略 `--date` 时默认扫描昨天。
@@ -81,6 +97,7 @@ aiusage scan --date 2026-03-31 --json
81
97
  aiusage sync # 最近 7 天 + 今天
82
98
  aiusage sync --today # 仅今天
83
99
  aiusage sync --date 2026-03-31 # 指定日期
100
+ aiusage sync --range 1m # 最近 30 天
84
101
  aiusage sync --lookback 14 # 最近 14 天 + 今天
85
102
  aiusage sync --from 2025-01-01 --to 2026-04-05 # 指定日期范围
86
103
  ```