@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 CHANGED
@@ -1,28 +1,43 @@
1
1
  # xerg
2
2
 
3
- Audit OpenClaw and Hermes workflows in dollars, compare fixes, and export daily spend and waste trends.
3
+ Audit OpenClaw and Hermes workflows in dollars, compare fixes, and optionally connect hosted follow-up after the first local result.
4
4
 
5
- Xerg audits OpenClaw and Hermes workflows in dollars, not tokens. It reads local gateway logs and session transcripts, surfaces daily spend and waste rollups plus the highest-leverage findings, and lets you re-run the same audit with `--compare` so you can see exactly what changed after a fix.
5
+ Xerg runs locally by default. Local audits and `--compare` are free. No account is required for local value, and no data leaves your machine unless you explicitly push results to Xerg Cloud.
6
6
 
7
- Everything runs locally by default. No account is required for local audits. No data leaves your machine unless you explicitly `--push` results to the Xerg API for a team dashboard.
8
-
9
- ## 30-second quick start
7
+ ## Fastest first run
10
8
 
11
9
  ```bash
12
- npx @xerg/cli doctor
13
- npx @xerg/cli doctor --verbose
14
- npx @xerg/cli audit
15
- npx @xerg/cli audit --compare
10
+ npx @xerg/cli init
16
11
  ```
17
12
 
13
+ `init` is the default first-run path. It:
14
+
15
+ - detects local OpenClaw or Hermes data
16
+ - runs a first audit and stores the local snapshot
17
+ - prints the standard terminal summary
18
+ - offers optional hosted follow-up with `connect` and `mcp-setup`
19
+
18
20
  Prefer a global install?
19
21
 
20
22
  ```bash
21
23
  npm install -g @xerg/cli
22
- xerg doctor
23
- xerg audit
24
+ xerg init
25
+ ```
26
+
27
+ ## Direct commands for explicit control
28
+
29
+ If you already know what you want, skip `init` and use the direct flows:
30
+
31
+ ```bash
32
+ npx @xerg/cli doctor
33
+ npx @xerg/cli audit
34
+ npx @xerg/cli audit --compare
35
+ npx @xerg/cli audit --json
36
+ npx @xerg/cli audit --markdown
24
37
  ```
25
38
 
39
+ Use these when you need non-interactive behavior, CI gates, JSON/Markdown output, or explicit runtime and path flags.
40
+
26
41
  ## Bundled skill
27
42
 
28
43
  The published `@xerg/cli` package includes the portable Xerg skill bundle inside the installed package at:
@@ -59,34 +74,33 @@ Waste taxonomy
59
74
  - Downgrade candidates: $4.80
60
75
  - Idle waste: $3.37
61
76
 
62
- First savings test
63
- - Move heartbeat_monitor from Claude Opus to Sonnet
77
+ Action queue
78
+ Fix now
79
+ - Reduce retry waste in workspace: $12.40 (high)
80
+ Test next
81
+ - Evaluate a cheaper model for heartbeat_monitor: $4.80 (low)
82
+ Watch
83
+ - none
84
+ How to validate: `xerg audit --compare --push`
64
85
  ```
65
86
 
66
- ## Commands
67
-
68
- - Inspect local audit readiness:
69
-
70
- ```bash
71
- xerg doctor
72
- ```
73
-
74
- - Run the first audit:
75
-
76
- ```bash
77
- xerg audit
78
- ```
79
-
80
- - Compare the latest run against the newest compatible prior local snapshot:
87
+ ## Common commands
81
88
 
82
89
  ```bash
90
+ xerg init
83
91
  xerg audit --compare
92
+ xerg connect
93
+ xerg mcp-setup
84
94
  ```
85
95
 
86
- - Audit a specific window:
96
+ More explicit examples:
87
97
 
88
98
  ```bash
99
+ xerg doctor --runtime openclaw
100
+ xerg audit --runtime hermes
89
101
  xerg audit --since 24h --compare
102
+ xerg audit --push
103
+ xerg push
90
104
  ```
91
105
 
92
106
  ## Works where your agent data lives
@@ -121,14 +135,26 @@ xerg audit --runtime hermes --sessions-dir ~/.hermes/sessions
121
135
 
122
136
  If only one supported local runtime is present, Xerg auto-selects it. If both OpenClaw and Hermes are present locally, rerun with `--runtime openclaw` or `--runtime hermes`.
123
137
 
124
- If your local machine has no OpenClaw or Hermes files, inspect remote targets directly instead:
138
+ If local defaults are empty, `xerg init` prints next-step commands for explicit local paths plus remote OpenClaw-only flows:
125
139
 
126
140
  ```bash
127
- xerg doctor --remote user@host
128
- xerg doctor --railway
141
+ xerg audit --remote user@host
142
+ xerg audit --railway
129
143
  ```
130
144
 
131
- Remote SSH and Railway flows are still OpenClaw-only.
145
+ ## Hosted follow-up
146
+
147
+ Hosted sync and hosted MCP are optional paid workspace features. The simplest hosted path is:
148
+
149
+ ```bash
150
+ xerg connect
151
+ xerg mcp-setup
152
+ ```
153
+
154
+ - `connect` resolves auth from `XERG_API_KEY`, `~/.xerg/config.json`, or stored browser credentials, then offers to push the latest audit
155
+ - `mcp-setup` prints or writes hosted MCP config for Cursor, Claude Code, or another client
156
+
157
+ You can skip both and keep using local audits and compare.
132
158
 
133
159
  ## Authentication and config
134
160
 
@@ -136,7 +162,7 @@ Push commands resolve credentials in this order:
136
162
 
137
163
  1. `XERG_API_KEY`
138
164
  2. `~/.xerg/config.json`
139
- 3. `xerg login` browser credentials stored at `~/.config/xerg/credentials.json`
165
+ 3. stored browser credentials from `xerg login` at `~/.config/xerg/credentials.json`
140
166
 
141
167
  Optional API URL overrides:
142
168
 
@@ -152,7 +178,9 @@ Example `~/.xerg/config.json`:
152
178
  }
153
179
  ```
154
180
 
155
- `xerg login` stores a browser-issued token in `~/.config/xerg/credentials.json`. That token store is separate from `~/.xerg/config.json`.
181
+ `xerg connect` is the guided hosted path. `xerg login` remains available when you want browser auth without the push prompt.
182
+
183
+ `xerg login` stores a browser-issued token in `~/.config/xerg/credentials.json`. That token store is separate from `~/.xerg/config.json`. Hosted MCP works best with a workspace API key.
156
184
 
157
185
  ## What the audit shows
158
186
 
@@ -161,7 +189,7 @@ Example `~/.xerg/config.json`:
161
189
  - Observed vs. estimated cost (always labeled)
162
190
  - Confirmed waste: retry, loop, cache carryover where applicable
163
191
  - Savings opportunities: context bloat, downgrade candidates, idle, max mode concentration where applicable
164
- - Savings recommendations with suggested A/B tests
192
+ - Ranked recommendations with where-to-change guidance and compare validation steps
165
193
  - Before/after deltas on re-audit
166
194
 
167
195
  ## Privacy
@@ -178,6 +206,7 @@ Xerg v0 stores economic metadata and audit summaries locally. It does not store
178
206
  ## Troubleshooting
179
207
 
180
208
  - `better-sqlite3` is a native dependency. If install fails, retry on a supported Node version and make sure standard native build tooling is available for your platform.
209
+ - `xerg init` is interactive in v1. Use direct `doctor` / `audit` commands when you need non-interactive control.
181
210
  - `--verbose` prints progress updates to stderr for `xerg doctor` and `xerg audit`, which helps distinguish package install time from CLI runtime.
182
211
  - If `xerg audit --remote ...` fails before pulling files, verify that both `ssh` and `rsync` are installed and reachable on your `PATH`.
183
212
  - If `xerg audit --railway` fails immediately, verify that the `railway` CLI is installed, authenticated, and can access the target project.