llm-usage-metrics 0.10.1 → 0.11.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.
Files changed (3) hide show
  1. package/README.md +11 -4
  2. package/dist/index.js +1643 -471
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  <h1 align="center">llm-usage-metrics</h1>
6
6
 
7
7
  <p align="center">
8
- Local usage reports for AI coding tools.
8
+ Usage reports for AI coding tools, across all your machines.
9
9
  </p>
10
10
 
11
11
  <p align="center">
@@ -23,10 +23,12 @@
23
23
  <a href="./CONTRIBUTING.md">Contributing</a>
24
24
  </p>
25
25
 
26
- `llm-usage-metrics` reads local session data from 17 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.
26
+ `llm-usage-metrics` reads local session data from 17 AI coding tools, on this machine and on others you reach over ssh, 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.
27
27
 
28
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.
29
29
 
30
+ See [Privacy](https://ayagmar.github.io/llm-usage-metrics/privacy/) for what it reads, stores, and sends over the network.
31
+
30
32
  ## Quick start
31
33
 
32
34
  Requires Node.js 22.16+ or 24+ (Node 23 lacks the SQLite busy timeout the ledger uses), or Bun 1.4+.
@@ -89,7 +91,7 @@ llm-usage session --top 10
89
91
  llm-usage session --by-repo
90
92
 
91
93
  # Last 14 local days as a token series
92
- llm-usage trends --metric tokens --days 14
94
+ llm-usage trends --metric tokens --last 14
93
95
 
94
96
  # Candidate-model pricing against observed usage
95
97
  llm-usage optimize monthly \
@@ -166,6 +168,8 @@ Cost rendering makes incomplete data visible:
166
168
  - `~$12.34` means the known cost is partial.
167
169
  - `-` means no contributing event has a resolved cost.
168
170
 
171
+ When any cost is marked `~`, stderr names how many of the shown events have no known price and their models. `--quiet` and `--no-cost` hide that line.
172
+
169
173
  The pricing request never includes session content. See [Pricing](https://ayagmar.github.io/llm-usage-metrics/pricing/) for rate matching, overrides, and error behavior.
170
174
 
171
175
  ## Local event ledger
@@ -193,6 +197,7 @@ Reports can include your other machines' usage over ssh. Install llm-usage-metri
193
197
  llm-usage machine add laptop # syncs over ssh laptop; see the docs for other destinations
194
198
  llm-usage monthly # this machine and the laptop, fetched when due
195
199
  llm-usage monthly --machine laptop # only the laptop
200
+ llm-usage # the summary splits this month's cost by machine
196
201
  ```
197
202
 
198
203
  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/).
@@ -207,7 +212,7 @@ llm-usage monthly --share
207
212
  llm-usage weekly --last 1 --no-cost
208
213
  ```
209
214
 
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.
215
+ 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. When no table fits, as on a phone, each row is listed as labelled values instead. `--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.
211
216
 
212
217
  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/).
213
218
 
@@ -232,6 +237,8 @@ pnpm run build
232
237
 
233
238
  The website has a [docs overview](https://ayagmar.github.io/llm-usage-metrics/docs/) and a [report chooser](https://ayagmar.github.io/llm-usage-metrics/reports/) for finding the right command. Its landing page and source navigation use the CLI source registry; regenerate CLI and security references after behavior changes.
234
239
 
240
+ For LLMs and agents, the docs are also published as [llms.txt](https://ayagmar.github.io/llm-usage-metrics/llms.txt) (plus `llms-full.txt` with every page inlined).
241
+
235
242
  Site commands:
236
243
 
237
244
  ```bash