Socket CLI
$ socket Official Low RiskSocket CLI (socket) inspects npm, PyPI, and Go lockfiles and wraps npm/npx installs to detect malware, typosquatting, install scripts, and supply-chain risks. Features --json, --markdown, --dry-run, --no-banner, and --no-spinner for clean CI and agent automation.
npm install -g socket socket reads local lockfiles (package-lock.json, pnpm-lock.yaml, requirements.txt) and intercepts local socket npm install invocations directly in the workspace.
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, --markdown, --no-banner, --no-spinner, and --help-full for clean machine parsing.
--json,--no-banner, and--no-spinnerstrip decorative TTY outputsocket.jsonsupports deterministic project-level defaults
Provides --dry-run on scan create and patches, plus env var token override (SOCKET_CLI_API_TOKEN), though scan create uploads manifests remotely.
--dry-runprevents remote upload or state mutation
Cross-platform Node.js CLI installable via npm install -g socket or zero-install npx socket.
- Works on macOS, Linux, and Windows via npm and npx
Combines lockfile scanning, safe socket npm install wrapping, and socket patch remediation in one CLI.
- Covers
scan,npm,patch, andorganizationsubcommands
Official Socket repository (SocketDev/socket-cli) under MIT license.
- Actively maintained by Socket Security
Well-documented on docs.socket.dev (including /llms.txt) and comprehensive --help-full output.
- Publishes
docs.socket.dev/llms.txtand full CLI flag docs
Security, Auth & Guardrails
Reads SOCKET_CLI_API_TOKEN from environment variables (highest precedence) or persists apiToken in OS config storage (~/Library/Application Support/socket/settings/config.json on macOS, ~/.local/share/socket/settings/config.json on Linux).
MIT open-source CLI; free tier covers public scans, while organization policy enforcement requires a Socket plan.
# Socket CLI (socket) Agent Rules - Always pass `--json --no-banner --no-spinner` to suppress ASCII art and spinners. - Authenticate via `SOCKET_CLI_API_TOKEN` instead of interactive `socket login`. - Preview scan targets with `socket scan create --dry-run` before uploading manifests.
Agent-Ready Command Recipes
Safe Read-Only Queries
socket scan create --dry-run --json --no-banner --no-spinner
Evaluates which manifest and lockfile paths would be scanned without uploading a persistent scan report.
socket organization dependencies --json --no-banner --no-spinner
Exports tracked dependency inventory across the Socket organization in raw JSON.
Controlled Writes & Previews
socket scan create --json --no-banner --no-spinner
Uploads workspace dependency manifests to Socket and returns structured supply-chain risk findings.
Strengths for Agents
- + Purpose-built flags (
--json,--no-banner,--no-spinner) keep stdout clean for agents. - + Wraps
npmandnpxto block malicious packages before lifecycle scripts execute.
Caveats & Pitfalls
- ! Most organization and scan commands require a
SOCKET_CLI_API_TOKENfrom a Socket account. - ! Without
--no-bannerand--no-spinner, default TTY output includes decorative banners.