CLI reference
northline check
northline check [flags]
--config string path to .northline.yaml (default: search upwards)
--fail-on string new | any (default "any")
--base string merge base ref for --fail-on new (default "origin/HEAD")
--format string text | json | sarif (default "text")
--max-depth int stop walking below this depth (0 = unlimited)
--timeout duration abort after this long (default 120s)
Walks the repository, resolves imports, applies layers and rules, prints findings.
Progress goes to stderr so --format json stays clean on stdout.
northline graph
northline graph --format dot > graph.dot
northline graph --format json --include external
Emits the resolved graph without applying rules. Useful for diagrams and for debugging why a rule fired: every edge carries its source file and line.
Output formats
# text (default)
FAIL src/domain/order.ts:14 domain -> infra
rule: domain must stay free of infrastructure imports
# json
{"violations":[{"file":"src/domain/order.ts","line":14,"from":"domain","to":"infra"}],"checked":1284}
# sarif — for code scanning dashboards
northline check --format sarif > northline.sarif
Exit codes
0 | no violations |
1 | violations found |
2 | config or graph error (bad glob, unreadable manifest) |
3 | timeout |
The tool never modifies the repository; everything is read-only.