reference Flags

--quiet

Accepted by
opengrep scan, opengrep ci, opengrep test, opengrep validate, opengrep show, opengrep lsp
Also spelled
-q
See also
--verbose, --debug, OPENGREP_LOG_LEVEL, --max-log-list-entries

Suppresses everything Opengrep writes to standard error: the banner, the progress display, the summary, warnings and error messages. The findings on standard output are not affected. A failed run still ends with a non-zero exit status.

--quiet, --verbose and --debug select the log level; without any of them, warnings and errors are shown. OPENGREP_LOG_LEVEL takes precedence over these flags.

When standard output is a terminal, opengrep scan starts by printing a banner with the Opengrep logo and version to standard error; --quiet leaves it out.

Examples

Only the findings

rule.yaml
rules:  - id: find-eval    pattern: eval(...)    message: found eval    languages: [python]    severity: WARNING
app.py
eval(1)
Command and result
$ opengrep scan --config rule.yaml app.py 2>&1
 ╭┮┭╮ Opengrep
┌┼┼┼┘ the open source static code analysis engine
╰┶┵╯  version X.Y.Z

1 file · 1 rule

app.py

  warn  find-eval
  found eval

     1: eval(1)

1 finding in 1 file
$ opengrep scan --config rule.yaml --quiet app.py 2>&1
app.py

  warn  find-eval
  found eval

     1: eval(1)

Without --quiet, the banner, the number of files and rules, and the number of findings surround the findings. With --quiet, only the findings are printed.

An error is not reported

broken.yaml
rules:  - id: find-eval    pattern: eval(    message: found eval    languages: [python]    severity: WARNING
app.py
eval(1)
Command and result
$ opengrep scan --config broken.yaml --quiet app.py; echo "exit status: $?"
exit status: 2