snyk
Version:
snyk library and cli utility
121 lines (90 loc) • 5.29 kB
Plain Text
[1mNAME[0m
[1msnyk-code [22m- Find security issues using Static code analysis
[1mSYNOPSIS[0m
[1msnyk code [22m[[4mCOMMAND[24m] [[4mOPTIONS[24m] [4mPATH[0m
[1mDESCRIPTION[0m
Find security issues using Static code analysis
For more information see the CLI for Snyk Code help page
[4mhttps://docs.snyk.io/snyk-code/cli-for-snyk-code[0m
[1mCOMMANDS[0m
[1mtest [22mTest for any known issue.
[1mOPTIONS[0m
[1m--severity-threshold[22m=low|medium|high|critical
Only report configuration issues with the provided severity
level or higher. Please note that the Snyk Code configuration
issues do not currently use the [1mcritical [22mseverity level.
[1m--json [22mPrints results in JSON format.
[1m--org[22m=[4mORG_NAME[0m
Specify the [4mORG_NAME[24m to run Snyk commands tied to a specific or-
ganization. This will influence private tests limits. If you
have multiple organizations, you can set a default from the CLI
using:
[1m$ snyk config set org[22m=[4mORG_NAME[0m
Setting a default will ensure all newly tested projects will be
tested under your default organization. If you need to override
the default, you can use the [1m--org[22m=[4mORG_NAME[24m argument. Default:
uses [4mORG_NAME[24m that sets as default in your Account settings
[4mhttps://app.snyk.io/account[0m
[1m--sarif[0m
Return results in SARIF format.
[1mFlags available accross all commands[0m
[1m--insecure[0m
Ignore unknown certificate authorities.
[1m-d [22mOutput debug logs.
[1m--quiet[22m, [1m-q[0m
Silence all output.
[1m--version[22m, [1m-v[0m
Prints versions.
[[4mCOMMAND[24m] [1m--help[22m, [1m--help [22m[[4mCOMMAND[24m], [1m-h[0m
Prints a help text. You may specify a [4mCOMMAND[24m to get more de-
tails.
[1mEXIT CODES[0m
Possible exit codes and their meaning:
[1m0[22m: success, no vulns found
[1m1[22m: action_needed, vulns found
[1m2[22m: failure, try to re-run command
[1m3[22m: failure, no supported projects detected
[1mENVIRONMENT[0m
You can set these environment variables to change CLI run settings.
[1mSNYK_TOKEN[0m
Snyk authorization token. Setting this envvar will override the
token that may be available in your [1msnyk config [22msettings.
How to get your account token [4mhttps://snyk.co/ucT6J[0m
How to use Service Accounts [4mhttps://snyk.co/ucT6L[0m
[1mSNYK_CFG_KEY[0m
Allows you to override any key that's also available as [1msnyk[0m
[1mconfig [22moption.
E.g. [1mSNYK_CFG_ORG[22m=myorg will override default org option in [1mcon-[0m
[1mfig [22mwith "myorg".
[1mSNYK_REGISTRY_USERNAME[0m
Specify a username to use when connecting to a container reg-
istry. Note that using the [1m--username [22mflag will override this
value. This will be ignored in favour of local Docker binary
credentials when Docker is present.
[1mSNYK_REGISTRY_PASSWORD[0m
Specify a password to use when connecting to a container reg-
istry. Note that using the [1m--password [22mflag will override this
value. This will be ignored in favour of local Docker binary
credentials when Docker is present.
[1mConnecting to Snyk API[0m
By default Snyk CLI will connect to [1mhttps://snyk.io/api/v1[22m.
[1mSNYK_API[0m
Sets API host to use for Snyk requests. Useful for on-premise
instances and configuring proxies. If set with [1mhttp [22mprotocol CLI
will upgrade the requests to [1mhttps[22m. Unless [1mSNYK_HTTP_PROTO-[0m
[1mCOL_UPGRADE [22mis set to [1m0[22m.
[1mSNYK_HTTP_PROTOCOL_UPGRADE[22m=0
If set to the value of [1m0[22m, API requests aimed at [1mhttp [22mURLs will
not be upgraded to [1mhttps[22m. If not set, the default behavior will
be to upgrade these requests from [1mhttp [22mto [1mhttps[22m. Useful e.g.,
for reverse proxies.
[1mHTTPS_PROXY [22mand [1mHTTP_PROXY[0m
Allows you to specify a proxy to use for [1mhttps [22mand [1mhttp [22mcalls.
The [1mhttps [22min the [1mHTTPS_PROXY [22mmeans that [4mrequests[24m [4musing[24m [1mhttps[0m
protocol will use this proxy. The proxy itself doesn't need to
use [1mhttps[22m.
[1mNOTICES[0m
[1mSnyk API usage policy[0m
The use of Snyk's API, whether through the use of the 'snyk' npm pack-
age or otherwise, is subject to the terms & conditions
[4mhttps://snyk.co/ucT6N[0m