Skip to content
LogoLogo

CLI reference

Validate and visualise JS/TS dependency graphs.

oxcruise [OPTIONS] [PATHS]...

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:

CodeMeaning
0The run has no errors. Warnings do not change the code.
1The run has errors. The code is also 1 when --deny-warnings finds a warning, or when --max-warnings finds too many.
2The invocation or the config is not valid.

Arguments

FlagDescription
[PATHS]...Files, directories or globs where the graph starts. The default is entries from the config file, or .

General

FlagDescription
-h, --helpPrint help
-V, --versionPrint version

Mode

FlagDescription
--initWrite 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
--rulesList the built-in rules by category. Use -f json to print them as JSON
--print-configPrint the resolved config as JSON, with extends applied and the level of every category

Config

FlagDescription
-c, --config <FILE>The config file to read. With --init or --migrate, the file to write

Input

FlagDescription
--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
--symbolsExtract exports and the names that each import uses, for json output and plugins. Rules that need them enable this flag
--productionProduction mode for unused-exports, unused-packages and unused-modules. The rules ignore tests, and they do not check devDependencies

Output

FlagDescription
-f, --format <FORMAT>The output format: default, long, json, github, text, or plugin/reporter (default: default)
--fixApply 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
--quietReport errors only. Warnings still count for the warning limits

Handle Warnings

FlagDescription
--max-warnings <N>Exit with an error when there are more than N warnings
--deny-warningsExit with an error when there are any warnings

Runtime

FlagDescription
--threads <N>The number of worker threads. The default is all cores
--cwd <DIR>Run as if the command started in DIR