llm-usage-metrics 0.1.4 → 0.1.6
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 +53 -3
- package/dist/index.js +597 -208
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -43,6 +43,23 @@ To force-skip startup update checks:
|
|
|
43
43
|
LLM_USAGE_SKIP_UPDATE_CHECK=1 llm-usage daily
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
+
### Runtime environment overrides
|
|
47
|
+
|
|
48
|
+
You can tune runtime behavior with environment variables:
|
|
49
|
+
|
|
50
|
+
- `LLM_USAGE_SKIP_UPDATE_CHECK`: skip startup update check when set to `1`
|
|
51
|
+
- `LLM_USAGE_UPDATE_CACHE_TTL_MS`: update-check cache TTL in milliseconds (clamped: `60000..2592000000`)
|
|
52
|
+
- `LLM_USAGE_UPDATE_FETCH_TIMEOUT_MS`: update-check network timeout in milliseconds (clamped: `200..30000`)
|
|
53
|
+
- `LLM_USAGE_PRICING_CACHE_TTL_MS`: pricing cache TTL in milliseconds (clamped: `60000..2592000000`)
|
|
54
|
+
- `LLM_USAGE_PRICING_FETCH_TIMEOUT_MS`: pricing fetch timeout in milliseconds (clamped: `200..30000`)
|
|
55
|
+
- `LLM_USAGE_PARSE_MAX_PARALLEL`: max concurrent file parses per source adapter (clamped: `1..64`)
|
|
56
|
+
|
|
57
|
+
Example:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
LLM_USAGE_PARSE_MAX_PARALLEL=16 LLM_USAGE_PRICING_FETCH_TIMEOUT_MS=8000 llm-usage monthly
|
|
61
|
+
```
|
|
62
|
+
|
|
46
63
|
## Usage
|
|
47
64
|
|
|
48
65
|
### Daily report (default terminal table)
|
|
@@ -114,7 +131,40 @@ llm-usage monthly --source pi --source codex
|
|
|
114
131
|
llm-usage monthly --source pi,codex
|
|
115
132
|
```
|
|
116
133
|
|
|
117
|
-
## Output
|
|
134
|
+
## Output features
|
|
135
|
+
|
|
136
|
+
### Terminal UI
|
|
137
|
+
|
|
138
|
+
The CLI provides an enhanced terminal output with:
|
|
139
|
+
|
|
140
|
+
- **Boxed report header** showing the report type and timezone
|
|
141
|
+
- **Session summary** displayed at startup (session files and event counts per source)
|
|
142
|
+
- **Pricing source info** indicating whether data was loaded from cache or fetched remotely
|
|
143
|
+
- **Environment variable overrides** displayed when active
|
|
144
|
+
- **Models displayed as bullet points** for better readability
|
|
145
|
+
- **Rounded table borders** and improved color scheme
|
|
146
|
+
|
|
147
|
+
Example output:
|
|
148
|
+
|
|
149
|
+
```text
|
|
150
|
+
ℹ Found 12 session file(s) with 45 event(s)
|
|
151
|
+
• pi: 8 file(s), 32 events
|
|
152
|
+
• codex: 4 file(s), 13 events
|
|
153
|
+
ℹ Loaded pricing from cache
|
|
154
|
+
|
|
155
|
+
┌──────────────────────────────────────────────────────────┐
|
|
156
|
+
│ Monthly Token Usage Report (Timezone: Africa/Casablanca) │
|
|
157
|
+
└──────────────────────────────────────────────────────────┘
|
|
158
|
+
|
|
159
|
+
╭────────────┬──────────┬──────────────────────╮
|
|
160
|
+
│ Period │ Source │ Models │
|
|
161
|
+
├────────────┼──────────┼──────────────────────┤
|
|
162
|
+
│ Feb 2026 │ pi │ • gpt-5.2 │
|
|
163
|
+
│ │ │ • gpt-5.2-codex │
|
|
164
|
+
╰────────────┴──────────┴──────────────────────╯
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Report structure
|
|
118
168
|
|
|
119
169
|
Each report includes:
|
|
120
170
|
|
|
@@ -132,8 +182,8 @@ Columns:
|
|
|
132
182
|
- Reasoning
|
|
133
183
|
- Cache Read
|
|
134
184
|
- Cache Write
|
|
135
|
-
- Total
|
|
136
|
-
- Cost
|
|
185
|
+
- Total
|
|
186
|
+
- Cost
|
|
137
187
|
|
|
138
188
|
## Development
|
|
139
189
|
|