llm-usage-metrics 0.5.2 → 0.7.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 +23 -12
- package/dist/index.js +795 -196
- package/dist/index.js.map +1 -1
- package/package.json +44 -20
package/README.md
CHANGED
|
@@ -55,13 +55,14 @@ llm-usage daily
|
|
|
55
55
|
|
|
56
56
|
## 📋 Supported Sources
|
|
57
57
|
|
|
58
|
-
| Source
|
|
59
|
-
|
|
|
60
|
-
| **pi**
|
|
61
|
-
| **codex**
|
|
62
|
-
| **Gemini CLI**
|
|
63
|
-
| **Droid CLI**
|
|
64
|
-
| **OpenCode**
|
|
58
|
+
| Source | Pattern | Discovery |
|
|
59
|
+
| --------------- | ---------------------------------------- | -------------------------------- |
|
|
60
|
+
| **pi** | `~/.pi/agent/sessions/**/*.jsonl` | Automatic |
|
|
61
|
+
| **codex** | `~/.codex/sessions/**/*.jsonl` | Automatic |
|
|
62
|
+
| **Gemini CLI** | `~/.gemini/tmp/*/chats/*.json` | Automatic |
|
|
63
|
+
| **Droid CLI** | `~/.factory/sessions/**/*.settings.json` | Automatic |
|
|
64
|
+
| **OpenCode** | `~/.opencode/opencode.db` | Auto or explicit `--opencode-db` |
|
|
65
|
+
| **Claude Code** | `~/.claude/projects/**/*.jsonl` | Automatic |
|
|
65
66
|
|
|
66
67
|
OpenCode source support requires Node.js 24+ runtime with built-in `node:sqlite`.
|
|
67
68
|
|
|
@@ -98,6 +99,8 @@ llm-usage monthly --per-model-columns
|
|
|
98
99
|
llm-usage monthly --share
|
|
99
100
|
```
|
|
100
101
|
|
|
102
|
+
Usage tables rank per-period model breakdowns by total tokens so the dominant models appear first in terminal and Markdown output.
|
|
103
|
+
|
|
101
104
|
### Trends
|
|
102
105
|
|
|
103
106
|
```bash
|
|
@@ -152,9 +155,10 @@ llm-usage efficiency monthly --repo-dir /path/to/repo --source codex
|
|
|
152
155
|
llm-usage efficiency monthly --repo-dir /path/to/repo --source gemini
|
|
153
156
|
llm-usage efficiency monthly --repo-dir /path/to/repo --source droid
|
|
154
157
|
llm-usage efficiency monthly --repo-dir /path/to/repo --source opencode
|
|
158
|
+
llm-usage efficiency monthly --repo-dir /path/to/repo --source claude
|
|
155
159
|
```
|
|
156
160
|
|
|
157
|
-
Note: usage filters (`--source`, `--provider`, `--model`, `--pi-dir`, `--codex-dir`, `--gemini-dir`, `--droid-dir`, `--opencode-db`, `--source-dir`) also constrain commit attribution: only commit days with matching repo-attributed usage events are counted.
|
|
161
|
+
Note: usage filters (`--source`, `--provider`, `--model`, `--pi-dir`, `--codex-dir`, `--gemini-dir`, `--droid-dir`, `--claude-dir`, `--opencode-db`, `--source-dir`) also constrain commit attribution: only commit days with matching repo-attributed usage events are counted.
|
|
158
162
|
|
|
159
163
|
### Optimize Reports
|
|
160
164
|
|
|
@@ -175,7 +179,7 @@ llm-usage optimize monthly --provider openai --candidate-model gpt-4.1 --candida
|
|
|
175
179
|
|
|
176
180
|
```bash
|
|
177
181
|
# By source
|
|
178
|
-
llm-usage monthly --source pi,codex,gemini,droid
|
|
182
|
+
llm-usage monthly --source pi,codex,gemini,droid,claude
|
|
179
183
|
|
|
180
184
|
# By provider
|
|
181
185
|
llm-usage monthly --provider openai
|
|
@@ -187,17 +191,18 @@ llm-usage monthly --model claude
|
|
|
187
191
|
llm-usage monthly --source opencode --provider openai --model gpt-4.1
|
|
188
192
|
```
|
|
189
193
|
|
|
190
|
-
Use `--source` to scope where events came from (`pi`, `codex`, `gemini`, `droid`, `opencode`), and `--provider` to scope the billing entity behind those events.
|
|
194
|
+
Use `--source` to scope where events came from (`pi`, `codex`, `gemini`, `droid`, `opencode`, `claude`), and `--provider` to scope the billing entity behind those events.
|
|
191
195
|
|
|
192
196
|
### Custom Paths
|
|
193
197
|
|
|
194
198
|
```bash
|
|
195
199
|
# Custom directories
|
|
196
|
-
llm-usage daily --source-dir pi=/path/to/pi --source-dir codex=/path/to/codex --source-dir gemini=/path/to/.gemini --source-dir droid=/path/to/.factory/sessions
|
|
200
|
+
llm-usage daily --source-dir pi=/path/to/pi --source-dir codex=/path/to/codex --source-dir gemini=/path/to/.gemini --source-dir droid=/path/to/.factory/sessions --source-dir claude=/path/to/.claude/projects
|
|
197
201
|
|
|
198
|
-
# Explicit Gemini/Droid/OpenCode paths
|
|
202
|
+
# Explicit Gemini/Droid/Claude/OpenCode paths
|
|
199
203
|
llm-usage daily --gemini-dir /path/to/.gemini
|
|
200
204
|
llm-usage daily --droid-dir /path/to/.factory/sessions
|
|
205
|
+
llm-usage daily --claude-dir /path/to/.claude/projects
|
|
201
206
|
llm-usage daily --opencode-db /path/to/opencode.db
|
|
202
207
|
```
|
|
203
208
|
|
|
@@ -346,9 +351,15 @@ pnpm cli daily
|
|
|
346
351
|
- **[Optimize](https://ayagmar.github.io/llm-usage-metrics/optimize/)** — Counterfactual candidate-model pricing semantics
|
|
347
352
|
- **[Data Sources](https://ayagmar.github.io/llm-usage-metrics/sources/)** — Source configuration
|
|
348
353
|
- **[Configuration](https://ayagmar.github.io/llm-usage-metrics/configuration/)** — Environment variables
|
|
354
|
+
- **[Security](https://ayagmar.github.io/llm-usage-metrics/security/)** — Current security controls, dependency hygiene, and contributor steps
|
|
349
355
|
- **[Benchmarks](https://ayagmar.github.io/llm-usage-metrics/benchmarks/)** — Production benchmark methodology and results
|
|
350
356
|
- **[Architecture](https://ayagmar.github.io/llm-usage-metrics/architecture/)** — Technical overview
|
|
351
357
|
|
|
358
|
+
## 🔐 Security
|
|
359
|
+
|
|
360
|
+
Current repo protections include exact direct dependency pins, frozen-lockfile installs in CI, committed lockfile integrity hashes, SHA-pinned GitHub Actions, Dependabot for dependency and workflow updates, dedicated security workflows (`pnpm audit`, Dependency Review, and CodeQL), and OIDC-based npm trusted publishing.
|
|
361
|
+
See the full security guide: **[Security](https://ayagmar.github.io/llm-usage-metrics/security/)**.
|
|
362
|
+
|
|
352
363
|
## 🤝 Contributing
|
|
353
364
|
|
|
354
365
|
Contributions are welcome! See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
|