Authenticate the CLI with your account
To associate your Snyk account with the CLI, you must first authenticate your machine (except for using the snyk protect command). No repository permissions are needed at this stage, only your email address.
You can authenticate:
  • Through your browser
  • Using your Organization API key (API token)

Authenticate through your browser

  1. 1.
    Run snyk auth from the CLI.
    A browser tab opens, redirecting you to authenticate the CLI for use with your account.
  2. 2.
    Click Authenticate.
    The authentication ends and you can go back to your terminal to continue working.

Authenticate using your API token

  1. 1.
    Visit your Snyk account (Account Settings > API Token section).
  2. 2.
    In the KEY field, click click to show, then select and copy your API token:
  3. 3.
    In the CLI, run snyk config set api=XXXXXXXX
Last modified 25d ago
Export as PDF
Copy link
Edit on GitHub