The following usage documentation is for the Semgrep CLI.
Command Line Options
semgrep --help for command line options.
semgrep may exit with the following exit codes:
0: Semgrep ran successfully and found no errors
1: Semgrep ran successfully and found issues in your code
2: Semgrep failed
3: Semgrep failed to parse a file in the specified language
4: Semgrep encountered an invalid pattern
5: Semgrep config is not valid yaml
6: Rule with
--dangerously-allow-arbitrary-code-execution-from-ruleswas not set. See
7: All rules in config are invalid. If semgrep is run with
--strictthen this exit code is returned when any rule in the configs are invalid.
8: Semgrep does not understand specified language
9: Semgrep exceeded match timeout. See
10: Semgrep exceeded max memory while matching. See
11: Semgrep encountered a lexical error when running rule on a file.