gcusage 0.1.0 → 0.1.1
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 +22 -15
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -19,25 +19,32 @@ Gemini CLI 用量统计工具 / Usage report for Gemini CLI
|
|
|
19
19
|
"enabled": true,
|
|
20
20
|
"target": "local",
|
|
21
21
|
"otlpEndpoint": "",
|
|
22
|
-
|
|
22
|
+
"outfile": "/Users/<yourname>/.gemini/telemetry.log",
|
|
23
23
|
"logPrompts": false
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
说明:
|
|
29
|
+
- 必须开启 telemetry 并指定 `outfile`,否则不会生成 `telemetry.log`
|
|
30
|
+
- 使用绝对路径可避免 `~` 或相对路径导致写入失败
|
|
31
|
+
- `outfile` 路径必须与 `gcusage` 读取路径一致(默认读取 `~/.gemini/telemetry.log`)
|
|
32
|
+
- 日志包含完整响应内容,建议使用 `trim` 进行瘦身
|
|
29
33
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
## 使用方式 / Usage
|
|
35
|
+
|
|
36
|
+
已发布版本:`gcusage@0.1.0`
|
|
37
|
+
npm 包地址: https://www.npmjs.com/package/gcusage
|
|
38
|
+
|
|
39
|
+
## 系统支持 / Platform
|
|
34
40
|
|
|
35
|
-
|
|
41
|
+
- 支持:macOS / Linux
|
|
42
|
+
- 暂不支持:Windows(路径与终端输出兼容性尚未处理)
|
|
36
43
|
|
|
37
44
|
默认输出最近 6 天(含今天)的日统计:
|
|
38
45
|
|
|
39
46
|
```bash
|
|
40
|
-
|
|
47
|
+
npx gcusage
|
|
41
48
|
```
|
|
42
49
|
|
|
43
50
|
输出:每天一行,展示 Models 列(多模型换行)与各类型 token 总量。
|
|
@@ -45,7 +52,7 @@ node dist/index.js
|
|
|
45
52
|
按 session 输出(当天每个 session 一行):
|
|
46
53
|
|
|
47
54
|
```bash
|
|
48
|
-
|
|
55
|
+
npx gcusage --period session
|
|
49
56
|
```
|
|
50
57
|
|
|
51
58
|
输出:当天每个 session 的最终累计值。
|
|
@@ -53,7 +60,7 @@ node dist/index.js --period session
|
|
|
53
60
|
按周(显示该周内每天数据):
|
|
54
61
|
|
|
55
62
|
```bash
|
|
56
|
-
|
|
63
|
+
npx gcusage --period week
|
|
57
64
|
```
|
|
58
65
|
|
|
59
66
|
输出:当前周(周一开始)内每日数据。
|
|
@@ -61,7 +68,7 @@ node dist/index.js --period week
|
|
|
61
68
|
按月(显示该月内每天数据):
|
|
62
69
|
|
|
63
70
|
```bash
|
|
64
|
-
|
|
71
|
+
npx gcusage --period month
|
|
65
72
|
```
|
|
66
73
|
|
|
67
74
|
输出:当前月内每日数据。
|
|
@@ -69,7 +76,7 @@ node dist/index.js --period month
|
|
|
69
76
|
从指定日期开始统计一周:
|
|
70
77
|
|
|
71
78
|
```bash
|
|
72
|
-
|
|
79
|
+
npx gcusage --period week --since 2026-01-01
|
|
73
80
|
```
|
|
74
81
|
|
|
75
82
|
输出:从 2026-01-01 开始的 7 天数据。
|
|
@@ -77,7 +84,7 @@ node dist/index.js --period week --since 2026-01-01
|
|
|
77
84
|
指定范围(覆盖 week/month 计算范围):
|
|
78
85
|
|
|
79
86
|
```bash
|
|
80
|
-
|
|
87
|
+
npx gcusage --period month --since 2026-01-01 --until 2026-01-15
|
|
81
88
|
```
|
|
82
89
|
|
|
83
90
|
输出:2026-01-01 到 2026-01-15 的每日数据。
|
|
@@ -85,7 +92,7 @@ node dist/index.js --period month --since 2026-01-01 --until 2026-01-15
|
|
|
85
92
|
过滤模型或类型:
|
|
86
93
|
|
|
87
94
|
```bash
|
|
88
|
-
|
|
95
|
+
npx gcusage --model gemini-2.5-flash-lite --type input
|
|
89
96
|
```
|
|
90
97
|
|
|
91
98
|
输出:只统计指定模型与类型的数据。
|
|
@@ -111,7 +118,7 @@ Date | Models | Input | Output | Thought | Cache | Tool | Total Tokens
|
|
|
111
118
|
仅保留 token 相关数据(覆盖原文件):
|
|
112
119
|
|
|
113
120
|
```bash
|
|
114
|
-
|
|
121
|
+
npx gcusage trim
|
|
115
122
|
```
|
|
116
123
|
|
|
117
124
|
输出:`telemetry.log` 体积显著减小,统计不受影响。
|
package/package.json
CHANGED