Overview
ZeroPath CLI provides command-line access to ZeroPath’s AI-powered security scanning platform. Upload and scan your code directly from your terminal with support for multiple output formats and CI/CD integration.Get the CLI
Download the latest release from our GitHub repository
What ZeroPath CLI Detects
The CLI scans for a comprehensive range of security vulnerabilities:- Authentication and authorization vulnerabilities
- Application logic flaws
- Dependency issues
- Security misconfigurations
- Command injection vulnerabilities
- File inclusion and path traversal attacks
- Secrets and hardcoded credentials
Quick Start
--vcs accepts github, gitlab, bitbucket, gerrit, generic, and cvs.
Core Commands
Authentication
Local Directory Scanning
Context, Rules, and Tags
Manage the configuration used by subsequent scans:Repository Scanning
On-Demand Code Scans Beta
Usescan-code to submit a diff, file, file set, or snippet for asynchronous
security review without starting a full repository scan.
scan-code uses your Git remote URL to automatically use linked
repository context when exactly one accessible ZeroPath repository matches. If
there is no match, it runs as a standalone scan.
See On-Demand Code Scans Beta for request
formats, target modes, limits, and API examples.
Container Scanning
Use thecontainer commands to scan built container images for OS-package and
bundled-dependency vulnerabilities. Images can be pulled by registry reference —
including from private registries with credentials — or uploaded as a local
docker save archive. Findings appear on the Containers page,
listed under Assets in the sidebar, with per-layer attribution and base-image upgrade
recommendations.
--registry-connection-id is mutually exclusive with
--registry-username/--registry-token, and the image’s host must match the connection’s
registry host. Both container test and container monitor accept it.
docker save and scan that archive directly with --file. Give it a label with
--name so it is identifiable in results.
Uploaded archives are scanned once and cannot be monitored: there is no registry
reference to re-pull on a schedule, so
container monitor rejects --file. Use a
registry image reference for recurring re-scans.container test waits for the scan to finish and prints a
human-readable report. The following flags control that behavior:
--json— print the raw response payload as JSON instead of the formatted report.--wait/--no-wait— wait for the scan to complete (the default). Pass--no-waitto submit the scan and return immediately with the container image ID.--timeout <seconds>— maximum seconds to wait for completion. Must be a positive number. If the scan is still running when the timeout is reached, the CLI prints the image’s dashboard link and exits with code 0; the scan keeps running and its results appear there.
container monitor also accepts --json to print the raw
response payload.
Repository Linking
Container images can be linked to an onboarded repository so findings appear alongside that repository’s code-scan results. By default, container commands auto-detect the repository from the current checkout’s git remote. You can control this with:--repository-id <id>— explicitly link the image to a specific repository, overriding auto-detection.--no-auto-repository— disable auto-detection entirely; the image will not be linked to any repository unless--repository-idis also provided.
container test, container monitor, and
container link.
Linking an Existing Image
Usecontainer link to link (or re-link) a previously scanned container image
to a repository. This is useful when the image was scanned without a repository
context, or when you need to move it to a different repository.
CI/CD Integration
The CLI is designed for seamless CI/CD integration.zeropath scan, scan-code and
container test exit with code 1 only when you must act:
- Exit 1 — security issues were found, or the scan stopped for a reason you can fix (for example, the configured branch no longer exists). The CLI prints what to do.
- Exit 0 — no issues were found, the scan is still running, or the scan did not finish.
zeropath scan --repository-id or --repository-url does not
finish, the CLI starts it again once automatically. If that scan does not finish either, the CLI prints
This scan didn't finish. Run it again. and exits with code 0.
A local scan (zeropath scan <directory> <outputFile.sarif>) is not started again automatically,
because that would need a new upload: if it does not finish, the CLI prints the same line and exits
with code 0. If it stops for a reason you can fix, the CLI prints what to do and exits with code 1.
In both cases it writes no SARIF file, so an unfinished scan is never reported as one with no
findings.
Scan Timeout
zeropath scan waits for up to approximately 50 minutes. If the scan is still running after that,
the CLI prints The scan is still running. Results will appear on the dashboard: <url> and exits
with code 0, so CI/CD pipelines do not hang on long-running scans. scan-code and
container test do the same when their --timeout is reached; scan-code prints the job ID to
check instead of a dashboard link.
Severity Levels
ZeroPath assigns each finding a severity label based on its score. The full set of labels, from highest to lowest, is:
Unassessed findings appear in console output and are included in the severity summary. In SARIF output, unassessed findings receive a SARIF level of
warning, their rule ID is suffixed with -UNASSESSED, and the security-severity property is omitted so downstream tools that require a numeric severity do not receive a placeholder value.
Output Formats
ZeroPath CLI supports multiple output formats for different use cases:- SARIF: Standard format for static analysis results (local scans)
- Console: Human-readable formatted output for terminal viewing
Getting API Credentials
To use the CLI, you’ll need API credentials from your ZeroPath account:- Sign in to ZeroPath Dashboard
- Navigate to Settings → API keys (zeropath.com/app/settings/api)
- Click Create API Key, enter a Token Name, and click Create Token
- Pass the Token ID and Token Secret to
zeropath authas<clientId>and<clientSecret>
Next Steps
- Installation Guide - Set up the CLI on your system
- GitHub Releases - Download CLI binaries
- API Reference - Build custom integrations