The Snyk CLI helps you find and fix known vulnerabilities in your dependencies, both manually and as part of your continuous integration (CI (Build)) system.
Installing the Snyk CLI
Install Snyk CLI via:
Homebrew – brew tap snyk/tap && brew install snyk
A manual installer available from Snyk’s GitHub
For more detailed installation guidance and options, see CLI - Installation.
Authenticating the Snyk app
Snyk commands require authentication via GitHub, Bitbucket or Google. No repository permissions are needed at this stage, only your email address.
To authenticate Snyk, run snyk auth from the CLI.
For more authentication options, see CLI – Authentication.
Running a test
Once installed and authenticated, change directory into a folder containing a supported package manifest file (package.json, pom.xml, composer.lock, etc.) and run:
This will show all vulnerabilities identified, their path, and remediation guidance. To monitor your project regularly and receive ongoing notifications when new vulnerabilities are introduced, see Monitoring your project.
Monitoring your project
New vulnerabilities are constantly disclosed - which is where monitoring comes in. Once you set up your project to be monitored, Snyk regularly tests your code and notifies you whenever new vulnerabilities are introduced.
Open a terminal from your project directory and run snyk monitor.
This command takes a snapshot of your current dependencies so we can regularly scan your code, and notify you about newly disclosed vulnerabilities as they are introduced, or when a previously unavailable patch or upgrade path is created.
Log in to the Snyk app and navigate to snyk.io/monitor to see the latest snapshot and scan results.
Run snyk help or see Snyk CLI for the full list of commands and capabilities.
We also have a handy cheat sheet available.