npx @xerg/cli@latest. If you installed the CLI globally, substitute xerg.
Remote SSH, Railway, and --remote-config flows are OpenClaw-only. QM has a host-independent snapshot adapter plus separate strict-direct and certified Fly-contained collection, and is never auto-detected.
Use this page in order:
- start with the init-first path
- pick the source type you actually want to inspect
- copy the exact command block for that workflow
- come back to the later sections for push, CI, and troubleshooting
1. Init-first path
If you only remember four commands, remember these:init: detects local OpenClaw, Hermes, or Claude Code data and runs the first auditaudit --compare: compares against the newest compatible saved snapshotactivate --push-latest: uses browser approval and pushes the latest audit; add--organization-id org_...to require one exact Clerk workspaceactivate --connect-only --organization-id org_...: pairs the exact workspace and exits without source detection, audit, or pushmcp-setup: prints or writes hosted MCP config for a supported client
2. Command map
3. Choose the right starting command
Use this quick decision guide:- Brand-new first run:
npx @xerg/cli@latest init - Not sure whether Xerg can see your data:
npx @xerg/cli@latest doctor - Ready to run the first local audit:
npx @xerg/cli@latest audit - Want machine-readable output:
npx @xerg/cli@latest audit --json - Want machine-readable readiness and the exact recommended command:
npx @xerg/cli@latest doctor --json - Want to drill into a displayed item:
npx @xerg/cli@latest explain <eight-character-id> - Want a shareable report:
npx @xerg/cli@latest audit --markdown - Want before/after deltas:
npx @xerg/cli@latest audit --compare - Want to audit Claude Code sessions:
npx @xerg/cli@latest audit --runtime claude-code - Want to analyze Cursor export data:
npx @xerg/cli@latest audit --cursor-usage-csv [file] - Want to audit another framework’s events:
npx @xerg/cli@latest ingest --file payload.json - Want to inspect a remote OpenClaw target first:
npx @xerg/cli@latest doctor --remote [user@host]ornpx @xerg/cli@latest doctor --railway - Want to see per-file extraction coverage (which signals the parser found):
npx @xerg/cli@latest doctor --verbose - Want cost-per-outcome:
npx @xerg/cli@latest outcome --workflow [name] --status successthen rerunaudit - Want to audit QM:
npx @xerg/cli@latest doctor --runtime qmthennpx @xerg/cli@latest audit --runtime qm --since 7d
4. Direct local audits
Default local detection:--runtime when:
- more than one local runtime is present
- you want deterministic behavior in automation
- you are passing explicit local paths and already know the runtime
5. Point Xerg at explicit local paths
OpenClaw:Ctrl-C. It binds only to loopback, receives traces only, sanitizes before persistence, and never pushes automatically. --otlp-file is an independent source and cannot be combined with the log or transcript commands above. See OpenClaw trace collection.
Hermes:
--state-db is mutually exclusive with legacy --log-file and --sessions-dir. The observer directory is optional and supplies request/mechanical evidence without adding economic totals. Certified Hermes traces require state.db; see Hermes analysis and Hermes trace collection.
Claude Code (defaults to ~/.claude/projects/):
--fly-app is omitted. Fly uses an operator-contained exporter and reports databaseLeastPrivilege: false; offline snapshots need no database access. QM collection is one-shot, never pushes automatically, and keeps unresolved openrouter/auto cost unpriced.
Useful rule of thumb:
- use
doctorfirst when you are not sure the paths are correct - use
auditoncedoctorshows the files you expect
6. Analyze a Cursor usage CSV
Inspect the CSV first:cache-read-concentration and max-mode-concentration signals.
6b. Audit any framework with an event payload
If your framework is not a built-in source — or you have richer per-event data than a usage export — export a Xerg event payload and run:7. Output modes and compare
Human-readable terminal report:--details,--json, and--markdownare mutually exclusive output projections- plain
auditis the compact manual view;--detailsis the exhaustive manual view --jsonis best for agents and scripts
--compareneeds saved local snapshots--compareand--no-dbcannot be used together
8. Remote OpenClaw audits
SSH
Inspect first:Railway
Inspect the linked service:Multi-source config
Run a multi-source OpenClaw audit:9. Hosted follow-up, dashboard, push, and authentication
Guided hosted path:- use
activatewhen you want browser-approved auth plus a detected first audit - use
activate --push-latestwhen the local audit is already cached - use
audit --pushwhen you are computing a fresh audit right now - use
pushwhen you already have a saved audit snapshot and only want to send it - use the hosted dashboard when you want pushed audit history, sources, trends, Optimizations, policies, or workspace API keys
10. CI and automation
Threshold gates:XERG_API_KEY in the CI provider’s secret manager and use it for non-interactive hosted automation. Do not place the secret inline in an interactive shell command.
11. More CI gates and automation
Fail on identified waste rate:
Standalone
push uses 5 for hosted quota, member-limit, capability, and retained-history conditions. The compatibility path through audit --push still maps the same hosted rejection to general error 1.
12. Troubleshooting shortcuts
Verbose local discovery:13. Common copy-paste sequences
First local audit:14. Flag reference
ingest accepts the same human-output, persistence, compare, and push flags as audit (--since, --details, --json, --markdown, --db, --no-db, --compare, --push, --dry-run, --verbose).