CLI for Socket.dev security analysis
pnpm install -g socket
socket --help
socket npm [args...]
/socket npx [args...]
- Wrap npm/npx with security scanningsocket pnpm [args...]
/socket yarn [args...]
- Wrap pnpm/yarn with security scanningsocket pip [args...]
- Wrap pip with security scanningsocket scan
- Create and manage security scanssocket package <name>
- Analyze package security scoressocket fix
- Fix CVEs in dependenciessocket optimize
- Optimize dependencies with@socketregistry
overridessocket cdxgen [command]
- Run cdxgen for SBOM generation
socket organization
(alias:org
) - Manage organization settingssocket repository
(alias:repo
) - Manage repositoriessocket dependencies
(alias:deps
) - View organization dependenciessocket audit-log
(alias:audit
) - View audit logssocket analytics
- View organization analyticssocket threat-feed
(alias:feed
) - View threat intelligence
socket login
- Authenticate with Socket.devsocket logout
- Remove authenticationsocket whoami
- Show authenticated usersocket config
- Manage CLI configuration
All aliases support the flags and arguments of the commands they alias.
socket ci
- Alias forsocket scan create --report
(creates report and exits with error if unhealthy)socket org
- Alias forsocket organization
socket repo
- Alias forsocket repository
socket pkg
- Alias forsocket package
socket deps
- Alias forsocket dependencies
socket audit
- Alias forsocket audit-log
socket feed
- Alias forsocket threat-feed
--json
- Output as JSON--markdown
- Output as Markdown
--dry-run
- Run without uploading--debug
- Show debug output--help
- Show help--max-old-space-size
- Set Node.js memory limit--max-semi-space-size
- Set Node.js heap size--version
- Show version
Socket CLI reads socket.yml
configuration files.
Supports version 2 format with projectIgnorePaths
for excluding files from reports.
SOCKET_CLI_API_TOKEN
- Socket API tokenSOCKET_CLI_CONFIG
- JSON configuration objectSOCKET_CLI_GITHUB_API_URL
- GitHub API base URLSOCKET_CLI_GIT_USER_EMAIL
- Git user email (default:[email protected]
)SOCKET_CLI_GIT_USER_NAME
- Git user name (default:Socket Bot
)SOCKET_CLI_GITHUB_TOKEN
- GitHub token with repo access (alias:GITHUB_TOKEN
)SOCKET_CLI_NO_API_TOKEN
- Disable default API tokenSOCKET_CLI_NPM_PATH
- Path to npm directorySOCKET_CLI_ORG_SLUG
- Socket organization slugSOCKET_CLI_ACCEPT_RISKS
- Accept npm/npx risksSOCKET_CLI_VIEW_ALL_RISKS
- Show all npm/npx risks
Run locally:
pnpm install
pnpm run build
pnpm exec socket
SOCKET_CLI_API_BASE_URL
- API base URL (default:https://api.socket.dev/v0/
)SOCKET_CLI_API_PROXY
- Proxy for API requests (aliases:HTTPS_PROXY
,https_proxy
,HTTP_PROXY
,http_proxy
)SOCKET_CLI_API_TIMEOUT
- API request timeout in millisecondsSOCKET_CLI_DEBUG
- Enable debug loggingDEBUG
- Enabledebug
package logging
