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

Snyk CLI for Snyk Secrets

How to use the Snyk CLI to scan your source code for hardcoded secrets

The Snyk Command Line Interface (CLI) enables you to bring the functionality of Snyk Secrets into your development workflow. Using the Snyk CLI, you can scan your source code locally, in a pre-commit hook, or in your CI/CD pipeline to find hardcoded secrets such as API keys, passwords, and tokens.

Prerequisites for using the Snyk CLI with Snyk Secrets

Before using the Snyk CLI to scan for secrets, verify you have the following prerequisites:

  • A Snyk account.

  • The Secrets feature enabled for your Snyk Organization. If you receive a SNYK-CLI-0016 error, contact your Snyk account manager.

  • The Snyk CLI installed and authenticated.

Using the Snyk CLI for secrets scans

To scan your code for hardcoded secrets using the Snyk CLI, use the snyk secrets test command. For more information, see Secrets scanning in the Snyk CLI.

That page also explains how to do the following:

Last updated

Was this helpful?