Install the Snyk CLI

Use our Snyk CLI tool to find and fix known vulnerabilities in your dependencies, both ad hoc and as part of your CI (Build) system.

The Snyk CLI requires you to authenticate with your account before using it. See Authenticate the CLI with your account.

Install the Snyk CLI using one of these options:

Install the Snyk CLI with npm

Install our Snyk CLI tool using npm.

Prerequisites:

Steps:

Run these commands to install it for local use:

npm install -g snyk

Once installed, you need to authenticate with your Snyk account:

snyk auth

To test your installation change directory into a folder containing a supported package manifest file (package.json, pom.xml, composer.lock, etc.) and run:

cd /my/project/
snyk test

Alternatively, you can perform a quick test on a public npm package, for instance:

snyk test ionic

As you can see, Snyk found and reported several vulnerabilities in the package. For each issue found, Snyk provides the severity of the issue, a link to a detailed description, the path through which the vulnerable module got into your system, and guidance on how to fix the problem.

Install the Snyk CLI using the prebuilt binaries

You can download and use Snyk's prebuilt binaries already containing npm, the Snyk CLI and other necessary components. To download the prebuilt binary, visit the Releases tab in the CLI repository page in GitHub:

Once you've completed installation, get started testing and remediating your vulnerabilities with our Getting started guide and our full list of our CLI commands, options and arguments.

Install the Snyk CLI tool with a container

You can use a Snyk created Docker container already containing npm, the Snyk CLI and other necessary components. Follow the detailed instructions here https://hub.docker.com/r/snyk/snyk-cli

Once you've completed installation, get started testing and remediating your vulnerabilities with our Getting started guide and our full list of our CLI commands, options and arguments.

Install the Snyk CLI with Homebrew

From MAC OSx and Linux environments, you can use Homebrew to install our Snyk CLI tool. The repository for installation is stored in our GitHub.

Prerequisites:

  • Supported for MAC OSx and Linux environments only.

  • Ensure Homebrew has already been installed:

    brew tap snyk/tap

Steps:

  1. Install Snyk as follows:

    brew install snyk

Install the Snyk CLI with the Windows Scoop package manager

From Windows environments, you can use Scoop to install our Snyk CLI tool. The repository for installation is stored in our GitHub.

Prerequisites:

  • Supported for Windows environments only.

  • Ensure Scoop has already been installed:

    scoop bucket add snyk https://github.com/snyk/scoop-snyk

Steps:

  1. Install Snyk:

    scoop install snyk

See also

Ready to get started with Snyk? Sign up for free!