reference Environment variables

OPENGREP_URL

Also spelled
SEMGREP_URL
Value
a URL
Default
https://semgrep.dev
See also
OPENGREP_APP_URL, --config, HTTPS_PROXY

The base URL of the rule registry. A --config value that names a registry entry, such as p/NAME, r/NAME, s/NAME, auto or r2c, is downloaded from <base>/c/<value>. When the variable is unset, OPENGREP_APP_URL is used, and when neither is set, the base is https://semgrep.dev.

The variable can point to a mirror or an internal copy of the registry. Configurations that are files, directories, URLs or git+ repositories do not use the registry.

Examples

Where a registry config is fetched from

The host registry.invalid does not exist, so the download fails at once, and the error shows the address Opengrep tried.

app.py
eval(1)
Command and result
$ OPENGREP_URL=http://registry.invalid opengrep scan --config p/python app.py 2>&1 | grep 'Failed to download'
error    Failed to download config from http://registry.invalid/c/p/python: Failure: resolution failed: name resolution failed
$ OPENGREP_URL=http://registry.invalid opengrep scan --config p/python app.py > /dev/null 2>&1; echo "exit status: $?"
exit status: 2