Authenticate the CLI with your account
To associate the Snyk CLI for use with your Snyk account, you must first authenticate your machine. No repository permissions are needed at this stage, only your email address. When you have authenticated, you can get started using the CLI.
You can authenticate:
Through your browser by running
snyk authfrom the CLI; see the Auth command help.Using your API token
Using the
SNYK_TOKENenvironment variable; see Configure the Snyk CLI. UseSNYK_TOKENin a CI/CD environment.
To authenticate using your API token:
Go to your Snyk account (Account Settings > API Token section).
In the KEY field, click click to show; then select and copy your API token. A screenshot follows.
In the CLI, run
snyk auth [<API_TOKEN>]orsnyk config set api=<token>. The<API_TOKEN>is validated by the Snyk API.

Last updated
Was this helpful?

