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

# CLI

> xenarch CLI — command-line tool for AI agents and publishers to manage x402 payment gates, USDC payments on Base, and pay-per-crawl pricing.

## Installation

```bash theme={null}
npx xenarch-cli
```

Or install globally:

```bash theme={null}
npm install -g xenarch
```

## Agent commands

### Wallet

```bash theme={null}
# Generate a new wallet
xenarch wallet generate

# Import an existing private key
xenarch wallet import 0xYOUR_PRIVATE_KEY

# Connect via WalletConnect (scans QR code)
xenarch wallet connect
```

Wallets are stored at `~/.xenarch/wallet.json` with `chmod 600`.

### Check gate

```bash theme={null}
xenarch check https://example.com/premium
```

Output:

```
Gate found!
  Price: $0.003 USDC
  Network: Base
  Splitter: 0xC6D3...62ae
  Collector: 0xabc1...publisher
```

### Pay

```bash theme={null}
xenarch pay https://example.com/premium
```

Executes the full flow: check gate, send USDC, verify, return access token.

### History

```bash theme={null}
# All payments
xenarch history

# Filter by domain
xenarch history --domain example.com
```

## Publisher commands

### Register

```bash theme={null}
xenarch register
```

Interactive: prompts for email and password. Returns your API key.

### Login

```bash theme={null}
xenarch login
```

### Sites

```bash theme={null}
# List sites
xenarch sites

# Add a new site
xenarch site-add example.com

# View earnings
xenarch stats <site-id>
```

### Payout

```bash theme={null}
xenarch payout 0xYOUR_WALLET_ADDRESS
```
