> ## Documentation Index
> Fetch the complete documentation index at: https://xerg.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install and run the Xerg CLI, know the supported runtimes, and start with init or direct audit commands.

## Install as an agent skill

If you work inside Claude Code, Codex, Cursor, or another agent that supports the Agent Skills standard, install the Xerg skill and ask your agent to audit your AI spend:

```bash theme={null}
npx skills add xergai/skills
```

The agent runs the CLI itself and explains the findings. See [skill bundle](/docs/skill-bundle) and [agent clients](/docs/agent-clients) for details.

## Supported Node runtime

`@xerg/cli` supports Node `22.13.0` and newer. That is the first Node 22 release where `node:sqlite` is available without its startup flag.

## Supported data sources

* local OpenClaw logs and session transcripts, plus optional independent sanitized trace captures
* local Hermes v0.17+ `state.db`, with legacy log/transcript fallback where present
* local Claude Code session transcripts
* local Cursor usage CSV exports
* event payloads from any framework via [`xerg ingest`](/docs/ingest)
* OpenClaw SSH, Railway, and multi-source remote audits

## Run without a global install

```bash theme={null}
npx @xerg/cli@latest init
```

Direct commands remain available when you want explicit control:

```bash theme={null}
npx @xerg/cli@latest doctor
npx @xerg/cli@latest audit
```

## Install globally

```bash theme={null}
npm install -g @xerg/cli
xerg init
```

## Runtime note

`@xerg/cli` is a Node.js CLI. Use Node 22.13.0 or newer, then run `npx @xerg/cli@latest init` to confirm the package is working.

## First-run defaults

`xerg init` is the default first-run path. It is interactive and best when you want the fastest local result.

Use direct `doctor` / `audit` commands when:

* you need non-interactive behavior
* you want JSON or Markdown output immediately
* you want to script specific runtime or path flags
* you want remote OpenClaw audits directly

## Develop from this repo

If you are working from the Xerg repo itself:

```bash theme={null}
nvm use
corepack prepare pnpm@10.6.2 --activate
pnpm install
pnpm lint
pnpm test
pnpm build
```

This repo pins the default development and release toolchain to Node `24.14.0` in `.nvmrc`.
