Skip to main content
The Custoden CLI calls this API from your terminal. It needs Node.js 20 or later, and no account or API key.

Commands

Packages are npm by default. Use pypi:name, name==1.2.3 or --pypi for PyPI.

Install packages safely

custoden install checks each package first. If one is malicious, suspicious or does not exist, nothing is installed. Otherwise it installs the exact versions that were checked, so a release published in between cannot slip in.
The package manager is detected from the nearest lockfile (npm, pnpm, Yarn, Bun, pip, uv or Poetry), or set with --pm.

Scan a project

custoden scan reads lockfiles and manifests locally and sends only package names and versions. Workflows and CI files (package manifests, build and test setup, Makefiles, shell scripts) are sent for analysis.

Check a whole lockfile

custoden lockfile sends each lockfile in the project (or the files you name) to Scan a lockfile, which checks every package, including transitive dependencies, for known malware and vulnerabilities. It costs 5 units per file instead of 1 per package. Unlike scan, it sends the whole file, including any registry URLs in it.

Pre-commit hooks

With pre-commit, add the hook to .pre-commit-config.yaml:
With Husky or another hook manager, run the same command:
The hook checks new and updated dependencies, workflows and CI files, and blocks the commit when something is at or above the thresholds below.

Exit codes

--fail-on sets the package threshold (malicious, suspicious, review, never; default suspicious). --fail-on-severity sets the threshold for findings (critical, high, medium, low, never; default high). --json prints the API results.

Rate limits

The CLI shares the API’s rate limits for your IP address. When it reaches the per-minute limit, it waits and continues. For pull requests, the GitHub Action is a better fit.