Using Snyk Code via the CLI
The Snyk Command Line Interface (CLI) for Snyk Code enables you to bring the functionality of Snyk Code into your development workflow. By using the Snyk CLI, you can run Snyk Code tests locally, or incorporate them with your CI/CD pipeline to scan your source code for security vulnerabilities.
Before you start using the Snyk CLI for testing your source code with Snyk Code, verify you have the following prerequisites:
- A Snyk Account. Note: For more information on creating a Snyk Account, see Setting Up your Snyk Account.
- Repositories with code in a supported language and framework. Note: For more information, see Snyk Code - Supported languages and frameworks.
- An installed and authenticated Snyk CLI. Notes:
- The minimum Snyk CLI version for Snyk Code is 1.716.0. Snyk recommends using the latest version of the CLI. See Install or update the Snyk CLI for instructions.
To test your repository code via the Snyk Code CLI, use the
snyk code test
command.
For more information, see Testing your source code via the CLI.Before the test, you may want to do the following:
After the test, you can do the following: