For the complete documentation index, see llms.txt. This page is also available as Markdown.

Upgrade the Snyk CLI

How to upgrade the Snyk CLI to stay secure and current

Upgrade the Snyk CLI regularly to maintain a secure environment. Snyk releases frequent updates to provide the latest vulnerability definitions, introduce new features, and ensure compatibility with package managers. Outdated versions can limit scanning capabilities, trigger false positives, or cause inaccurate results.

Select the upgrade command that matches your original installation method.

Package managers

Homebrew

Upgrade the Snyk CLI to the latest version using the standard Homebrew upgrade command. Snyk updates the Homebrew tap daily:

npm

Check your current version using the command npm -v.

To upgrade to the latest version of the Snyk CLI with npm, use one of these commands:

Yarn

To upgrade the Snyk CLI globally using Yarn, run the upgrade command or add the package again to fetch the latest version:

Scoop (Windows)

Check your current version using the command scoop status.

To upgrade to the latest version of Scoop, use the command:

Docker

Upgrade the Snyk CLI in a Docker environment by pulling the latest image from Docker Hub. This action overwrites the local cached image:

GitHub actions

The Snyk GitHub Action type in your workflow determines how the Snyk CLI updates.

Using the @master branch tag (for example, uses: snyk/actions/node@master) ensures your pipeline pulls the latest version of the GitHub Action. This tag does not dictate the CLI version.

Snyk updates the CLI version in one of two ways:

Language-specific actions (Docker based)

Language-specific actions (such as Node and Python) run using Snyk Docker images. These images use the latest version of the Snyk CLI by default.

Snyk setup action (binary installation)

The Snyk Setup action installs the CLI directly from a binary. By default, this action downloads and uses the latest version of the Snyk CLI.

Unlike Docker-based actions, the Snyk Setup action allows you to pin a specific CLI version to prevent automatic updates. Use the version input to specify the version:

Direct binary download

Update the Snyk CLI manually when using standalone executables. To update, download the latest binary and replace the existing executable. For example, on Linux or MacOS, run the curl download command again.

For more information including the download commands, visit Install the Snyk CLI.

Last updated

Was this helpful?