@xerg/cli 0.3.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,6 +1,6 @@
1
1
  {
2
2
  "name": "@xerg/cli",
3
- "version": "0.3.0",
3
+ "version": "0.4.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": {
@@ -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 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 and Hermes 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
@@ -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. 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:
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
- 2. Run a baseline audit:
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
- 3. Choose the right output mode for the task:
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
- 4. After a workflow or model change, measure the delta:
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
- 5. Export or push only when needed:
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:
@@ -211,6 +235,6 @@ Before finalizing work that used Xerg:
211
235
  - `--compare` and `--no-db` cannot be used together
212
236
  - Xerg is local-first: it stores economic metadata and audit snapshots locally, not prompt or response content
213
237
  - `XERG_API_KEY` is recommended for CI and non-interactive automation
214
- - 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`
215
239
  - Pilot: [xerg.ai/pilot](https://xerg.ai/pilot)
216
240
  - Support: `query@xerg.ai`