Skip to content

Usage

All commands accept --root PATH (project root, default .) and --config PATH (a curfew.toml override).

curfew check

Runs the configured checks and exits non-zero on any error — the CI gate.

curfew check                  # both checks
curfew check --boundaries     # module-boundary check only
curfew check --externals      # external/workspace check only
curfew check --strict         # treat warnings as errors too
curfew check --strict-unresolved   # unresolved imports become errors
curfew check --unused-tools   # also flag unused dev/optional-group deps
curfew check --output json    # machine-readable output for CI/editors
curfew check --color never    # disable colour (also honours NO_COLOR)

Exit codes: 0 clean · 1 violations · 2 config/discovery error · 3 internal.

curfew show

Emits the dependency graph. Mermaid by default; DOT optional. No --web.

curfew show --mermaid -o docs/graph.md   # default; renders on GitHub & Zensical
curfew show --dot -o graph.dot           # GraphViz DOT (if you have GraphViz)
curfew show --third-party                # include third-party distributions
curfew show acme_web                      # focus: only modules under acme_web
curfew show --direction TB                # top-to-bottom layout

curfew report

Shows the direct and transitive dependencies and dependents of a module (given as a dotted name or a path to a .py file).

curfew report curfew.checks.runner
curfew report src/curfew/cli.py --output json

curfew init

Scaffolds a [tool.curfew] config by inferring your current first-party modules and their existing imports, so adoption is incremental — the generated config passes immediately and can be tightened from there.

curfew init >> pyproject.toml   # review before committing