@xerg/cli 0.3.0 → 0.5.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 +65 -36
- package/dist/index.js +1069 -397
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/skills/xerg/SKILL.md +48 -20
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xerg/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Audit OpenClaw and Hermes workflows in dollars, compare fixes, and export daily spend and waste trends.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"xerg",
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
+
"@inquirer/prompts": "^8.4.1",
|
|
55
56
|
"better-sqlite3": "^11.10.0"
|
|
56
57
|
},
|
|
57
58
|
"devDependencies": {
|
package/skills/xerg/SKILL.md
CHANGED
|
@@ -1,23 +1,30 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: xerg
|
|
3
|
-
description: Audit OpenClaw and Hermes workflows in dollars. Local-first audits with compare mode, OpenClaw remote support, CI gates, and
|
|
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.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Xerg
|
|
7
7
|
|
|
8
8
|
Use `xerg` if it is already installed. If not, use `npx @xerg/cli` with the same arguments.
|
|
9
9
|
|
|
10
|
-
Xerg audits OpenClaw and Hermes workflows in dollars, not tokens. It reads gateway logs and session transcripts, surfaces
|
|
10
|
+
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`.
|
|
11
11
|
|
|
12
|
-
Local audits need no account. No data leaves your machine unless you explicitly
|
|
12
|
+
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.
|
|
13
13
|
|
|
14
14
|
## Quick Start
|
|
15
15
|
|
|
16
|
+
```bash
|
|
17
|
+
xerg init
|
|
18
|
+
xerg audit --compare
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Use direct commands when you need explicit control, non-interactive behavior, JSON output, or CI gates:
|
|
22
|
+
|
|
16
23
|
```bash
|
|
17
24
|
xerg doctor
|
|
18
|
-
xerg doctor --verbose
|
|
19
25
|
xerg audit
|
|
20
|
-
xerg audit --
|
|
26
|
+
xerg audit --json
|
|
27
|
+
xerg audit --fail-above-waste-rate 0.30
|
|
21
28
|
```
|
|
22
29
|
|
|
23
30
|
## Inputs
|
|
@@ -38,13 +45,24 @@ Xerg needs one of these source inputs:
|
|
|
38
45
|
Additional requirements:
|
|
39
46
|
|
|
40
47
|
- `--compare` needs at least one previously stored compatible local snapshot
|
|
41
|
-
- Pushing needs auth via `XERG_API_KEY`, `~/.xerg/config.json`, or `xerg login`
|
|
48
|
+
- Pushing needs auth via `XERG_API_KEY`, `~/.xerg/config.json`, or browser credentials from `xerg login`
|
|
42
49
|
- SSH audits require `ssh` and `rsync` on your local `PATH` and are OpenClaw-only in this phase
|
|
43
50
|
- Railway audits require the `railway` CLI on your local `PATH` and are OpenClaw-only in this phase
|
|
44
51
|
|
|
45
52
|
## Default Flow
|
|
46
53
|
|
|
47
|
-
1.
|
|
54
|
+
1. Start with the default first-run path when you want the fastest local result:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
xerg init
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
- `init` detects local OpenClaw or Hermes data
|
|
61
|
+
- it runs a first audit with local snapshot persistence enabled
|
|
62
|
+
- it offers optional hosted follow-up after the audit completes
|
|
63
|
+
- if no local data is found, it prints explicit local-path commands plus remote OpenClaw-only guidance
|
|
64
|
+
|
|
65
|
+
2. Detect sources directly when paths or connectivity are uncertain:
|
|
48
66
|
|
|
49
67
|
```bash
|
|
50
68
|
xerg doctor
|
|
@@ -56,7 +74,7 @@ xerg doctor --railway
|
|
|
56
74
|
- `xerg doctor --verbose` shows progress on stderr while Xerg checks local paths or remote transports
|
|
57
75
|
- If local defaults are empty, prefer `xerg doctor --remote ...` or `xerg doctor --railway` instead of guessing paths
|
|
58
76
|
|
|
59
|
-
|
|
77
|
+
3. Run a baseline audit explicitly when you want direct control:
|
|
60
78
|
|
|
61
79
|
```bash
|
|
62
80
|
xerg audit
|
|
@@ -64,7 +82,7 @@ xerg audit --runtime openclaw
|
|
|
64
82
|
xerg audit --runtime hermes
|
|
65
83
|
```
|
|
66
84
|
|
|
67
|
-
|
|
85
|
+
4. Choose the right output mode for the task:
|
|
68
86
|
|
|
69
87
|
```bash
|
|
70
88
|
xerg audit
|
|
@@ -76,21 +94,27 @@ xerg audit --markdown
|
|
|
76
94
|
- `xerg audit --json` is best for automation and agents
|
|
77
95
|
- `xerg audit --markdown` is best for a shareable report
|
|
78
96
|
|
|
79
|
-
|
|
97
|
+
5. After a workflow or model change, measure the delta:
|
|
80
98
|
|
|
81
99
|
```bash
|
|
82
100
|
xerg audit --compare
|
|
83
101
|
xerg audit --compare --json
|
|
84
102
|
```
|
|
85
103
|
|
|
86
|
-
|
|
104
|
+
6. Export, push, or hosted-setup only when needed:
|
|
87
105
|
|
|
88
106
|
```bash
|
|
89
107
|
xerg audit --markdown > xerg-audit.md
|
|
108
|
+
xerg connect
|
|
109
|
+
xerg mcp-setup
|
|
90
110
|
xerg audit --push
|
|
91
111
|
xerg push
|
|
92
112
|
```
|
|
93
113
|
|
|
114
|
+
- `connect` is the guided hosted path: it reuses existing auth, prompts before browser login when needed, and offers to push the latest audit
|
|
115
|
+
- `mcp-setup` prints or writes hosted MCP config for Cursor, Claude Code, or another client
|
|
116
|
+
- local audits and compare remain available if you skip hosted setup
|
|
117
|
+
|
|
94
118
|
## Source Selection
|
|
95
119
|
|
|
96
120
|
Local defaults:
|
|
@@ -182,18 +206,22 @@ Automation can branch on those codes instead of scraping terminal output.
|
|
|
182
206
|
|
|
183
207
|
## Recommendations
|
|
184
208
|
|
|
185
|
-
When using `--json`, expect a `recommendations` array alongside the audit summary.
|
|
209
|
+
When using `--json`, expect a `recommendations` array alongside the audit summary. Each recommendation item includes:
|
|
186
210
|
|
|
187
|
-
- `id`, `findingId`, `kind`, `title`, `
|
|
188
|
-
- `
|
|
189
|
-
-
|
|
211
|
+
- `id`, `findingId`, `kind`, `title`, `summary`
|
|
212
|
+
- `priorityBucket`, `recommendedOrder`, `implementationSurface`, `category`
|
|
213
|
+
- `severity`, `confidence`, `effort`
|
|
214
|
+
- `estimatedSavingsUsd`, `estimatedSavingsPct`
|
|
215
|
+
- `scope`, `scopeId`, `scopeLabel`
|
|
216
|
+
- `whereToChange`, `validationPlan`, `actions`
|
|
190
217
|
|
|
191
|
-
Current recommendation kinds
|
|
218
|
+
Current recommendation kinds map into the Action queue buckets:
|
|
192
219
|
|
|
193
|
-
-
|
|
194
|
-
-
|
|
220
|
+
- `fix_now`: `retry-waste`, `loop-waste`
|
|
221
|
+
- `test_next`: `context-outlier`, `idle-spend`, `candidate-downgrade`, `cache-carryover`, `max-mode-concentration`
|
|
222
|
+
- `watch`: unknown or uncategorized findings
|
|
195
223
|
|
|
196
|
-
Prefer
|
|
224
|
+
Prefer high-confidence or reversible fixes first. Treat model downgrades, context changes, and Cursor behavior changes as compare-friendly experiments, not guaranteed savings.
|
|
197
225
|
|
|
198
226
|
## Checks
|
|
199
227
|
|
|
@@ -211,6 +239,6 @@ Before finalizing work that used Xerg:
|
|
|
211
239
|
- `--compare` and `--no-db` cannot be used together
|
|
212
240
|
- Xerg is local-first: it stores economic metadata and audit snapshots locally, not prompt or response content
|
|
213
241
|
- `XERG_API_KEY` is recommended for CI and non-interactive automation
|
|
214
|
-
- If browser auth is needed
|
|
242
|
+
- If browser auth is needed without the hosted setup flow, use `xerg login`; remove stored credentials with `xerg logout`
|
|
215
243
|
- Pilot: [xerg.ai/pilot](https://xerg.ai/pilot)
|
|
216
244
|
- Support: `query@xerg.ai`
|