◂ Back to README
# Terminal (CLI)
`xexeu` is one binary covering both Docker Compose roles (`serve` and
`scanner`) plus every operator command. Every subcommand accepts `-h`/
`--help`.
## `xexeu serve`
Runs the API server, batch ingestion, diff engine and the embedded
dashboard/executive report.
```
Usage: xexeu serve [OPTIONS]
Options:
--bind [default: 0.0.0.0:8788]
--config [default: config/xexeu.toml]
--sweeps [default: data/sweeps]
--data-dir [default: data/xexeu]
--admin-token Token required by the API routes that change state.
Without it, a random token is generated at startup
and printed once [env: XEXEU_ADMIN_TOKEN]
```
This is the `xexeu` Compose service's entrypoint.
Reads (`GET`) are open; the routes that change the configuration
(`POST`/`PUT`/`DELETE /api/config/groups…`) need the admin token in
`Authorization: Bearer ` or `X-Xexeu-Token`, and a browser `Origin`, when
present, must match `Host`. Without `XEXEU_ADMIN_TOKEN`, `serve` prints a fresh
`http://…/?token=…` link at each start; opening it logs the dashboard in for
that tab.
## `xexeu scanner`
Runs the continuous scheduler and scan engine, writing sweep batches —
never exits on its own, same lifecycle as a daemon.
```
Usage: xexeu scanner [OPTIONS]
Options:
--config [default: config/xexeu.toml]
--out [default: data/sweeps]
--data-dir [default: data/xexeu]
```
Picks the `nativo` (raw SYN) engine whenever a profile asks for it and
`CAP_NET_RAW` is actually usable, falling back to `nativo-sem-raw`
automatically otherwise — see [`architecture.md`](architecture.md#2-scan-engine).
This is the `scanner` Compose service's entrypoint.
## `xexeu scan --group --once`
Runs a single sweep for one group, for diagnostics — writes a batch exactly
like `scanner` would, then exits.
```
Usage: xexeu scan [OPTIONS]
Options:
--group
--once
--config [default: config/xexeu.toml]
--out [default: data/sweeps]
--data-dir [default: data/xexeu]
```
```bash
xexeu scan --group dmz --once --config config/xexeu.toml --out data/sweeps --data-dir data/xexeu
```
## `xexeu config check`
Validates `xexeu.toml` and prints, per group, the address count, effective
cron and any cadence overlap. Run this after every manual edit.
```
Usage: xexeu config check [OPTIONS]
Options:
--config [default: config/xexeu.toml]
```
Exits non-zero on an invalid configuration — safe to use in a pre-push hook
or CI step, which is exactly what `scripts/check.sh` does.
## `xexeu feeds sync` / `xexeu feeds import`
```
Usage: xexeu feeds
Commands:
sync Download NVD and CISA KEV feeds incrementally
import Import feed files copied manually for isolated networks
```
```bash
# Live, one-shot sync (also happens automatically inside `serve` if
# padrao.feeds.sincronizar_automaticamente = true — see configuration.md)
xexeu feeds sync --config config/xexeu.toml --data-dir data/xexeu
# Offline, for air-gapped networks
xexeu feeds import ./nvd-dump --data-dir data/xexeu
```
## `xexeu changes --since `
Prints diff events (new/gone host, new/closed port, new/fixed
vulnerability) from the local state — the same data `/api/changes` serves.
```bash
xexeu changes --since 24h --data-dir data/xexeu
```
## `xexeu export --format json|csv`
Exports the current deduplicated state (hosts, ports, findings) — shares
its formatting logic with the `/api/export/*.csv` and `/api/hosts`
endpoints, so a terminal export and a dashboard download never drift apart.
```
Usage: xexeu export [OPTIONS]
Options:
--format [default: json]
--data-dir [default: data/xexeu]
--out
```
```bash
xexeu export --format csv --data-dir data/xexeu --out hosts.csv
xexeu export --format json --data-dir data/xexeu # prints to stdout
```
## `xexeu doctor [--json]`
Diagnoses the runtime environment — run this first when something looks
wrong, and always before reporting an issue (see
[`support.md`](support.md)).
```
Usage: xexeu doctor [OPTIONS]
Options:
--json
--config [default: config/xexeu.toml]
--data-dir [default: data/xexeu]
```
```
$ xexeu doctor
Xexéu v1.0.0 - Diagnóstico do Ambiente
================================================================================
Item Status Detalhe
--------------------------------------------------------------------------------
versao ok xexeu v1.0.0
config ok configuração válida (4 grupo(s))
net_raw ok CAP_NET_RAW disponível (motor nativo ativo)
sqlite ok banco SQLite acessível em data/xexeu/xexeu.db
vuln_db ok 135 CVE(s) carregados (12h atrás)
feeds_sync ok sincronizado há 12h (dentro do intervalo configurado)
--------------------------------------------------------------------------------
Resultado: OK
```
Exits `1` if any critical item (`config`, a missing database it needs to
write to) failed; a missing/stale vulnerability database or absent
`CAP_NET_RAW` are reported but don't fail the exit code — both have a
documented degraded path (see [`architecture.md`](architecture.md)).
`--json` is meant for scripted health checks and monitoring, not for
humans at a terminal.