Back to Detekt

Run detekt using Command Line Interface

website/versioned_docs/version-1.21.0/gettingstarted/cli.mdx

1.23.81.2 KB
Original Source

import CliOptions from "./_cli-options.md";

Install the cli

There are different ways to install the Command Line Interface (CLI):

MacOS, with Homebrew:

sh
brew install detekt
detekt [options]

Windows, with Scoop

powershell
scoop install detekt
detekt [options]

Any OS:

sh
curl -sSLO https://github.com/detekt/detekt/releases/download/v1.21.0/detekt-cli-1.21.0.zip
unzip detekt-cli-1.21.0.zip
./detekt-cli-1.21.0/bin/detekt-cli --help

Use the cli

detekt will exit with one of the following exit codes:

Exit codeDescription
0detekt ran normally and maxIssues count was not reached in BuildFailureReport.
1An unexpected error occurred
2MaxIssues count was reached in BuildFailureReport.
3Invalid detekt configuration file detected.

The following parameters are shown when --help is entered.

<CliOptions />