OS Manuals

/usr/bin/gitleaks

SAST tool for detecting and preventing hardcoded secrets like passwords, api keys, and tokens in git repos

From gitleaks 8.30.1-r31 (os), captured 2026-11-09 by running gitleaks --help (exit 0). permalink

Also provided by 1 other package version
Gitleaks scans code, past or present, for secrets

Usage:
  gitleaks [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  dir         scan directories or files for secrets
  git         scan git repositories for secrets
  help        Help about any command
  stdin       detect secrets from stdin
  version     display gitleaks version

Flags:
  -b, --baseline-path string          path to baseline with issues that can be ignored
  -c, --config string                 config file path
                                      order of precedence:
                                      1. --config/-c
                                      2. env var GITLEAKS_CONFIG
                                      3. env var GITLEAKS_CONFIG_TOML with the file content
                                      4. (target path)/.gitleaks.toml
                                      If none of the four options are used, then gitleaks will use the default config
      --diagnostics string            enable diagnostics (http OR comma-separated list: cpu,mem,trace). cpu=CPU prof, mem=memory prof, trace=exec tracing, http=serve via net/http/pprof
      --diagnostics-dir string        directory to store diagnostics output files when not using http mode (defaults to current directory)
      --enable-rule strings           only enable specific rules by id
      --exit-code int                 exit code when leaks have been encountered (default 1)
  -i, --gitleaks-ignore-path string   path to .gitleaksignore file or folder containing one (default ".")
  -h, --help                          help for gitleaks
      --ignore-gitleaks-allow         ignore gitleaks:allow comments
  -l, --log-level string              log level (trace, debug, info, warn, error, fatal) (default "info")
      --max-archive-depth int         allow scanning into nested archives up to this depth (default "0", no archive traversal is done)
      --max-decode-depth int          allow recursive decoding up to this depth (default 5)
      --max-target-megabytes int      files larger than this will be skipped
      --no-banner                     suppress banner
      --no-color                      turn off color for verbose output
      --redact uint[=100]             redact secrets from logs and stdout. To redact only parts of the secret just apply a percent value from 0..100. For example --redact=20 (default 100%)
  -f, --report-format string          output format (json, csv, junit, sarif, template)
  -r, --report-path string            report file (use "-" for stdout)
      --report-template string        template file used to generate the report (implies --report-format=template)
      --timeout int                   set a timeout for gitleaks commands in seconds (default "0", no timeout is set)
  -v, --verbose                       show verbose output from scan
      --version                       version for gitleaks

Use "gitleaks [command] --help" for more information about a command.
Options (22)
OptionDescriptionSource
-b, --baseline-path stringpath to baseline with issues that can be ignoredhelp
-c, --config stringconfig file path order of precedence: 1.help
--diagnostics stringenable diagnostics (http OR comma-separated list: cpu,mem,trace).help
--diagnostics-dir stringdirectory to store diagnostics output files when not using http mode (defaults to current directory)help
--enable-rule stringsonly enable specific rules by idhelp
--exit-code intexit code when leaks have been encountered (default 1)help
-i, --gitleaks-ignore-path stringpath to .gitleaksignore file or folder containing one (default ".")help
-h, --helphelp for gitleakshelp
--ignore-gitleaks-allowignore gitleaks:allow commentshelp
-l, --log-level stringlog level (trace, debug, info, warn, error, fatal) (default "info")help
--max-archive-depth intallow scanning into nested archives up to this depth (default "0", no archive traversal is done)help
--max-decode-depth intallow recursive decoding up to this depth (default 5)help
--max-target-megabytes intfiles larger than this will be skippedhelp
--no-bannersuppress bannerhelp
--no-colorturn off color for verbose outputhelp
--redact uint[=100redact secrets from logs and stdout.help
-f, --report-format stringoutput format (json, csv, junit, sarif, template)help
-r, --report-path stringreport file (use "-" for stdout)help
--report-template stringtemplate file used to generate the report (implies --report-format=template)help
--timeout intset a timeout for gitleaks commands in seconds (default "0", no timeout is set)help
-v, --verboseshow verbose output from scanhelp
--versionversion for gitleakshelp

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.