A mode flag replaces the check. Use one mode flag at a time.
The mode flags refuse the flags that only make sense for a check, such as --fix, --quiet and --threads.
The --rules flag also accepts -f.
The exit code is:
Code
Meaning
0
The run has no errors. Warnings do not change the code.
1
The run has errors. The code is also 1 when --deny-warnings finds a warning, or when --max-warnings finds too many.
2
The invocation or the config is not valid.
Arguments
Flag
Description
[PATHS]...
Files, directories or globs where the graph starts. The default is entries from the config file, or .
General
Flag
Description
-h, --help
Print help
-V, --version
Print version
Mode
Flag
Description
--init
Write a starter config file. The default is oxcruise.config.ts. Use -c to choose the file and its format
--migrate[=<FILE>]
Convert a dependency-cruiser config (found automatically, or FILE) to the -c file. The default target is oxcruise.config.ts
--visualize[=<DIR>]
Write an interactive architecture site (treemap, dependency graph, violations) to DIR. The default is oxcruise-report
--rules
List the built-in rules by category. Use -f json to print them as JSON
--print-config
Print the resolved config as JSON, with extends applied and the level of every category
Config
Flag
Description
-c, --config <FILE>
The config file to read. With --init or --migrate, the file to write
Input
Flag
Description
--ignore-pattern <GLOB>
Leave out modules that match these globs, in addition to ignorePatterns. Repeat the flag for more globs
--max-depth <N>
Follow dependencies at most N hops from the entries. Deeper modules are not in the graph, so no output or rule sees them
--symbols
Extract exports and the names that each import uses, for json output and plugins. Rules that need them enable this flag
--production
Production mode for unused-exports, unused-packages and unused-modules. The rules ignore tests, and they do not check devDependencies
Output
Flag
Description
-f, --format <FORMAT>
The output format: default, long, json, github, text, or plugin/reporter (default: default)
--fix
Apply the automatic fixes of unused-exports and unused-packages: remove an export keyword, a list entry or a package.json entry. Run again for the fixes that these changes unlock
--quiet
Report errors only. Warnings still count for the warning limits
Handle Warnings
Flag
Description
--max-warnings <N>
Exit with an error when there are more than N warnings
--deny-warnings
Exit with an error when there are any warnings
Runtime
Flag
Description
--threads <N>
The number of worker threads. The default is all cores