llm-usage-metrics 0.9.0 → 0.10.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 +18 -2
- package/dist/bin.js +7 -0
- package/dist/index.js +3099 -1037
- package/package.json +6 -4
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ The CLI parses session content on your machine. It discovers standard source loc
|
|
|
29
29
|
|
|
30
30
|
## Quick start
|
|
31
31
|
|
|
32
|
-
Requires Node.js 22.16+ or 24+ (Node 23 lacks the SQLite busy timeout the ledger uses).
|
|
32
|
+
Requires Node.js 22.16+ or 24+ (Node 23 lacks the SQLite busy timeout the ledger uses), or Bun 1.4+.
|
|
33
33
|
|
|
34
34
|
```bash
|
|
35
35
|
# Run without installing
|
|
@@ -39,6 +39,9 @@ npx --yes llm-usage-metrics@latest
|
|
|
39
39
|
npm install -g llm-usage-metrics
|
|
40
40
|
llm-usage
|
|
41
41
|
|
|
42
|
+
# Or with Bun (--bun runs the CLI on Bun instead of Node)
|
|
43
|
+
bunx --bun llm-usage-metrics@latest
|
|
44
|
+
|
|
42
45
|
# Optional: tab completion (bash shown; zsh and fish work the same way)
|
|
43
46
|
echo 'source <(llm-usage completion bash)' >> ~/.bashrc
|
|
44
47
|
```
|
|
@@ -182,6 +185,18 @@ llm-usage prune --departed-before 2026-01-01 --apply
|
|
|
182
185
|
|
|
183
186
|
Deleting the ledger also deletes retained history. Read [Caching](https://ayagmar.github.io/llm-usage-metrics/caching/) before clearing it as a troubleshooting step.
|
|
184
187
|
|
|
188
|
+
## Multiple machines
|
|
189
|
+
|
|
190
|
+
Reports can include your other machines' usage over ssh. Install llm-usage-metrics there, make sure ssh logs in without a prompt, then:
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
llm-usage machine add laptop # syncs over ssh laptop; see the docs for other destinations
|
|
194
|
+
llm-usage monthly # this machine and the laptop, fetched when due
|
|
195
|
+
llm-usage monthly --machine laptop # only the laptop
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
A session that reached both machines (a copied or synced `~/.claude`) is counted once. See [Multiple machines](https://ayagmar.github.io/llm-usage-metrics/machines/).
|
|
199
|
+
|
|
185
200
|
## Output
|
|
186
201
|
|
|
187
202
|
```bash
|
|
@@ -189,9 +204,10 @@ llm-usage daily --all --json
|
|
|
189
204
|
llm-usage daily --markdown
|
|
190
205
|
llm-usage daily --compact
|
|
191
206
|
llm-usage monthly --share
|
|
207
|
+
llm-usage weekly --last 1 --no-cost
|
|
192
208
|
```
|
|
193
209
|
|
|
194
|
-
Terminal tables fit the terminal width: on a narrow terminal, token counts are abbreviated and less-used columns are hidden, with a `stderr` note saying what was left out. `--compact` asks for the short table directly.
|
|
210
|
+
Terminal tables fit the terminal width: on a narrow terminal, token counts are abbreviated and less-used columns are hidden, with a `stderr` note saying what was left out. `--compact` asks for the short table directly. `--last N` covers the last N days, weeks, or months, counting the current one, and `--no-cost` leaves spend out of tables and share cards.
|
|
195
211
|
|
|
196
212
|
Report data goes to `stdout`. Diagnostics go to `stderr` as one summary line plus any warnings, which keeps JSON and Markdown safe to redirect; `--quiet` keeps only warnings and `--verbose` adds per-source and skipped-row detail. 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/).
|
|
197
213
|
|