SentrySentry
CLI & TUI

Command Reference

Every sentry CLI subcommand: flags, defaults, examples and environment variables

Command Reference

The CLI is defined with clap (derive) in cli.rs and dispatched to the handlers in cmd.rs. Everything below was verified against those definitions.

Conventions: placeholders in backticks (<ip>, <path>); durations accept 24h, 7d, 30m. Almost every subcommand loads the config file (and many require Postgres in storage.postgres.url).

Global flags

FlagDescription
--config <path>Config file path. Default: sentry.toml in cwd or /etc/sentry/sentry.toml. Also via the SENTRY_CONFIG env var.
-v / -vv / -vvvLog verbosity: info, debug, trace.

Monitor / daemon

sentry run

Starts the daemon in the foreground: sources → pipeline (rules → heuristics → AI/LLM) → actions, hot-reload via LISTEN/NOTIFY, prune tasks and the Prometheus metrics server. Handler in daemon.rs.

sentry run

sentry serve

Web dashboard (build-step-free SPA) + JSON API in a separate process. Requires Postgres. Bind and auth come from [server]: host (default 127.0.0.1), port (default 8080), auth.mode = "none"|"password"|"token"|"both" with RBAC (admin mutates, viewer is read-only). Handler in server.rs.

Endpoints: / (dashboard), /api/health, /api/login, /api/logout, /api/me, /api/events, /api/stats, /api/incidents (+ /{id}/ack and /{id}/resolve), /api/ips/blocked (+ /{ip}/block, /{ip}/unblock, /{ip}/forgive).

sentry serve

Live tail

sentry tail

Live event tail straight from Postgres. Opens the interactive TUI when stdout is a TTY; outside a TTY (or with --stream) it prints one line per event. Implementation in tui/mod.rs and tui/stream.rs.

FlagDefaultDescription
--only <levels>(all)Filter by risk level, comma-separated (e.g. High,Critical).
--tuioffForce fullscreen TUI mode.
--streamoffForce non-interactive mode (one line per event).
--theme <t>darkColor theme: dark, light or mono.
--jsonoffWith --stream: one JSON object per event (JSONL).
sentry tail --only High,Critical --theme mono
sentry tail --stream --json | jq 'select(.level == "critical")'

Incidents

sentry incidents

List and inspect unresolved incidents. Handler in cmd.rs. Ack/resolve happen through the HTTP API (POST /api/incidents/{id}/ack and /{id}/resolve) or the dashboard.

SubcommandDescription
listLast 50 unresolved incidents.
show <id>Details of one incident (UUID); searches among unresolved ones.
sentry incidents list
sentry incidents show 6ba7b810-9dad-11d1-80b4-00c04fd430c8

IP

sentry ip

Inspect or block/unblock an IP. The IP is positional and comes before the subcommand; with no subcommand it defaults to info. Blocks publish sentry_blocks_changed (daemon and edge enforce within seconds). Handler in cmd.rs.

SubcommandDescription
info (default)Block state, reason, expiry, strikes and total violations.
block [--ttl <dur>] [--note <text>]Block (optionally with expiry).
unblockRemove the block.
forgiveReset the strike counters (offender memory); history is kept.
sentry ip 203.0.113.7 info
sentry ip 203.0.113.7 block --ttl 24h --note "scanner"
sentry ip 203.0.113.7 forgive

Routes

sentry routes

Known routes (config ∪ database). Handler in cmd.rs; importers in routes_import.rs.

SubcommandDescription
listLists database routes (or config routes when the DB is empty).
learn [--dry-run] [--min-hits 10] [--min-ips 2]Infers stable route shapes from recent events and persists the new ones.
import <path> [--format <fmt>] [--dry-run]Imports routes from OpenAPI/Swagger 2/3, Postman v2.1 or HAR. --format: openapi, swagger, postman, har, auto (default: auto-detect).
sentry routes learn --min-hits 20 --min-ips 3
sentry routes import openapi.yaml --dry-run

Auto-detection

sentry auto

Detects frameworks/routes and generates sentry.auto.toml (known routes + packs + suggested rules). Detection lives in the sentry-auto crate; orchestration and the HTTP probe in auto.rs.

  • With a path (sentry auto /var/www/app): scans the project tree (bounded walk) and extracts routes for the nginx, WordPress, Laravel, Next.js and Express profiles.
  • Without a path: runs everything on its own — reads server configs from disk (/etc/nginx, sites-enabled/conf.d) and probes the local service on ports 80/443 (robots.txt, sitemap.xml and ~60 common paths; a random sentinel path filters catch-all/SPA fallbacks).
  • Opt-in modules: pass --probe and/or --disk to run just one; with no flags, both run.
  • Output: a METHODS | PATH table + detected frameworks and the sentry.auto.toml written next to the resolved sentry.toml. When nothing is found the command prints nothing (exit 0) and writes no file.

The generated file is cascade-loaded automatically: on every config load, routes.known, rules.pack and rules.custom from sentry.auto.toml are appended with dedupe — whatever is in your sentry.toml always wins (there is no --merge; the cascade replaces that flag).

FlagDefaultDescription
[ROOT](none)Project root to scan; without it, probes the local service (80/443) + disk configs.
--probeoffOpt-in: only the local HTTP probe.
--diskoffOpt-in: only on-disk config detection.
--profile <name>(auto)Forces a profile (wordpress, laravel, nextjs, express, nginx), skipping detection.
--deepoffScans the whole tree with regex (not just canonical files). tree-sitter AST stays on the backlog.
--dry-runoffPrint only; does not write sentry.auto.toml.
-v / -vvoffVerbosity: scanned tree and versions (-v); per-file/request detail (-vv).
sentry auto                        # everything: disk + 80/443 probe
sentry auto /var/www/app --dry-run # just preview what would be detected
sentry auto --disk                 # zero traffic: reads configs from disk
sentry auto --profile wordpress    # force the profile and probe WP paths

Rules engine

sentry rules

CRUD for custom database rules + view of config packs. Changes publish sentry_rules_changed (hot-reload, no restart). Handler in cmd.rs.

SubcommandDescription
listDatabase rules + packs declared in [rules] (name = mode).
show <id>Details of one rule (match, action, priority, ttl, tags).
add --name <name> --match <dsl> --action <action> [--priority 100]Creates/updates a custom rule (rules engine DSL).
allow <ip> [--ttl <dur>] [--note <text>]Creates an allowlist rule for the IP (priority 1).
block <ip> [--ttl <dur>] [--note <text>]Creates a blocklist rule for the IP.
enable <id> / disable <id>Enable/disable a rule.
delete <id>Removes a rule.
packsLists the built-in default packs and each one's effective mode.
test [--path /] [--method GET] [--ip <ip>] [--ua <ua>]Simulates which rules would match that request shape.
sentry rules add --name "block admin scan" \
  --match 'path starts_with "/admin" AND country = "RU"' --action block
sentry rules test --path /.env --ua "sqlmap/1.0" --ip 203.0.113.7

Reputation feeds

sentry feeds

Reputation feeds configured in [[rules.feeds]] (Tor, Spamhaus, FireHOL, datasets…). Handler in cmd.rs.

SubcommandDescription
listName, kind, tier, refresh and URL of each feed.
refreshFetches all feeds once and shows entry counts (no daemon needed).
check <ip>Refreshes the feeds, then looks the IP up against them.
sentry feeds check 203.0.113.7

Datasets

sentry datasets

DB-backed datasets (User-Agent, path or JA3 lists) that become dataset:<name> synthetic rules and feed the dynamic prefilter. Handlers in cmd.rs and datasets.rs.

SubcommandDescription
listName, kind, entry count and enabled state.
import <path> --kind <k> --name <name> [--action log] [--dry-run]Imports a list (file or http(s) URL), one entry per line, replacing any previous version of that name. --kind: user_agent, path or ja3; --action: allow, block, challenge, rate_limit, log (default) or tag.
enable <name> / disable <name>Enable/disable without deleting (running daemons hot-reload via NOTIFY).
delete <name>Deletes the dataset.
fetchRe-fetches the source_url of every enabled dataset and shows the new counts.
sentry datasets import bad-bots.txt --kind user_agent --name bad-bots --action block --dry-run

Trusted IPs

sentry trusted

Built-in trusted IP presets for [real_ip] trusted_lists. Handler in cmd.rs.

SubcommandDescription
listAvailable presets and which ones are approved in config.
sentry trusted list

Firewall

sentry firewall

Inspection of the kernel ban backends. Handler in cmd.rs. Linux-only (reports unavailability elsewhere).

SubcommandDescription
statusDetects nftables/ipset/firewalld, privileges and live set sizes.
sentry firewall status

Bot verification

sentry bots

rDNS crawler verification (F7.10) — PTR under the engine's domains + forward-resolve back to the IP. Uses the system resolver, no daemon needed. Handler in cmd.rs and botdns.rs.

SubcommandDescription
check <ip> --ua <ua>Verifies whether the IP really is the crawler the User-Agent claims.
sentry bots check 66.249.66.1 --ua "Googlebot/2.1"

Protocols

sentry protocol

Validation and inspection of the protocol DSL schemas (F9). Handlers in protocol_cmd.rs.

SubcommandDescription
validate [dir]Compiles every *.protocol.yaml in the directory and reports errors. Default: [protocol] dir.
list [dir]Lists compiled protocols: ports, messages and policies.
check <schema> --hex <hex>Validates one raw frame (hex) against one schema.
sentry protocol validate
sentry protocol check schemas/game.protocol.yaml --hex 0001ff

Auth helpers

sentry auth

Generates the hashes used by [server.auth]. Handlers in auth.rs.

SubcommandDescription
hash-password <password>Argon2id hash (PHC format) for [[server.auth.users]].
token-hash <token>SHA-256 hex of the token for [[server.auth.tokens]].
sentry auth hash-password "s3cret!"

OS service

sentry service

Installs the daemon as a system service: systemd (/etc/systemd/system/sentry.service), launchd (~/Library/LaunchAgents/com.sentry.daemon.plist) or a real Windows Service (SCM). The service runs sentry run. Handler in service.rs.

SubcommandDescription
install [--user <u>] [--workdir <dir>]Installs and starts (--user is systemd-only; secrets come from the environment).
uninstallStops and removes the service.
statusInstall paths + best-effort live status.
sentry service install --user sentry --workdir /etc/sentry

Reports

sentry report

Postgres aggregate report: events by level and verdict, top IPs and top paths. Handler in cmd.rs.

FlagDefaultDescription
--from <dur>24hLook-back window (e.g. 24h, 7d).
--export <fmt>(text)json or csv on stdout.
--unknown-pathsoffTop paths without a known route (UnknownRoute) — candidates for [[routes.known]].
sentry report --from 7d --export csv
sentry report --unknown-paths

sentry posture

Web security posture (F11): part 1 is a config checklist (TLS, HTTP→HTTPS redirect, posture enabled); part 2 aggregates the header advisories observed on the protected site's responses (inline edge, shadow) with a remediation hint per line. Handler in cmd.rs; checks in posture.rs.

FlagDefaultDescription
--from <dur>24hLook-back window for observed advisories.
sentry posture --from 24h

SIEM export

sentry export

Exports raw events as CEF, LEEF 2.0 or JSON for SIEM consumption. Serializers in siem.rs.

FlagDefaultDescription
--from <dur>24hInitial look-back window.
--format <fmt>cefcef, leef or json.
--out <file>(stdout)Write to a file instead of stdout.
--followoffKeep tailing new events after the initial window.
--to <target>(—)With --follow: forward via syslog to udp://host:514 or tcp://host:514.
sentry export --from 7d --format leef --out sentry.leef
sentry export --follow --to udp://siem.internal:514

Config

sentry config

Validates or prints the resolved config. Handler in cmd.rs.

SubcommandDescription
validateCompiles custom rules and protocol schemas, rejects [posture] mode = "enforce", emits edge advisories and prints the summary.
showPrints the resolved config (TOML + env overlay).
sentry config validate

AI model

sentry model

Lifecycle of the classic ONNX model. Handler in cmd.rs.

SubcommandDescription
statusProvider, mode (fork/inline/shadow), trigger, threshold, loaded model (needs a build with --features onnx to actually load it).
reloadPublishes NOTIFY sentry_model_changed — the daemon hot-swaps the ONNX from disk (requires Postgres).
export [--hours 720] [--out dataset.csv] [--synthetic] [--rows 4000] [--confirmed]Exports features as CSV (extracted by Rust — training/inference parity). --synthetic generates a seed dataset without Postgres; --confirmed uses incidents as the positive label.
sentry model export --synthetic --rows 8000 --out seed.csv
python tools/train_model.py --csv seed.csv
sentry model reload

Cloudflare

sentry cloudflare

Cloudflare integration (credentials via SENTRY_CF_TOKEN, SENTRY_CF_ZONE and optionally SENTRY_CF_ACCOUNT). Handler in cmd.rs.

SubcommandDescription
statusValidates the token, shows zone/account, sentry access-rule count and IP List.
testDry-run verification of token + zone (makes no changes).
pullLists the access rules created by sentry at the edge (best-effort).
sentry cloudflare status

Isolated test

sentry test

Runs the pipeline (rules + heuristics + scorer) on a single payload, no network or database. Handler in cmd.rs.

FlagDefaultDescription
--path <p>/Simulated path.
--method <m>GETSimulated method.
sentry test "1' OR '1'='1" --path /login --method POST

Benchmarks

sentry bench

Provider evaluation harness. Handler in bench_llm.rs.

SubcommandDescription
llm [--providers jev,mock] [--events <file>] [--format <log_format>] [--n 0] [--concurrency 4] [--out <file>]Compares classification providers (LLM / jev / mock) on latency, agreement with the heuristic pipeline, output quality and cost. --events accepts an nginx access.log or a .jsonl of events; --n 0 = all.
sentry bench llm --providers jev,openrouter,ollama --n 200

Environment variables

Secrets never go into committed config — use the environment. Beyond the table, every config key can be overridden through env with the SENTRY_ prefix and __ nesting (e.g. SENTRY_STORAGE__POSTGRES__URL); the overlay is implemented in config.rs.

VariableUsed byRead in
SENTRY_CONFIGConfig path (equivalent to --config).cli.rs
SENTRY_STORAGE__POSTGRES__URLPostgres URL.config.rs
SENTRY_CF_TOKENCloudflare API token (actions + CLI + TUI).cmd.rs, daemon.rs
SENTRY_CF_ZONECloudflare zone id.cmd.rs
SENTRY_CF_ACCOUNTAccount id override (derived from the zone when unset).cmd.rs, lists.rs
SENTRY_LLM_KEYOpenRouter API key ([llm]).daemon.rs
SENTRY_JEV_KEYjev LLM provider key (fallbacks TYPESAFE_API_KEY / JEV_API_KEY).jev.rs
SENTRY_SESSION_SECRETDashboard session HMAC key ([server.auth] session_secret_env).config.rs (core)
SENTRY_WEBHOOK_SECRETWebhook payload HMAC ([server] webhook_secret_env and the webhook action).config.rs (core), daemon.rs
SENTRY_EDGE_CHALLENGE_SECRETJS challenge PoW secret (required with [edge.challenge] enabled).config.rs (core)
SENTRY_ABUSEIPDB_KEYAbuseIPDB ([ip_lookup] and the report action).config.rs (core)
SENTRY_REPORTEDIP_KEYreport action key (reportedip provider).lib.rs (report)
SENTRY_OPN_API_KEY / SENTRY_OPN_API_SECRETOPNsense REST credentials.lib.rs (opnsense)

On this page