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
| Flag | Description |
|---|---|
--config <path> | Config file path. Default: sentry.toml in cwd or /etc/sentry/sentry.toml. Also via the SENTRY_CONFIG env var. |
-v / -vv / -vvv | Log 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 runsentry 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 serveLive 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.
| Flag | Default | Description |
|---|---|---|
--only <levels> | (all) | Filter by risk level, comma-separated (e.g. High,Critical). |
--tui | off | Force fullscreen TUI mode. |
--stream | off | Force non-interactive mode (one line per event). |
--theme <t> | dark | Color theme: dark, light or mono. |
--json | off | With --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.
| Subcommand | Description |
|---|---|
list | Last 50 unresolved incidents. |
show <id> | Details of one incident (UUID); searches among unresolved ones. |
sentry incidents list
sentry incidents show 6ba7b810-9dad-11d1-80b4-00c04fd430c8IP
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.
| Subcommand | Description |
|---|---|
info (default) | Block state, reason, expiry, strikes and total violations. |
block [--ttl <dur>] [--note <text>] | Block (optionally with expiry). |
unblock | Remove the block. |
forgive | Reset 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 forgiveRoutes
sentry routes
Known routes (config ∪ database). Handler in
cmd.rs;
importers in
routes_import.rs.
| Subcommand | Description |
|---|---|
list | Lists 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-runAuto-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
--probeand/or--diskto run just one; with no flags, both run. - Output: a
METHODS | PATHtable + detected frameworks and thesentry.auto.tomlwritten next to the resolvedsentry.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).
| Flag | Default | Description |
|---|---|---|
[ROOT] | (none) | Project root to scan; without it, probes the local service (80/443) + disk configs. |
--probe | off | Opt-in: only the local HTTP probe. |
--disk | off | Opt-in: only on-disk config detection. |
--profile <name> | (auto) | Forces a profile (wordpress, laravel, nextjs, express, nginx), skipping detection. |
--deep | off | Scans the whole tree with regex (not just canonical files). tree-sitter AST stays on the backlog. |
--dry-run | off | Print only; does not write sentry.auto.toml. |
-v / -vv | off | Verbosity: 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 pathsRules 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.
| Subcommand | Description |
|---|---|
list | Database 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. |
packs | Lists 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.7Reputation feeds
sentry feeds
Reputation feeds configured in [[rules.feeds]] (Tor, Spamhaus, FireHOL,
datasets…). Handler in
cmd.rs.
| Subcommand | Description |
|---|---|
list | Name, kind, tier, refresh and URL of each feed. |
refresh | Fetches 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.7Datasets
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.
| Subcommand | Description |
|---|---|
list | Name, 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. |
fetch | Re-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-runTrusted IPs
sentry trusted
Built-in trusted IP presets for [real_ip] trusted_lists. Handler in
cmd.rs.
| Subcommand | Description |
|---|---|
list | Available presets and which ones are approved in config. |
sentry trusted listFirewall
sentry firewall
Inspection of the kernel ban backends. Handler in
cmd.rs.
Linux-only (reports unavailability elsewhere).
| Subcommand | Description |
|---|---|
status | Detects nftables/ipset/firewalld, privileges and live set sizes. |
sentry firewall statusBot 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.
| Subcommand | Description |
|---|---|
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.
| Subcommand | Description |
|---|---|
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 0001ffAuth helpers
sentry auth
Generates the hashes used by [server.auth]. Handlers in
auth.rs.
| Subcommand | Description |
|---|---|
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.
| Subcommand | Description |
|---|---|
install [--user <u>] [--workdir <dir>] | Installs and starts (--user is systemd-only; secrets come from the environment). |
uninstall | Stops and removes the service. |
status | Install paths + best-effort live status. |
sentry service install --user sentry --workdir /etc/sentryReports
sentry report
Postgres aggregate report: events by level and verdict, top IPs and top
paths. Handler in
cmd.rs.
| Flag | Default | Description |
|---|---|---|
--from <dur> | 24h | Look-back window (e.g. 24h, 7d). |
--export <fmt> | (text) | json or csv on stdout. |
--unknown-paths | off | Top paths without a known route (UnknownRoute) — candidates for [[routes.known]]. |
sentry report --from 7d --export csv
sentry report --unknown-pathssentry 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.
| Flag | Default | Description |
|---|---|---|
--from <dur> | 24h | Look-back window for observed advisories. |
sentry posture --from 24hSIEM export
sentry export
Exports raw events as CEF, LEEF 2.0 or JSON for SIEM consumption.
Serializers in
siem.rs.
| Flag | Default | Description |
|---|---|---|
--from <dur> | 24h | Initial look-back window. |
--format <fmt> | cef | cef, leef or json. |
--out <file> | (stdout) | Write to a file instead of stdout. |
--follow | off | Keep 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:514Config
sentry config
Validates or prints the resolved config. Handler in
cmd.rs.
| Subcommand | Description |
|---|---|
validate | Compiles custom rules and protocol schemas, rejects [posture] mode = "enforce", emits edge advisories and prints the summary. |
show | Prints the resolved config (TOML + env overlay). |
sentry config validateAI model
sentry model
Lifecycle of the classic ONNX model. Handler in
cmd.rs.
| Subcommand | Description |
|---|---|
status | Provider, mode (fork/inline/shadow), trigger, threshold, loaded model (needs a build with --features onnx to actually load it). |
reload | Publishes 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 reloadCloudflare
sentry cloudflare
Cloudflare integration (credentials via SENTRY_CF_TOKEN,
SENTRY_CF_ZONE and optionally SENTRY_CF_ACCOUNT). Handler in
cmd.rs.
| Subcommand | Description |
|---|---|
status | Validates the token, shows zone/account, sentry access-rule count and IP List. |
test | Dry-run verification of token + zone (makes no changes). |
pull | Lists the access rules created by sentry at the edge (best-effort). |
sentry cloudflare statusIsolated test
sentry test
Runs the pipeline (rules + heuristics + scorer) on a single payload, no
network or database. Handler in
cmd.rs.
| Flag | Default | Description |
|---|---|---|
--path <p> | / | Simulated path. |
--method <m> | GET | Simulated method. |
sentry test "1' OR '1'='1" --path /login --method POSTBenchmarks
sentry bench
Provider evaluation harness. Handler in
bench_llm.rs.
| Subcommand | Description |
|---|---|
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 200Environment 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.
| Variable | Used by | Read in |
|---|---|---|
SENTRY_CONFIG | Config path (equivalent to --config). | cli.rs |
SENTRY_STORAGE__POSTGRES__URL | Postgres URL. | config.rs |
SENTRY_CF_TOKEN | Cloudflare API token (actions + CLI + TUI). | cmd.rs, daemon.rs |
SENTRY_CF_ZONE | Cloudflare zone id. | cmd.rs |
SENTRY_CF_ACCOUNT | Account id override (derived from the zone when unset). | cmd.rs, lists.rs |
SENTRY_LLM_KEY | OpenRouter API key ([llm]). | daemon.rs |
SENTRY_JEV_KEY | jev LLM provider key (fallbacks TYPESAFE_API_KEY / JEV_API_KEY). | jev.rs |
SENTRY_SESSION_SECRET | Dashboard session HMAC key ([server.auth] session_secret_env). | config.rs (core) |
SENTRY_WEBHOOK_SECRET | Webhook payload HMAC ([server] webhook_secret_env and the webhook action). | config.rs (core), daemon.rs |
SENTRY_EDGE_CHALLENGE_SECRET | JS challenge PoW secret (required with [edge.challenge] enabled). | config.rs (core) |
SENTRY_ABUSEIPDB_KEY | AbuseIPDB ([ip_lookup] and the report action). | config.rs (core) |
SENTRY_REPORTEDIP_KEY | report action key (reportedip provider). | lib.rs (report) |
SENTRY_OPN_API_KEY / SENTRY_OPN_API_SECRET | OPNsense REST credentials. | lib.rs (opnsense) |