@xerg/cli 0.2.0 → 0.4.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/package.json CHANGED
@@ -1,8 +1,20 @@
1
1
  {
2
2
  "name": "@xerg/cli",
3
- "version": "0.2.0",
4
- "description": "Audit OpenClaw workflows in dollars, compare fixes, and export daily spend and waste trends.",
5
- "keywords": ["ai", "agents", "finops", "llm", "openclaw", "cost", "cli", "cursor", "analytics"],
3
+ "version": "0.4.0",
4
+ "description": "Audit OpenClaw and Hermes workflows in dollars, compare fixes, and export daily spend and waste trends.",
5
+ "keywords": [
6
+ "xerg",
7
+ "ai",
8
+ "agents",
9
+ "finops",
10
+ "llm",
11
+ "openclaw",
12
+ "hermes",
13
+ "cost",
14
+ "cli",
15
+ "cursor",
16
+ "analytics"
17
+ ],
6
18
  "homepage": "https://xerg.ai",
7
19
  "repository": {
8
20
  "type": "git",
@@ -40,6 +52,7 @@
40
52
  "typecheck": "tsc --noEmit -p tsconfig.json"
41
53
  },
42
54
  "dependencies": {
55
+ "@inquirer/prompts": "^8.4.1",
43
56
  "better-sqlite3": "^11.10.0"
44
57
  },
45
58
  "devDependencies": {
@@ -1,23 +1,30 @@
1
1
  ---
2
2
  name: xerg
3
- description: Audit OpenClaw workflows in dollars. Local-first audits with compare mode, remote and Railway support, CI gates, and structured recommendations.
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 workflows in dollars, not tokens. It reads gateway logs and session transcripts, surfaces five spend categories across confirmed waste and savings opportunities, and helps you measure fixes with `--compare`.
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 `--push` results to the Xerg API.
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 --compare
26
+ xerg audit --json
27
+ xerg audit --fail-above-waste-rate 0.30
21
28
  ```
22
29
 
23
30
  ## Inputs
@@ -27,6 +34,9 @@ Xerg needs one of these source inputs:
27
34
  - Local OpenClaw data at the default paths:
28
35
  - `/tmp/openclaw/openclaw-*.log`
29
36
  - `~/.openclaw/agents/*/sessions/*.jsonl`
37
+ - Local Hermes data at the default paths:
38
+ - `~/.hermes/logs/agent.log*` with `gateway.log*` fallback
39
+ - `~/.hermes/sessions/`
30
40
  - Explicit paths via `--log-file` and/or `--sessions-dir`
31
41
  - An SSH target via `--remote`
32
42
  - A Railway target via `--railway`
@@ -35,13 +45,24 @@ Xerg needs one of these source inputs:
35
45
  Additional requirements:
36
46
 
37
47
  - `--compare` needs at least one previously stored compatible local snapshot
38
- - Pushing needs auth via `XERG_API_KEY`, `~/.xerg/config.json`, or `xerg login`
39
- - SSH audits require `ssh` and `rsync` on your local `PATH`
40
- - Railway audits require the `railway` CLI on your local `PATH`
48
+ - Pushing needs auth via `XERG_API_KEY`, `~/.xerg/config.json`, or browser credentials from `xerg login`
49
+ - SSH audits require `ssh` and `rsync` on your local `PATH` and are OpenClaw-only in this phase
50
+ - Railway audits require the `railway` CLI on your local `PATH` and are OpenClaw-only in this phase
41
51
 
42
52
  ## Default Flow
43
53
 
44
- 1. Detect sources first when paths or connectivity are uncertain:
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:
45
66
 
46
67
  ```bash
47
68
  xerg doctor
@@ -53,13 +74,15 @@ xerg doctor --railway
53
74
  - `xerg doctor --verbose` shows progress on stderr while Xerg checks local paths or remote transports
54
75
  - If local defaults are empty, prefer `xerg doctor --remote ...` or `xerg doctor --railway` instead of guessing paths
55
76
 
56
- 2. Run a baseline audit:
77
+ 3. Run a baseline audit explicitly when you want direct control:
57
78
 
58
79
  ```bash
59
80
  xerg audit
81
+ xerg audit --runtime openclaw
82
+ xerg audit --runtime hermes
60
83
  ```
61
84
 
62
- 3. Choose the right output mode for the task:
85
+ 4. Choose the right output mode for the task:
63
86
 
64
87
  ```bash
65
88
  xerg audit
@@ -71,21 +94,27 @@ xerg audit --markdown
71
94
  - `xerg audit --json` is best for automation and agents
72
95
  - `xerg audit --markdown` is best for a shareable report
73
96
 
74
- 4. After a workflow or model change, measure the delta:
97
+ 5. After a workflow or model change, measure the delta:
75
98
 
76
99
  ```bash
77
100
  xerg audit --compare
78
101
  xerg audit --compare --json
79
102
  ```
80
103
 
81
- 5. Export or push only when needed:
104
+ 6. Export, push, or hosted-setup only when needed:
82
105
 
83
106
  ```bash
84
107
  xerg audit --markdown > xerg-audit.md
108
+ xerg connect
109
+ xerg mcp-setup
85
110
  xerg audit --push
86
111
  xerg push
87
112
  ```
88
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
+
89
118
  ## Source Selection
90
119
 
91
120
  Local defaults:
@@ -94,11 +123,15 @@ Local defaults:
94
123
  xerg audit
95
124
  ```
96
125
 
126
+ If both OpenClaw and Hermes are present locally, pass `--runtime openclaw` or `--runtime hermes` explicitly.
127
+
97
128
  Explicit local paths:
98
129
 
99
130
  ```bash
100
- xerg audit --log-file /path/to/openclaw.log
101
- xerg audit --sessions-dir /path/to/sessions
131
+ xerg audit --runtime openclaw --log-file /path/to/openclaw.log
132
+ xerg audit --runtime openclaw --sessions-dir /path/to/sessions
133
+ xerg audit --runtime hermes --log-file ~/.hermes/logs/agent.log
134
+ xerg audit --runtime hermes --sessions-dir ~/.hermes/sessions
102
135
  ```
103
136
 
104
137
  SSH remote:
@@ -166,7 +199,7 @@ Documented exit codes:
166
199
 
167
200
  - `0` success
168
201
  - `1` runtime error
169
- - `2` no OpenClaw data found
202
+ - `2` no supported local runtime data found
170
203
  - `3` threshold exceeded
171
204
 
172
205
  Automation can branch on those codes instead of scraping terminal output.
@@ -202,6 +235,6 @@ Before finalizing work that used Xerg:
202
235
  - `--compare` and `--no-db` cannot be used together
203
236
  - Xerg is local-first: it stores economic metadata and audit snapshots locally, not prompt or response content
204
237
  - `XERG_API_KEY` is recommended for CI and non-interactive automation
205
- - If browser auth is needed locally, use `xerg login`; remove stored credentials with `xerg logout`
238
+ - If browser auth is needed without the hosted setup flow, use `xerg login`; remove stored credentials with `xerg logout`
206
239
  - Pilot: [xerg.ai/pilot](https://xerg.ai/pilot)
207
240
  - Support: `query@xerg.ai`