website/versioned_docs/version-1.23.5/gettingstarted/cli.mdx
import CliOptions from "./_cli-options.md"; import CliGeneratorOptions from "./_cli-generator-options.md";
There are different ways to install the Command Line Interface (CLI):
brew install detekt
detekt [options]
scoop install detekt
detekt [options]
curl -sSLO https://github.com/detekt/detekt/releases/download/v1.23.5/detekt-cli-1.23.5.zip
unzip detekt-cli-1.23.5.zip
./detekt-cli-1.23.5/bin/detekt-cli --help
As a prerequisite, you have to add the unstable channel via nix-channel and then execute the following command.
nix-shell -I nixpkgs=channel:nixpkgs-unstable -p detekt
detekt will exit with one of the following exit codes:
| Exit code | Description |
|---|---|
| 0 | detekt ran normally and maxIssues count was not reached in BuildFailureReport. |
| 1 | An unexpected error occurred |
| 2 | MaxIssues count was reached in BuildFailureReport. |
| 3 | Invalid detekt configuration file detected. |
The following parameters are shown when --help is entered.
java -jar detekt-generator-1.23.5-all.jar -gcrc -i /path/to/rule1, /path/to/rule2