llm-usage-metrics 0.7.1 → 0.8.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
@@ -1,374 +1,215 @@
1
- <div align="center">
1
+ <p align="center">
2
+ <img src="https://ayagmar.github.io/llm-usage-metrics/favicon.svg" width="72" height="72" alt="LLM Usage Metrics logo">
3
+ </p>
2
4
 
3
- <img src="https://ayagmar.github.io/llm-usage-metrics/favicon.svg" width="64" height="64" alt="llm-usage-metrics logo">
5
+ <h1 align="center">llm-usage-metrics</h1>
4
6
 
5
- # llm-usage-metrics
7
+ <p align="center">
8
+ Local usage reports for AI coding tools.
9
+ </p>
6
10
 
7
- **Track and analyze your local LLM usage across coding agents**
11
+ <p align="center">
12
+ <a href="https://www.npmjs.com/package/llm-usage-metrics"><img src="https://img.shields.io/npm/v/llm-usage-metrics.svg?style=flat-square&color=b65331" alt="npm version"></a>
13
+ <a href="https://www.npmjs.com/package/llm-usage-metrics"><img src="https://img.shields.io/npm/dt/llm-usage-metrics.svg?style=flat-square&color=5f655b" alt="npm downloads"></a>
14
+ <a href="https://github.com/ayagmar/llm-usage-metrics/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/ayagmar/llm-usage-metrics/ci.yml?style=flat-square&label=CI" alt="CI status"></a>
15
+ <a href="https://codecov.io/gh/ayagmar/llm-usage-metrics"><img src="https://img.shields.io/codecov/c/github/ayagmar/llm-usage-metrics?style=flat-square" alt="test coverage"></a>
16
+ <a href="https://deepwiki.com/ayagmar/llm-usage-metrics"><img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki"></a>
17
+ </p>
8
18
 
9
- [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/ayagmar/llm-usage-metrics)
10
- [![npm version](https://img.shields.io/npm/v/llm-usage-metrics.svg?style=flat-square&color=0ea5e9)](https://www.npmjs.com/package/llm-usage-metrics)
11
- [![npm downloads](https://img.shields.io/npm/dt/llm-usage-metrics.svg?style=flat-square&color=10b981)](https://www.npmjs.com/package/llm-usage-metrics)
12
- [![CI](https://img.shields.io/github/actions/workflow/status/ayagmar/llm-usage-metrics/ci.yml?style=flat-square&label=CI)](https://github.com/ayagmar/llm-usage-metrics/actions/workflows/ci.yml)
13
- [![Coverage](https://img.shields.io/codecov/c/github/ayagmar/llm-usage-metrics?style=flat-square)](https://codecov.io/gh/ayagmar/llm-usage-metrics)
19
+ <p align="center">
20
+ <a href="https://ayagmar.github.io/llm-usage-metrics/">Documentation</a> ·
21
+ <a href="https://ayagmar.github.io/llm-usage-metrics/getting-started/">Getting started</a> ·
22
+ <a href="https://ayagmar.github.io/llm-usage-metrics/cli-reference/">CLI reference</a> ·
23
+ <a href="./CONTRIBUTING.md">Contributing</a>
24
+ </p>
14
25
 
15
- [📖 Documentation](https://ayagmar.github.io/llm-usage-metrics/) ·
16
- [⚡ Quick Start](#quick-start) ·
17
- [📊 Examples](#usage) ·
18
- [🤝 Contributing](./CONTRIBUTING.md)
26
+ `llm-usage-metrics` reads local session data from 16 AI coding tools and converts it into one normalized usage history. Use it to review tokens and estimated cost, compare periods, find expensive sessions, correlate usage with local Git activity, or export the result.
19
27
 
20
- </div>
28
+ The CLI parses session content on your machine. It discovers standard source locations and includes a bundled pricing snapshot, so the first report can run without configuration or network access.
21
29
 
22
- ---
30
+ ## Quick start
23
31
 
24
- Aggregate token usage and costs from your local coding agent sessions. Supports **pi**, **codex**, **Gemini CLI**, **Droid CLI**, and **OpenCode** with zero configuration required.
25
-
26
- ## ✨ Features
27
-
28
- - **Zero-Config Discovery** — Automatically finds `.pi`, `.codex`, `.gemini`, `.factory`, and OpenCode session data
29
- - **LiteLLM Pricing** — Real-time pricing sync with offline caching support
30
- - **Flexible Reports** — Daily, weekly, and monthly aggregations
31
- - **Efficiency Reports** — Correlate cost/tokens with repository commit outcomes
32
- - **Optimize Reports** — Counterfactual candidate-model pricing against observed token mix
33
- - **Trends Reports** — Daily cost or token trend views with combined or per-source output
34
- - **Multiple Outputs** — Terminal tables, JSON, or Markdown
35
- - **Smart Filtering** — By source, billing provider, model, and date ranges
36
-
37
- ## 🚀 Quick Start
32
+ Requires Node.js 24 or newer.
38
33
 
39
34
  ```bash
40
- # Install globally
41
- npm install -g llm-usage-metrics
42
-
43
- # Or run without installing
44
- npx llm-usage-metrics@latest daily
35
+ # Run without installing
36
+ npx --yes llm-usage-metrics@latest daily
45
37
 
46
- # Generate your first report
38
+ # Or install the llm-usage command
39
+ npm install -g llm-usage-metrics
47
40
  llm-usage daily
48
41
  ```
49
42
 
50
- <div align="center">
51
-
52
- ![Terminal output showing token usage and cost breakdown](https://ayagmar.github.io/llm-usage-metrics/screenshot.png)
53
-
54
- </div>
55
-
56
- ## 📋 Supported Sources
57
-
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 |
66
-
67
- OpenCode source support requires Node.js 24+ runtime with built-in `node:sqlite`.
68
-
69
- For `droid`, `Input`, `Output`, `Reasoning`, `Cache Read`, and `Cache Write` come directly from session files, and `totalTokens` is billable raw tokens (`Input + Output + Cache Read + Cache Write`, excluding `Reasoning`). Factory dashboard totals may differ because Factory applies standard-token normalization/multipliers.
70
-
71
- ## 🎯 Usage
72
-
73
- ### Basic Reports
43
+ If the report is empty, check source discovery:
74
44
 
75
45
  ```bash
76
- # Daily report (default terminal table)
77
- llm-usage daily
78
-
79
- # Weekly with timezone
80
- llm-usage weekly --timezone Europe/Paris
81
-
82
- # Monthly date range
83
- llm-usage monthly --since 2026-01-01 --until 2026-01-31
46
+ llm-usage doctor
84
47
  ```
85
48
 
86
- ### Output Formats
87
-
88
- ```bash
89
- # JSON for pipelines
90
- llm-usage daily --json
91
-
92
- # Markdown for documentation
93
- llm-usage daily --markdown
94
-
95
- # Detailed per-model breakdown
96
- llm-usage monthly --per-model-columns
97
-
98
- # Write a share SVG image
99
- llm-usage monthly --share
100
- ```
49
+ ## Reports
101
50
 
102
- Usage tables rank per-period model breakdowns by total tokens so the dominant models appear first in terminal and Markdown output.
51
+ | Question | Command |
52
+ | --------------------------------------------------------- | ----------------------------------------- |
53
+ | How much did I use by day, week, or month? | `llm-usage daily`, `weekly`, `monthly` |
54
+ | How did one period change from another? | `llm-usage compare` |
55
+ | Which conversations or repositories used the most? | `llm-usage session` |
56
+ | How is daily usage moving? | `llm-usage trends` |
57
+ | How does repo-attributed usage line up with Git activity? | `llm-usage efficiency monthly` |
58
+ | What would the same token mix cost on another model? | `llm-usage optimize monthly` |
59
+ | What did the year add up to? | `llm-usage wrapped` |
60
+ | How do I get the raw normalized events out? | `llm-usage events` |
61
+ | Which sources and local stores are healthy? | `llm-usage doctor` |
62
+ | Which departed files can leave the event ledger? | `llm-usage prune` |
63
+ | What configuration is active, and which file is it from? | `llm-usage config show`, `config path` |
64
+ | Which JSON Schema does my installed version emit? | `llm-usage schema usage`, `schema --list` |
103
65
 
104
- ### Trends
66
+ Common examples:
105
67
 
106
68
  ```bash
107
- # Last 30 local days of cost by default
108
- llm-usage trends
109
-
110
- # Token trends for the last 7 days
111
- llm-usage trends --metric tokens --days 7
69
+ # A chosen calendar range
70
+ llm-usage monthly --since 2026-06-01 --until 2026-06-30
112
71
 
113
- # Per-source trends in JSON
114
- llm-usage trends --by-source --json
115
- ```
72
+ # Current local month compared with the previous month
73
+ llm-usage compare
116
74
 
117
- Trends is terminal-first and supports `--json`. It does not support `--markdown` or `--share`.
75
+ # Ten highest-cost conversations
76
+ llm-usage session --top 10
118
77
 
119
- ### Efficiency Reports
120
-
121
- ```bash
122
- # Daily efficiency in current repository
123
- llm-usage efficiency daily
78
+ # Usage grouped by repository
79
+ llm-usage session --by-repo
124
80
 
125
- # Weekly efficiency for a specific repository path
126
- llm-usage efficiency weekly --repo-dir /path/to/repo
81
+ # Last 14 local days as a token series
82
+ llm-usage trends --metric tokens --days 14
127
83
 
128
- # Include merge commits and export JSON
129
- llm-usage efficiency monthly --include-merge-commits --json
84
+ # Candidate-model pricing against observed usage
85
+ llm-usage optimize monthly \
86
+ --provider openai \
87
+ --candidate-model gpt-4.1 \
88
+ --candidate-model gpt-5-codex
130
89
 
131
- # Write a monthly share SVG
132
- llm-usage efficiency monthly --share
90
+ # Normalized events as JSONL, e.g. total tokens per line via jq
91
+ llm-usage events --since 2026-06-01 | jq '.totalTokens'
133
92
  ```
134
93
 
135
- Efficiency reports are repo-attributed: usage events are mapped to a Git repository root using source metadata (`cwd`/path info), and only events attributed to the selected repo are included in efficiency totals.
94
+ ## Supported sources
136
95
 
137
- #### Reading efficiency output
96
+ | Source | Local format |
97
+ | ---------------------- | ------------- |
98
+ | pi | JSONL |
99
+ | codex | JSONL |
100
+ | Gemini CLI | JSON |
101
+ | Droid CLI | settings JSON |
102
+ | OpenCode | SQLite |
103
+ | OpenClaw | JSONL |
104
+ | Claude Code | JSONL |
105
+ | GitHub Copilot CLI | OTEL JSONL |
106
+ | Goose | SQLite |
107
+ | Amp | JSON |
108
+ | Qwen CLI | JSONL |
109
+ | Kimi CLI and Kimi Code | wire JSONL |
110
+ | Cline | task JSON |
111
+ | RooCode | task JSON |
112
+ | KiloCode | task JSON |
113
+ | Antigravity | SQLite |
138
114
 
139
- - `Commits`, `+Lines`, `-Lines`, `ΔLines` come from local Git shortstat outcomes (for your configured Git author).
140
- - `Input`, `Output`, `Reasoning`, `Cache Read`, `Cache Write`, `Total`, and `Cost` come from repo-attributed usage events.
141
- - `Tokens/Commit` uses `(Input + Output + Reasoning) / Commits` and excludes cache read/write tokens.
142
- - `$/Commit` uses `Cost / Commits`.
143
- - `$/1k Lines` uses `Cost / (ΔLines / 1000)`.
144
- - `Commits/$` uses `Commits / Cost` (shown only when `Cost > 0`).
115
+ Each source adapter owns discovery and source-specific token normalization. Reports operate on the same `UsageEvent` shape after parsing. The [source documentation](https://ayagmar.github.io/llm-usage-metrics/sources/) lists default paths, override flags, and adapter-specific semantics.
145
116
 
146
- Efficiency period rows are emitted only when both Git outcomes and repo-attributed usage signal exist for that period.
147
- When a denominator is zero, derived values in emitted rows render as `-`.
148
- When pricing is incomplete, terminal/markdown output prefixes affected USD metrics with `~`.
117
+ SQLite-backed sources use the built-in `node:sqlite` module.
149
118
 
150
- For source-by-source comparisons, run the same report per source:
119
+ ## Filters and configuration
151
120
 
152
121
  ```bash
153
- llm-usage efficiency monthly --repo-dir /path/to/repo --source pi
154
- llm-usage efficiency monthly --repo-dir /path/to/repo --source codex
155
- llm-usage efficiency monthly --repo-dir /path/to/repo --source gemini
156
- llm-usage efficiency monthly --repo-dir /path/to/repo --source droid
157
- llm-usage efficiency monthly --repo-dir /path/to/repo --source opencode
158
- llm-usage efficiency monthly --repo-dir /path/to/repo --source claude
159
- ```
160
-
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.
162
-
163
- ### Optimize Reports
164
-
165
- ```bash
166
- # Counterfactual pricing across candidate models
167
- llm-usage optimize monthly --provider openai --candidate-model gpt-4.1 --candidate-model gpt-5-codex
168
-
169
- # Keep only the cheapest candidate in JSON output
170
- llm-usage optimize weekly --provider openai --candidate-model gpt-4.1,gpt-5-codex --top 1 --json
171
-
172
- # Write a monthly share SVG
173
- llm-usage optimize monthly --provider openai --candidate-model gpt-4.1 --candidate-model gpt-5-codex --share
174
- ```
175
-
176
- `--provider` filters by billing entity. Provider aliases are normalized to billing roots (for example, `openai-codex` is treated as `openai`).
177
-
178
- ### Filtering
122
+ # Filter by source tool
123
+ llm-usage monthly --source codex,claude
179
124
 
180
- ```bash
181
- # By source
182
- llm-usage monthly --source pi,codex,gemini,droid,claude
183
-
184
- # By provider
125
+ # Filter by normalized billing provider
185
126
  llm-usage monthly --provider openai
186
127
 
187
- # By model
188
- llm-usage monthly --model claude
189
-
190
- # Combined filters
191
- llm-usage monthly --source opencode --provider openai --model gpt-4.1
192
- ```
193
-
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.
128
+ # Filter by exact model or substring
129
+ llm-usage monthly --model codex
195
130
 
196
- ### Custom Paths
197
-
198
- ```bash
199
- # Custom directories
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
201
-
202
- # Explicit Gemini/Droid/Claude/OpenCode paths
203
- llm-usage daily --gemini-dir /path/to/.gemini
204
- llm-usage daily --droid-dir /path/to/.factory/sessions
205
- llm-usage daily --claude-dir /path/to/.claude/projects
206
- llm-usage daily --opencode-db /path/to/opencode.db
131
+ # Create a commented TOML config with editor schema support
132
+ llm-usage config init
207
133
  ```
208
134
 
209
- ### Offline Mode
210
-
211
- ```bash
212
- # Use cached pricing only
213
- llm-usage monthly --pricing-offline
214
-
215
- # Continue even if pricing fetch fails
216
- llm-usage monthly --ignore-pricing-failures
217
-
218
- # Override per-model pricing from a local JSON file
219
- llm-usage monthly --pricing-overrides ./pricing-overrides.json
220
- ```
135
+ `--source` identifies the tool that wrote an event. `--provider` identifies the billing entity behind its model. A Codex session can have `source=codex` and `provider=openai`.
221
136
 
222
- ## 🧪 Production Benchmarks
137
+ The config precedence order is CLI flags, environment variables, TOML config, then built-in defaults. See [Configuration](https://ayagmar.github.io/llm-usage-metrics/configuration/) for every key and source path override.
223
138
 
224
- Benchmarked on **February 27, 2026** on a local production machine:
139
+ ## Pricing
225
140
 
226
- - OS: CachyOS (Linux 6.19.2-2-cachyos)
227
- - CPU: Intel Core Ultra 9 185H (22 logical CPUs)
228
- - RAM: 62 GiB
229
- - Storage: NVMe SSD
141
+ The CLI keeps a valid cost supplied by a source. When a source has no cost, it estimates one from LiteLLM pricing.
230
142
 
231
- Compared scenarios:
143
+ Pricing loads from a fresh cache, a network refresh, a stale cache, or the bundled snapshot. Use offline mode to skip the network request:
232
144
 
233
145
  ```bash
234
- # direct source-to-source parity (openai provider)
235
- ccusage-codex monthly
236
- llm-usage monthly --provider openai --source codex
237
-
238
- # multi-source comparison for one provider (openai)
239
- ccusage-codex monthly
240
- llm-usage monthly --provider openai --source pi,codex,gemini,opencode
146
+ llm-usage monthly --pricing-offline
241
147
  ```
242
148
 
243
- Timed benchmark summary (5 runs per scenario).
149
+ Cost rendering makes incomplete data visible:
244
150
 
245
- Direct source-to-source parity (`--source codex`):
151
+ - `$12.34` means the full row has resolved cost.
152
+ - `~$12.34` means the known cost is partial.
153
+ - `-` means no contributing event has a resolved cost.
246
154
 
247
- | Tool | Cache mode | Median (s) | Mean (s) |
248
- | ---------------------------------------------------------------------- | ---------- | ---------: | -------: |
249
- | `ccusage-codex monthly` | no cache | 16.785 | 17.288 |
250
- | `ccusage-codex monthly --offline` | with cache | 16.995 | 17.594 |
251
- | `llm-usage monthly --provider openai --source codex` | no cache | 3.651 | 3.760 |
252
- | `llm-usage monthly --provider openai --source codex --pricing-offline` | with cache | 0.746 | 0.724 |
155
+ The pricing request never includes session content. See [Pricing](https://ayagmar.github.io/llm-usage-metrics/pricing/) for rate matching, overrides, and error behavior.
253
156
 
254
- Speedups (median): `4.60x` faster cold, `22.78x` faster cached.
157
+ ## Local event ledger
255
158
 
256
- Multi-source OpenAI (`--source pi,codex,gemini,opencode`):
257
-
258
- | Tool | Cache mode | Median (s) | Mean (s) |
259
- | ----------------------------------------------------------------------------------------- | ---------- | ---------: | -------: |
260
- | `ccusage-codex monthly` | no cache | 17.297 | 17.463 |
261
- | `ccusage-codex monthly --offline` | with cache | 16.698 | 16.745 |
262
- | `llm-usage monthly --provider openai --source pi,codex,gemini,opencode` | no cache | 4.767 | 4.864 |
263
- | `llm-usage monthly --provider openai --source pi,codex,gemini,opencode --pricing-offline` | with cache | 0.941 | 0.951 |
264
-
265
- Speedups (median): `3.63x` faster cold, `17.75x` faster cached.
266
-
267
- Full methodology, cache-mode definition, and scope caveats are documented in the Astro docs: [Benchmarks](https://ayagmar.github.io/llm-usage-metrics/benchmarks/).
268
-
269
- Re-run direct parity benchmark locally:
159
+ A SQLite event ledger stores normalized events and parse diagnostics. Unchanged files can skip parsing on later runs. The ledger also supports retained history for files that have left the disk:
270
160
 
271
161
  ```bash
272
- pnpm run perf:production-benchmark -- --runs 5 --llm-source codex
162
+ llm-usage monthly --history
273
163
  ```
274
164
 
275
- Re-run multi-source OpenAI benchmark locally:
165
+ `prune` is a dry run unless you pass `--apply`:
276
166
 
277
167
  ```bash
278
- pnpm run perf:production-benchmark -- --runs 5 --llm-source pi,codex,gemini,opencode
168
+ llm-usage prune --suppressed
169
+ llm-usage prune --departed-before 2026-01-01 --apply
279
170
  ```
280
171
 
281
- Generate machine-readable artifacts:
172
+ Deleting the ledger also deletes retained history. Read [Caching](https://ayagmar.github.io/llm-usage-metrics/caching/) before clearing it as a troubleshooting step.
173
+
174
+ ## Output
282
175
 
283
176
  ```bash
284
- pnpm run perf:production-benchmark -- \
285
- --runs 5 \
286
- --llm-source codex \
287
- --json-output ./tmp/production-benchmark-openai-codex.json \
288
- --markdown-output ./tmp/production-benchmark-openai-codex.md
289
-
290
- pnpm run perf:production-benchmark -- \
291
- --runs 5 \
292
- --llm-source pi,codex,gemini,opencode \
293
- --json-output ./tmp/production-benchmark-openai-multi-source.json \
294
- --markdown-output ./tmp/production-benchmark-openai-multi-source.md
177
+ llm-usage daily --json
178
+ llm-usage daily --markdown
179
+ llm-usage monthly --share
295
180
  ```
296
181
 
297
- ## ⚙️ Configuration
298
-
299
- ### Environment Variables
300
-
301
- | Variable | Description |
302
- | -------------------------------- | ---------------------------------- |
303
- | `LLM_USAGE_SKIP_UPDATE_CHECK` | Skip update check (`1`) |
304
- | `LLM_USAGE_UPDATE_CACHE_SCOPE` | Update cache scope |
305
- | `LLM_USAGE_PRICING_CACHE_TTL_MS` | Pricing cache duration |
306
- | `LLM_USAGE_PARSE_MAX_PARALLEL` | Max parallel file parses (`1-64`) |
307
- | `LLM_USAGE_PARSE_CACHE_ENABLED` | Enable parse cache (`1/0`) |
308
- | `LLM_USAGE_PROFILE_RUNTIME` | Emit runtime profiling diagnostics |
182
+ Report data goes to `stdout`. Discovery, pricing, config, and skipped-row diagnostics go to `stderr`, which keeps JSON and Markdown safe to redirect. JSON output is wrapped in a versioned envelope: `{ "schemaVersion": 1, "report": "usage", "data": ... }`. Scripts written against pre-0.8.0 JSON should follow the [migration guide](https://ayagmar.github.io/llm-usage-metrics/migrating-to-0-8/).
309
183
 
310
- Parse cache is source-sharded on disk (`parse-file-cache.<source>.json`) so source-scoped runs avoid loading unrelated cache blobs.
184
+ Terminal, JSON, and Markdown availability varies by report. Usage, trends, wrapped, efficiency, and optimize can write supported share SVGs. The [output guide](https://ayagmar.github.io/llm-usage-metrics/output-formats/) contains the format matrix and file names.
311
185
 
312
- See full environment variable reference in the [documentation](https://ayagmar.github.io/llm-usage-metrics/configuration/).
186
+ ## Performance
313
187
 
314
- ### Update Checks
188
+ The repository publishes absolute cold and warm runtimes on real local corpora. The comparison includes the runs where `ccusage` is faster and the warm Claude run where the event ledger is faster. It also records the machine, commands, cache state, dataset size, and five-run distribution.
315
189
 
316
- The CLI performs lightweight update checks with smart defaults:
317
-
318
- - 1-hour cache TTL
319
- - Fresh cached update results are used immediately without any network call
320
- - Stale or missing cache triggers a bounded fetch (default 1s timeout) so the update prompt stays consistent across commands, instead of silently skipping the run that refreshes the cache
321
- - Skipped for `--help`, `--version`, `npx`, and direct source/development runs
322
- - Prompts only in interactive TTY sessions
323
-
324
- Disable with:
325
-
326
- ```bash
327
- LLM_USAGE_SKIP_UPDATE_CHECK=1 llm-usage daily
328
- ```
190
+ Read and reproduce the [benchmark](https://ayagmar.github.io/llm-usage-metrics/benchmarks/) before applying its results to another workload.
329
191
 
330
- ## 🛠️ Development
192
+ ## Development
331
193
 
332
194
  ```bash
333
- # Install dependencies
334
195
  pnpm install
335
-
336
- # Run quality checks
337
196
  pnpm run lint
338
197
  pnpm run typecheck
339
198
  pnpm run test
340
199
  pnpm run format:check
341
-
342
- # Build
343
200
  pnpm run build
344
-
345
- # Run locally
346
- pnpm cli daily
347
201
  ```
348
202
 
349
- ## 📚 Documentation
350
-
351
- - **[Getting Started](https://ayagmar.github.io/llm-usage-metrics/getting-started/)** — Installation and first steps
352
- - **[CLI Reference](https://ayagmar.github.io/llm-usage-metrics/cli-reference/)** — Complete command reference
353
- - **[Efficiency](https://ayagmar.github.io/llm-usage-metrics/efficiency/)** — Efficiency report semantics and interpretation
354
- - **[Optimize](https://ayagmar.github.io/llm-usage-metrics/optimize/)** — Counterfactual candidate-model pricing semantics
355
- - **[Data Sources](https://ayagmar.github.io/llm-usage-metrics/sources/)** — Source configuration
356
- - **[Configuration](https://ayagmar.github.io/llm-usage-metrics/configuration/)** — Environment variables
357
- - **[Security](https://ayagmar.github.io/llm-usage-metrics/security/)** — Current security controls, dependency hygiene, and contributor steps
358
- - **[Benchmarks](https://ayagmar.github.io/llm-usage-metrics/benchmarks/)** — Production benchmark methodology and results
359
- - **[Architecture](https://ayagmar.github.io/llm-usage-metrics/architecture/)** — Technical overview
360
-
361
- ## 🔐 Security
203
+ Site commands:
362
204
 
363
- 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.
364
- See the full security guide: **[Security](https://ayagmar.github.io/llm-usage-metrics/security/)**.
365
-
366
- ## 🤝 Contributing
367
-
368
- Contributions are welcome! See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
205
+ ```bash
206
+ pnpm run site:check
207
+ pnpm run site:build
208
+ pnpm run site:dev
209
+ ```
369
210
 
370
- The codebase is structured to add more sources through the `SourceAdapter` pattern.
211
+ See [CONTRIBUTING.md](./CONTRIBUTING.md) and [docs/development.md](./docs/development.md) for the contributor workflow.
371
212
 
372
- ## 📄 License
213
+ ## License
373
214
 
374
- MIT © [Abdeslam Yagmar](https://github.com/ayagmar)
215
+ [MIT](./LICENSE)