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

# CLI reference

> All Sundew CLI commands and options

## `sundew serve`

Start the honeypot server.

```bash theme={null}
sundew serve [--host HOST] [--port PORT] [--persona PATH]
```

| Flag        | Default     | Description                 |
| ----------- | ----------- | --------------------------- |
| `--host`    | `0.0.0.0`   | Listen address              |
| `--port`    | `8080`      | Listen port                 |
| `--persona` | From config | Path to custom persona file |

## `sundew generate`

Generate a new persona.

```bash theme={null}
sundew generate [--industry INDUSTRY] [--seed SEED] [--output FILE] [--json-output]
```

| Flag            | Default | Description                                                                            |
| --------------- | ------- | -------------------------------------------------------------------------------------- |
| `--industry`    | Random  | Industry theme (`fintech`, `saas`, `healthcare`, `ecommerce`, `devtools`, `logistics`) |
| `--seed`        | Random  | Seed for deterministic generation                                                      |
| `--output`      | stdout  | Write persona to file                                                                  |
| `--json-output` | `false` | Output as JSON instead of YAML                                                         |

**Examples:**

```bash theme={null}
# Generate a random persona
sundew generate

# Fintech persona with deterministic seed
sundew generate --industry fintech --seed 42

# Export to file
sundew generate --industry healthcare --output personas/hospital.yaml
```

## `sundew query`

Query captured events and sessions.

```bash theme={null}
sundew query [--last-session] [--type TYPE] [--last DURATION]
```

| Flag             | Description                                                               |
| ---------------- | ------------------------------------------------------------------------- |
| `--last-session` | Show the most recent session                                              |
| `--type`         | Filter by classification: `human`, `automated`, `ai_assisted`, `ai_agent` |
| `--last`         | Time window: `1h`, `24h`, `7d`, etc.                                      |

**Examples:**

```bash theme={null}
# Most recent session
sundew query --last-session

# AI agents in the last day
sundew query --type ai_agent --last 24h

# All automated traffic this week
sundew query --type automated --last 7d
```

## `sundew stats`

Display summary statistics.

```bash theme={null}
sundew stats
```

Returns total events, sessions, classification breakdown, top endpoints, and source IPs.

## `sundew mcp-client`

Run Sundew as an MCP server for querying captured data from AI tools.

```bash theme={null}
sundew mcp-client
```

Add to your MCP config:

```json theme={null}
{
  "mcpServers": {
    "sundew": {
      "command": "sundew",
      "args": ["mcp-client"]
    }
  }
}
```

## `sundew export`

Export captured data for research.

```bash theme={null}
sundew export [--anonymize] [--format FORMAT] [--output FILE]
```

| Flag          | Default | Description                            |
| ------------- | ------- | -------------------------------------- |
| `--anonymize` | `false` | Hash IPs, bucket timestamps, strip PII |
| `--format`    | `json`  | Output format: `json`, `csv`           |
| `--output`    | stdout  | Write to file                          |

## `sundew validate-config`

Validate configuration and canary token safety.

```bash theme={null}
sundew validate-config
```

Checks that all canary tokens are verifiably fake, config is valid, and persona loads correctly.
