Skip to main content
Examples use npx @xerg/cli@latest. If you installed the CLI globally, substitute xerg.
Remote SSH, Railway, and --remote-config flows are OpenClaw-only. Hermes support is local-only.
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:
What they mean:
  • init: detects local OpenClaw, Hermes, or Claude Code data and runs the first audit
  • audit --compare: compares against the newest compatible saved snapshot
  • connect: handles hosted auth and offers to push the latest audit
  • mcp-setup: prints or writes hosted MCP config for a supported client
Quick utility commands:
Use these when you want the top-level command list or just the installed CLI version.

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 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] or npx @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 success then rerun audit

4. Direct local audits

Default local detection:
Force a specific runtime:
Use --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:
The collector is an interactive local workload capture that ends on 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/):
Useful rule of thumb:
  • use doctor first when you are not sure the paths are correct
  • use audit once doctor shows the files you expect

6. Analyze a Cursor usage CSV

Inspect the CSV first:
Run the audit:
Use this path when you want to analyze Cursor export rows instead of agent logs and session transcripts. It is the best practical path for Cursor data today, with known limits: usage CSV rows carry no retry, loop, or runtime structure and no true workflow traces, so Cursor audits produce Cursor-specific findings (like cache-carryover and max-mode-concentration) rather than structural ones.

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:
The full audit pipeline (findings, compare, push) runs on the payload.

7. Output modes and compare

Human-readable terminal report:
JSON for automation:
Markdown for sharing:
Remember:
  • --json and --markdown are mutually exclusive
  • plain audit is best for manual inspection
  • --json is best for agents and scripts
Compare against the newest compatible saved audit:
Limit the comparison window:
Important:
  • --compare needs saved local snapshots
  • --compare and --no-db cannot be used together

8. Remote OpenClaw audits

SSH

Inspect first:
Audit:
Custom remote paths:

Railway

Inspect the linked service:
Audit the linked service:
Use explicit Railway IDs:

Multi-source config

Run a multi-source OpenClaw audit:
Use this when one command needs to inspect several SSH and Railway sources.

9. Hosted follow-up, dashboard, push, and authentication

Guided hosted path:
Push as part of the audit:
Preview the exact push payload:
Push the newest cached snapshot later:
Push a saved payload file:
Browser auth:
Non-interactive auth:
Useful distinction:
  • use connect when you want guided auth and an optional push prompt
  • use audit --push when you are computing a fresh audit right now
  • use push when 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:
Machine-readable output:
Use XERG_API_KEY for non-interactive hosted automation.

11. More CI gates and automation

Fail on confirmed waste rate:
Fail on confirmed waste dollars:
Push and gate in one command:
Remote CI gate for OpenClaw:
Exit codes:

12. Troubleshooting shortcuts

Verbose local discovery:
Force a runtime when local auto-detection is ambiguous:
Check a remote target directly:
Check the CLI help:

13. Common copy-paste sequences

First local audit:
Hermes local audit:
Before and after workflow test:
Export JSON for an agent:
Remote OpenClaw audit over SSH:
Push into the hosted Xerg workspace:

14. Flag reference

ingest accepts the same output, persistence, compare, and push flags as audit (--since, --json, --markdown, --db, --no-db, --compare, --push, --dry-run, --verbose).