Snyk CLI
$ snyk Official Med Risksnyk checks open-source dependencies (snyk test), SAST code (snyk code test), containers, and IaC manifests against Snyk's vulnerability intelligence with --json output. Unlike offline scanners, it requires Snyk authentication and transmits dependency/code data to Snyk APIs.
brew install snyk/tap/snyk snyk test --json runs directly against workspace lockfiles with structured JSON output and explicit exit codes.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports --json / --sarif across test, code test, container test, and iac test, plus SNYK_TOKEN headless auth.
- Native
--jsonoutput and clear exit codes (0pass,1vulns,2error)
test subcommands do not mutate local files, but require cloud auth and upload manifest/code snippets to Snyk APIs; snyk monitor mutates remote SaaS projects.
- Cloud API upload requirement and remote state change via
snyk monitor
Available via brew, npm, and standalone binaries, though snyk test requires target ecosystem package managers (npm/pip/maven) installed locally.
- Multi-ecosystem install; depends on local build tools for dependency resolution
Unified SCA, SAST, container, and IaC checks with upgrade-path remediation advice.
- Actionable remediation paths in
--jsonoutput
Official vendor CLI (snyk/cli) maintained actively by Snyk.
- Active Apache-2.0 vendor repository
Thorough CLI documentation at docs.snyk.io/snyk-cli.
- Official command reference and CI examples
Security, Auth & Guardrails
Reads SNYK_TOKEN env var in headless CI/agents, or stores OAuth/API tokens in ~/.config/configstore/snyk.json after snyk auth.
CLI is open-source (Apache-2.0); Snyk SaaS provides a limited free tier and paid commercial plans.
# Snyk CLI Agent Rules - Use `snyk test --json` / `snyk iac test --json` (read-only checks); avoid `snyk monitor` unless explicitly publishing a remote project snapshot. - Verify `SNYK_TOKEN` is set before running in headless shells so `snyk auth` browser flow is not triggered.
Agent-Ready Command Recipes
Safe Read-Only Queries
snyk test --json --severity-threshold=high
Evaluates project manifests/lockfiles against Snyk's vuln DB and prints JSON findings.
snyk iac test --json
Checks Terraform, Kubernetes, and CloudFormation files for misconfigurations in JSON.
Strengths for Agents
- + Consistent
--jsonoutput with actionable dependency upgrade paths. - + Covers SCA, SAST, containers, and IaC under one vendor CLI.
Caveats & Pitfalls
- ! Requires
SNYK_TOKENorsnyk authand sends manifests/code to Snyk cloud servers (unlike offlinetrivy/osv-scanner). - ! Exit code
1indicates vulnerabilities found rather than a CLI crash.