The dpndncy command line
The CLI uploads a project to your dpndncY server, waits for the scan, prints the result and exits with a code a pipeline can act on. It is one file with no dependencies, so it runs on a developer laptop or a build agent the same way.
#Getting it
Your server hosts the binaries, so a runner never has to reach the internet:
curl -fsSL https://api.dpndncy.example.com/releases/dpndncy-linux -o dpndncy && chmod +x dpndncy| File | For |
|---|---|
dpndncy-linux |
Linux x64 |
dpndncy-macos |
macOS |
dpndncy-win.exe |
Windows x64 |
GET /releases lists what the server has. These URLs are public on purpose: a runner needs the binary before it has a token. They are on the API address, not the console.
With Node 18 or later you can also run the source: node cli/bin/dpndncy.js.
#Connecting
The CLI needs two things: the API address (not the console address) and an API token.
Create the token in the console, Settings, API Tokens. Use a user with the analyst role or above (Tenants, users and access).
For a pipeline, pass them as environment variables:
export DPNDNCY_SERVER=https://api.dpndncy.example.com
export DPNDNCY_TOKEN=<token>On a workstation, save them once:
dpndncy login --server https://api.dpndncy.example.com --token <token>
dpndncy status # checks the connection and shows the server versionThis writes ~/.dpndncy/config.json. Order of precedence: command-line flags, then environment variables, then the saved file.
#Scanning
dpndncy scan [path] [options]| Option | Meaning |
|---|---|
--sca |
Dependency vulnerabilities and licences. The default |
--sast |
Static analysis of your own code |
--secrets |
Secrets and risky configuration |
--ai-risk |
Which files show evidence of AI authorship |
--attack-paths |
SCA and SAST with attack path computation |
--all |
Every engine |
--zip <file> |
Scan an archive (zip, jar, war, tar) |
--repo <url> |
Scan a Git repository the server can reach |
--image <ref> |
Scan a container image from a registry, or a tarball |
--project <name> |
The project the scan is filed under. See below |
--ci |
Minimal output; the exit code is the verdict |
--fail-on-any |
With --ci, fail on any vulnerability, ignoring the scan policy |
--json |
Print the result as JSON instead of the terminal view |
--output <file> |
Also write the JSON result to a file |
--branch <name> |
Branch, with --repo |
--server, --token |
Override the saved or environment values |
--no-color |
Plain output. Also automatic when output is not a terminal |
Source is uploaded as an archive. Files that commonly hold credentials (.env, *.pem, *.key, .npmrc and similar) are left out, and .gitignore and .dpndncyignore rules are honoured.
#Which project a scan belongs to
Every scan is filed under a project. By default the name is taken from, in order:
--project, or theDPNDNCY_PROJECTenvironment variable;- the repository name in
.git/config(origin); - the
nameinpackage.json; - the folder name.
Set it explicitly in pipelines when the checkout folder is not meaningful (many CI systems check out into a folder called src or workspace). Scans of the same name join the same project, so its history and trend build up. A project that did not exist is created automatically, without scheduled rescans.
#Exit codes
| Code | Name | Meaning |
|---|---|---|
| 0 | OK | Completed; the scan passed |
| 1 | POLICY_FAIL | Completed, and the gate failed (see below) |
| 2 | SCAN_ERROR | The scan failed before it produced a trustworthy result |
| 3 | CONFIG_ERROR | Missing or invalid configuration, for example no token |
| 4 | AUTH_ERROR | Token invalid, expired or not allowed to scan |
| 5 | SERVER_UNREACHABLE | Connection refused or the name did not resolve |
| 6 | TIMEOUT | The operation timed out |
| 7 | USAGE_ERROR | Invalid command or options |
| 8 | PARTIAL_FAILURE | An engine you asked for failed or was skipped |
dpndncy exit-codes prints the same table.
#What "the gate failed" means
With --ci:
- Dependency scans fail when the result breaks the tenant's scan policy (Settings, Scan policy; see Scan policies). A policy that tolerates a few medium findings lets the build pass with them.
--fail-on-anyignores the policy and fails on any vulnerability. - Static analysis and secrets fail on any finding.
Without --ci, the same policy verdict decides the exit code and the full result is shown.
The output line starts with PASS or FAIL:
FAIL sca=5 (scan policy) sast=0 secrets=0
PASS 5 findings within the scan policy#Other commands
| Command | Purpose |
|---|---|
dpndncy status |
Check the connection, queue and server version |
dpndncy login |
Save the server and token |
dpndncy firewall check <path> [--fail-on review] |
Check dependency changes against the dependency admission policy (Dependency Admission / Firewall Events) |
dpndncy help, dpndncy <command> --help |
Help |
dpndncy --version |
Version |
#Troubleshooting
| Message or code | Cause |
|---|---|
| Exit 4, "Authentication failed" | Wrong or expired token, or the token's user is not an analyst |
| Exit 5, "Cannot reach server" | Wrong address, firewall, or an untrusted certificate (add your CA to the runner) |
| 404 and a hint about port 3000 | You used the console address. Use the API address |
Everything lands in one project called source or workspace |
Pass --project |
| Upload refused as too large | The archive exceeds MAX_ZIP_UPLOAD_MB on the server, or a proxy body limit. Add paths to .dpndncyignore |