@xerg/cli 0.5.1 → 0.5.3

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xerg/cli",
3
- "version": "0.5.1",
4
- "description": "Audit OpenClaw and Hermes workflows in dollars, compare fixes, and export daily spend and waste trends.",
3
+ "version": "0.5.3",
4
+ "description": "Audit OpenClaw, Hermes, and Cursor spend in dollars with provenance-aware waste findings and compare output.",
5
5
  "keywords": [
6
6
  "xerg",
7
7
  "ai",
@@ -13,7 +13,8 @@
13
13
  "cost",
14
14
  "cli",
15
15
  "cursor",
16
- "analytics"
16
+ "analytics",
17
+ "provenance"
17
18
  ],
18
19
  "homepage": "https://xerg.ai",
19
20
  "repository": {
@@ -36,8 +37,11 @@
36
37
  },
37
38
  "files": ["dist", "README.md", "LICENSE", "skills"],
38
39
  "main": "./dist/index.js",
40
+ "browser": "./dist/browser.js",
39
41
  "exports": {
40
42
  ".": {
43
+ "browser": "./dist/browser.js",
44
+ "node": "./dist/index.js",
41
45
  "default": "./dist/index.js"
42
46
  }
43
47
  },
@@ -52,8 +56,8 @@
52
56
  "typecheck": "tsc --noEmit -p tsconfig.json"
53
57
  },
54
58
  "dependencies": {
55
- "@inquirer/prompts": "^8.4.1",
56
- "better-sqlite3": "^11.10.0"
59
+ "@inquirer/confirm": "^6.1.1",
60
+ "@inquirer/select": "^5.2.1"
57
61
  },
58
62
  "devDependencies": {
59
63
  "@xerg/schemas": "workspace:*",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: xerg
3
- description: Audit OpenClaw and Hermes workflows in dollars. Local-first audits with init, compare mode, OpenClaw remote support, CI gates, and optional hosted follow-up.
3
+ description: Audit OpenClaw, Hermes, and Cursor spend in dollars. Local-first audits with provenance-aware findings, compare mode, OpenClaw remote support, CI gates, and optional hosted follow-up.
4
4
  homepage: https://xerg.ai
5
5
  metadata:
6
6
  openclaw:
@@ -48,7 +48,7 @@ metadata:
48
48
 
49
49
  Use `xerg` if it is already installed. If not, use `npx @xerg/cli` with the same arguments.
50
50
 
51
- Xerg audits OpenClaw and Hermes workflows in dollars, not tokens. It reads gateway logs and session transcripts, surfaces confirmed waste plus savings opportunities, and helps you measure fixes with `--compare`.
51
+ Xerg audits OpenClaw, Hermes, and Cursor spend in dollars, not tokens. It reads gateway logs, session transcripts, and Cursor usage exports, surfaces provenance-aware confirmed waste plus savings opportunities, and helps you measure fixes with `--compare`.
52
52
 
53
53
  Local audits need no account. Hosted sync and hosted MCP are optional paid workspace features. No data leaves your machine unless you explicitly push results to Xerg Cloud.
54
54
 
@@ -66,6 +66,7 @@ Use direct commands when you need explicit control, non-interactive behavior, JS
66
66
  ```bash
67
67
  xerg doctor
68
68
  xerg audit
69
+ xerg audit --cursor-usage-csv ./cursor-usage.csv
69
70
  xerg audit --json
70
71
  xerg audit --fail-above-waste-rate 0.30
71
72
  ```
@@ -80,6 +81,7 @@ Xerg needs one of these source inputs:
80
81
  - Local Hermes data at the default paths:
81
82
  - `~/.hermes/logs/agent.log*` with `gateway.log*` fallback
82
83
  - `~/.hermes/sessions/`
84
+ - An exported Cursor usage CSV via `--cursor-usage-csv`
83
85
  - Explicit paths via `--log-file` and/or `--sessions-dir`
84
86
  - An SSH target via `--remote`
85
87
  - A Railway target via `--railway`
@@ -89,16 +91,19 @@ Additional requirements:
89
91
 
90
92
  - `--compare` needs at least one previously stored compatible local snapshot
91
93
  - Pushing needs auth via `XERG_API_KEY`, `~/.xerg/config.json`, or browser credentials from `xerg login`
94
+ - Cursor audits require an explicit exported usage CSV path
92
95
  - SSH audits require `ssh` and `rsync` on your local `PATH` and are OpenClaw-only in this phase
93
96
  - Railway audits require the `railway` CLI on your local `PATH` and are OpenClaw-only in this phase
94
97
 
95
98
  ## Security And Data Flow
96
99
 
97
- Default `doctor`, `init`, `audit`, `--compare`, `--json`, and `--markdown` commands analyze data on the local machine. They read OpenClaw, Hermes, or Cursor usage files, compute economic summaries, print reports, and may write local SQLite snapshots for future comparison.
100
+ Default `doctor`, `init`, `audit`, `--compare`, `--json`, and `--markdown` commands analyze data on the local machine. They read OpenClaw, Hermes, or Cursor usage files, compute economic summaries, print reports, and may write local JSON snapshots for future comparison.
98
101
 
99
102
  Remote OpenClaw audits over SSH, Railway, or `--remote-config` pull selected gateway logs and session files to local temporary storage, then run the same local audit engine. These flows require the corresponding remote transport credentials already configured on the machine.
100
103
 
101
- Hosted sync is opt-in. `connect`, `audit --push`, `push`, and `mcp-setup` use `XERG_API_KEY`, `~/.xerg/config.json`, or browser login credentials only for Xerg Cloud actions. The push payload contains audit totals, daily rollups, findings, recommendations, comparison deltas, and source metadata; it does not include raw prompt or response content, local source file paths, local database paths, or internal finding details.
104
+ Hosted sync is opt-in. `connect`, `audit --push`, `push`, and `mcp-setup` use `XERG_API_KEY`, `~/.xerg/config.json`, or browser login credentials only for Xerg Cloud actions. The push payload contains audit totals, daily rollups, findings, recommendations, comparison deltas, and source metadata; it does not include raw prompt or response content, local source file paths, local snapshot store paths, or internal finding details.
105
+
106
+ Local JSON findings may include `signalSource`, `ruleId`, and evidence references. Use those fields to distinguish observed signals from inferred or legacy unknown provenance. These provenance fields are local-only in this release and are not part of the pushed v2 wire payload.
102
107
 
103
108
  ## Default Flow
104
109
 
@@ -131,6 +136,7 @@ xerg doctor --railway
131
136
  xerg audit
132
137
  xerg audit --runtime openclaw
133
138
  xerg audit --runtime hermes
139
+ xerg audit --cursor-usage-csv ./cursor-usage.csv
134
140
  ```
135
141
 
136
142
  4. Choose the right output mode for the task:
@@ -183,6 +189,7 @@ xerg audit --runtime openclaw --log-file /path/to/openclaw.log
183
189
  xerg audit --runtime openclaw --sessions-dir /path/to/sessions
184
190
  xerg audit --runtime hermes --log-file ~/.hermes/logs/agent.log
185
191
  xerg audit --runtime hermes --sessions-dir ~/.hermes/sessions
192
+ xerg audit --cursor-usage-csv ./cursor-usage.csv
186
193
  ```
187
194
 
188
195
  SSH remote:
@@ -274,6 +281,8 @@ Current recommendation kinds map into the Action queue buckets:
274
281
 
275
282
  Prefer high-confidence or reversible fixes first. Treat model downgrades, context changes, and Cursor behavior changes as compare-friendly experiments, not guaranteed savings.
276
283
 
284
+ For `--compare`, prefer the normalized rows first: waste rate, waste per run, waste per 1k calls, and inferred waste share when available. Absolute spend and waste deltas are still useful, but they are workload-dependent when run or call volume changed.
285
+
277
286
  ## Checks
278
287
 
279
288
  Before finalizing work that used Xerg:
@@ -284,11 +293,13 @@ Before finalizing work that used Xerg:
284
293
  - If no data was found, run `xerg doctor` or use explicit source flags rather than guessing
285
294
  - Say whether results were pushed to the Xerg API
286
295
  - Distinguish confirmed waste (`retry-waste`, `loop-waste`) from directional opportunities (`context-outlier`, `idle-spend`, `candidate-downgrade`)
296
+ - Mention inferred or unknown provenance when it materially affects confidence in the finding or compare result
287
297
 
288
298
  ## Notes
289
299
 
290
300
  - `--compare` and `--no-db` cannot be used together
291
301
  - Xerg is local-first: it stores economic metadata and audit snapshots locally, not prompt or response content
302
+ - Local provenance fields are intentionally not part of the pushed v2 payload yet
292
303
  - `XERG_API_KEY` is recommended for CI and non-interactive automation
293
304
  - If browser auth is needed without the hosted setup flow, use `xerg login`; remove stored credentials with `xerg logout`
294
305
  - Pilot: [xerg.ai/pilot](https://xerg.ai/pilot)