Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

Snyk CLI

$ snyk Official Med Risk
Snyk · Security & Secrets · Apache-2.0 · macos / linux / windows

snyk 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.

FCRS-1.0 Score
82 /100
Good
Medium Confidence
Zero-Friction Install
brew install snyk/tap/snyk
CLI vs MCP Decision CLI Preferred vs MCP

snyk test --json runs directly against workspace lockfiles with structured JSON output and explicit exit codes.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
✓ Read-Only Mode
— NO_COLOR Clean
— Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 22 / 25

Supports --json / --sarif across test, code test, container test, and iac test, plus SNYK_TOKEN headless auth.

  • Native --json output and clear exit codes (0 pass, 1 vulns, 2 error)
Trust & Safety 18 / 25

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
Setup & Portability 12 / 15

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
Utility & Efficiency 13 / 15

Unified SCA, SAST, container, and IaC checks with upgrade-path remediation advice.

  • Actionable remediation paths in --json output
Maintenance & Lineage 9 / 10

Official vendor CLI (snyk/cli) maintained actively by Snyk.

  • Active Apache-2.0 vendor repository
Docs & Verifiability 8 / 10

Thorough CLI documentation at docs.snyk.io/snyk-cli.

  • Official command reference and CI examples

Security, Auth & Guardrails

Auth Modes
Env API Key OAuth Browser Config File
Credential Storage

Reads SNYK_TOKEN env var in headless CI/agents, or stores OAuth/API tokens in ~/.config/configstore/snyk.json after snyk auth.

Side Effects
Read-Only Remote Write
Cost & Quotas

CLI is open-source (Apache-2.0); Snyk SaaS provides a limited free tier and paid commercial plans.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# 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

Audit open-source dependencies as JSON
snyk test --json --severity-threshold=high

Evaluates project manifests/lockfiles against Snyk's vuln DB and prints JSON findings.

Run IaC misconfiguration scan locally
snyk iac test --json

Checks Terraform, Kubernetes, and CloudFormation files for misconfigurations in JSON.

Strengths for Agents

  • + Consistent --json output with actionable dependency upgrade paths.
  • + Covers SCA, SAST, containers, and IaC under one vendor CLI.

Caveats & Pitfalls

  • ! Requires SNYK_TOKEN or snyk auth and sends manifests/code to Snyk cloud servers (unlike offline trivy/osv-scanner).
  • ! Exit code 1 indicates vulnerabilities found rather than a CLI crash.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI