Skip to main content
If you install @xerg/cli globally, replace npx @xerg/cli with xerg.

1. Check that Xerg can see your local agent data

npx @xerg/cli doctor
Doctor reports whether Xerg can see gateway logs and session transcripts from the default OpenClaw or Hermes paths. If both local runtimes are present, rerun with --runtime openclaw or --runtime hermes.

2. Run the first audit

npx @xerg/cli audit
This prints a terminal summary with total spend, structural waste, opportunities, top workflows, and top models. By default, Xerg also stores a local snapshot so later runs can use --compare.

3. Make one workflow or model change, then compare

npx @xerg/cli audit --compare
--compare looks for the newest compatible cached snapshot on your machine and adds before and after deltas. If no compatible baseline exists yet, Xerg does not fail. It adds a note telling you to run the same audit again after a fix.

4. Export or automate

Shareable Markdown:
npx @xerg/cli audit --markdown > xerg-audit.md
Machine-readable JSON:
npx @xerg/cli audit --json
Fail CI if confirmed waste is too high:
npx @xerg/cli audit --fail-above-waste-rate 0.30
Push an audit summary to the Xerg API:
npx @xerg/cli audit --push
If you have Xerg Pro or Enterprise, that push makes the audit available to hosted features such as the dashboard and the hosted MCP server.

Common next steps