SentrySentry
Sentry Auto

Auto CLI

sentry auto subcommands

Auto CLI

The sentry auto subcommand detects the framework at the project root and generates _sentry.auto.toml_ (or merges into sentry.toml) with routes + rules + packs.

Commands

sentry auto                    # detects framework in cwd, generates sentry.auto.toml
sentry auto --root /var/www    # specifies project root
sentry auto --merge            # merge with existing sentry.toml
sentry auto --dry-run          # only shows what it would detect, no write
sentry auto --profile wordpress # force a profile (skip detection)
sentry auto --deep             # AST scan of routes (slow, precise)
sentry auto list-profiles      # lists supported profiles

Flags

FlagDescription
--root <path>Specifies the project root (default: cwd).
--mergeMerges the result into the existing sentry.toml instead of generating sentry.auto.toml.
--dry-runOnly shows what it would detect, does not write a file.
--profile <name>Forces a specific profile, skipping automatic detection.
--deepAST scan of routes via tree-sitter (slow, precise).

Output

_sentry.auto.toml_ (or merge into sentry.toml) containing:

  • [[routes.known]] — exact detected routes
  • [[rules.custom]] — framework-specific rules
  • [[rules.pack]] — recommended packs (e.g. sensitive_paths in enforce)

The user reviews, tweaks, and it's ready. sentry run loads both files.

Examples

Detect framework in cwd

sentry auto
# → detected: Laravel 10.x
# → 12 routes generated, 4 rules, 3 packs
# → written: sentry.auto.toml

Dry-run to see what it would detect

sentry auto --dry-run --deep
# → framework: Rails 7.1
# → routes (AST): 23 exact
# → rules: protect /admin/*, rate-limit /login
# → packs: sensitive_paths=enforce, crawlers_bad=enforce

Merge directly into sentry.toml

sentry auto --merge --root /var/www

Force a profile

sentry auto --profile wordpress

On this page