CLI usage
Updated
Scan a project, check a package, vet a pull request or stop a risky install, all from your terminal. A scan exits with 1 when it finds something, and a stopped install or check exits with 3, so both can fail a build.
Before you start
Most commands need Crowsnest running on port 8000, and install checks that first. Only check also works without it, as a quick check. Install the command, then start Crowsnest. With Docker installed, one command does it:
crowsnest startThe first run downloads Crowsnest, starts it on port 8000 and shares the current folder with it, read only. To share another folder, run crowsnest start --projects /path/to/folder. Stop it with crowsnest stop; your stored data is kept unless you add --delete-data.
If something does not work, crowsnest doctor checks Docker, Crowsnest and the internet lookups, and says how to fix what it finds. Other ways to start Crowsnest are in the Quickstart.
The commands
| Command | What it does |
|---|---|
crowsnest scan [path] | Scans a project and prints the most serious calls. |
crowsnest investigate <package> | Checks one package. |
crowsnest install <package> | Checks a package, then installs it only if it passes. |
crowsnest check | Vets the package versions a pull request adds or changes. |
crowsnest blast-radius | Shows which of your projects use a publisher's packages. |
crowsnest replay | Runs a check against a saved snapshot of an earlier day. |
crowsnest watch | Streams live events to your terminal. |
crowsnest config | Reads and saves settings. |
crowsnest start, stop, doctor | Run, stop and diagnose the backend. |
Run crowsnest --help for the list, or crowsnest <command> --help for one command. When running from source, replace crowsnest with node dist/index.js from packages/cli.
Scan a project
crowsnest scan /path/to/projectWith no path, it scans the current folder, waits for the scan to finish, then prints the most serious calls. Use -e to pick the kind of project (npm, pypi, cargo or go) and -f json for raw output.
| Exit code | Meaning |
|---|---|
| 0 | Nothing found. |
| 1 | One or more problems found. |
| 2 | The scan failed. |
With -f json the command always exits 0, so read the output instead of the exit code.
If you started Crowsnest with crowsnest start, scan a folder inside the one you shared; any other folder is refused, with a message saying how to share it. With the Docker Compose setup, the path must be one the Crowsnest service can see (Quickstart).
Check one package
crowsnest investigate left-padAdd --deep for extra follow-up checks.
See who else is affected
crowsnest blast-radius --maintainer some-login
crowsnest blast-radius --allThe first lists your projects that use packages from one publisher. --all ranks the fifty publishers with the most risk.
Install a package safely
crowsnest install some-package
crowsnest install @scope/some-package@1.2.3
crowsnest install some-package@^1.2.0Crowsnest works out the exact version npm would install, checks it, and installs that same version if it passes. A range such as ^1.2.0 is resolved first, so the version checked is always the version installed.
A version is stopped when:
- A public malware list names it. Crowsnest checks the OpenSSF malicious-packages list, through OSV.dev.
- Its release looks hijacked. It compares the release with the previous one and looks for a changed build repository, dropped build proof, a new publisher, an added install script or dependency, a sudden size jump, or a year of silence.
- It is under two days old. Most compromises in the 2026 incident replays were removed from the registry within three hours. Change the wait with
--min-release-age <days>, or use0to turn it off. - Its risk is 0.6 (60 percent) or above. See how risk is worked out.
When a version is stopped, nothing is installed and the command exits with 3:
- Checking axios before install...
✖ Blocked: axios@1.14.1
════════════════════════════════════════════════════════
[crowsnest] ✖ BLOCKED: axios@1.14.1
[crowsnest]
[crowsnest] !! ACTIVE IOC: axios@1.14.1 is listed as malicious (MAL-2026-2307)
[crowsnest]
[crowsnest] Risk score: 100%
[crowsnest]
[crowsnest] To override (risk accepted):
[crowsnest] crowsnest install axios@1.14.1 --crowsnest-acknowledge-risk
════════════════════════════════════════════════════════To install anyway, run the override line, and only after you have read the reasons.
| Option | Effect |
|---|---|
--min-release-age <days> | Sets the minimum age of a release. 0 turns it off. |
--quick | Installs with only the public malware list and release age checked, without Crowsnest running. |
--full | Requires Crowsnest to be running. This is already the default. |
--strict | Refuses to install when any check could not be completed. |
Things to know:
- If Crowsnest could not look something up, the result says "Not checked" and names it. A failed lookup is never shown as clean.
installasks every time whether Crowsnest is running. If nothing answers it stops, installs nothing, and tells you to runcrowsnest start. A Crowsnest that stops answering partway through also stops the install. Add--quickto install with only the malware list, what changed since the previous release, and the release's age checked. Start Crowsnest for the full check, which adds look-alike names, invented names and registry history.- Names and versions are checked for plain characters before anything reaches your shell, so a name such as
@scope/namewith a version such as^1.2.0is accepted without quoting. - Only
crowsnest installis checked. A plainnpm installis not.
Check a pull request
crowsnest check --base origin/mainThis compares the project's lockfiles with how they were at the base, then checks only the versions that are new or changed. It reads npm, pnpm, Yarn, Poetry, uv, Pipenv, pip (requirements.txt with exact versions), Composer, Bundler, Cargo and Go lockfiles. Leave --base out to check every version.
For a pull request that moves axios from 1.14.0 to 1.14.1:
Checked 1 package version(s) changed since main.
✖ axios@1.14.1 (was 1.14.0)
!! ACTIVE IOC: axios@1.14.1 is listed as malicious (MAL-2026-2307)
1 version(s) should not be merged.It exits with 3 when a version should not be merged, so it can fail a build. The folder must be a git repository. --min-release-age <days> changes the wait for a new release (0 turns it off), -f json prints the raw result, and --quick or --full choose the quick or the full check.
With Crowsnest running, check uses the full check. Without it, it falls back to a quick check that reads package-lock.json only, says which other lockfiles it skipped, and, without --base, checks only the malware list.
In GitHub
The same check runs as a GitHub Action, with no server to set up:
name: Dependency check
on: pull_request
jobs:
crowsnest:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: devampatel03/Crowsnest/.github/actions/dependency-check@mainThe job fails when the pull request adds a version Crowsnest would not let you install, and writes an error for each one in the run log.
| Input | Meaning |
|---|---|
path | The project folder. |
base | The git ref to compare with. Defaults to the pull request's base. |
min-release-age | Days to wait; 0 turns it off. |
crowsnest-ref | The Crowsnest version to run. |
Pin crowsnest-ref, and the action itself, to a release or a commit you trust instead of main.
To run the check yourself with no server, run python -m packages.core.checks <folder> --base origin/main from the Crowsnest folder. It exits with 1 when a version should not be merged and 2 if it could not run. Add --fail-on-degraded to also fail when a lookup could not be made, and --offline to skip online lookups.
How risk is worked out
crowsnest install adds points for each warning sign it finds, up to 1.00:
| Warning sign | Points |
|---|---|
| Registered less than 30 days ago | 0.40 |
| Fewer than 1,000 downloads a week | 0.30 |
| No link to a code repository | 0.20 |
| Name is one or two letters from a package with over 1,000,000 weekly downloads | 0.35 |
It also adds points for a package it has no data on (0.20), for names AI assistants are known to invent, for a release that looks hijacked, and for threat alerts from Socket when you set a key. A version on the malicious-package list, or younger than the minimum release age, always stops.
A total of 0.6 or above stops the install. The VS Code extension starts showing a warning at 0.5 by default.
Replay an earlier day
crowsnest replay --date 2026-05-11This runs a check against a saved snapshot of an earlier day. --ioc <name> picks a named campaign and -f json prints the raw result. It is a terminal feature only; the dashboard does not offer it. A date with no snapshot may return nothing.
Watch live events
crowsnest watchStreams live events until you stop it. For alerts in Slack, use the Slack bot.
Save settings
crowsnest config get
crowsnest config set apiUrl http://localhost:8000| Key | Purpose |
|---|---|
apiUrl | Where Crowsnest is running. |
githubToken, npmToken, socketApiKey, anthropicApiKey | Accepted and saved, but not yet passed to Crowsnest, so they change nothing. Give a key to the backend with crowsnest start --env-file <file> (Choose your AI model). |
A saved value beats the matching environment variable. config get shows secrets as ***set*** or (not set).
Limits
scanruns once. Run it again yourself or from a scheduler;watchstreams events and is a different command.- The 0.6 stop limit is fixed.
- A package Crowsnest cannot find in any registry adds 0.2 risk and still goes to npm, which then reports that it does not exist.
checkcompares lockfiles, so a dependency named only inpackage.json, or an unpinnedrequirements.txtline, is not checked.- A plain
npm installorpip installis not checked. For other ecosystems, usecheckon the pull request.
See also Configuration, Using the dashboard and the VS Code extension.
Nib's tip: use `crowsnest install`.
Related
- InstallationInstall Crowsnest with Docker or from source on macOS, Linux or Windows. Requirements, the command line tool, updating and uninstalling, step by step.
- ConfigurationCrowsnest runs with no settings. See which API keys are optional, what each one adds, where to put them and what happens when one is missing.
- Using the dashboardOpen the Crowsnest dashboard at localhost:3000 and read a call: what happened, how serious it is and what to do. Four pages, scanning and keyboard shortcuts.
- TroubleshootingFix common Crowsnest problems: a dashboard showing Offline or a 404, a port in use, the file-in-use error, Docker not starting and a scan that finds nothing.