Usage
Installation
You can install the CybeDefend CLI using one of the following methods:1. Pre-built Binaries
Supported Platforms:- macOS:
cybedefend-darwin-amd64(Intel) orcybedefend-darwin-arm64(Apple Silicon M1/M2) - Linux:
cybedefend-linux-amd64(64-bit) orcybedefend-linux-386(32-bit) - Windows:
cybedefend-windows-amd64.exe(64-bit) orcybedefend-windows-386.exe(32-bit)
- Download the latest release for your platform from the GitHub Releases page
- Make Executable (Linux/macOS):
- Move to PATH:
- Verify Installation:
2. Build from Source
3. Docker Image
A pre-built Docker image is available on GitHub Container Registry:Authentication
The CLI supports two authentication modes. Both store credentials in~/.cybedefend/credentials.json and are picked up automatically by subsequent commands.
OAuth Browser Flow (recommended for local use)
PAT-Based Login (recommended for CI/CD)
Environment Variable (no login step)
For CI/CD environments, skipcybedefend login entirely and set the PAT as an environment variable:
Credential Priority Order
--patflag (highest priority)CYBEDEFEND_PATenvironment variablepatfield in config file- Stored credentials from
cybedefend login
Logout
~/.cybedefend/credentials.json and clears the stored session.
Configuration
Config File (config.yaml in ./, $HOME/.cybedefend, or /etc/cybedefend):
CYBEDEFEND_API_URL- API base URLCYBEDEFEND_REGION- Platform region (usoreu). Ignored ifCYBEDEFEND_API_URLis setCYBEDEFEND_PAT- Personal Access Token (PAT) for authenticationCYBEDEFEND_PROJECT_ID- Default project ID
--region- Platform region (usoreu). Selectshttps://api-us.cybedefend.comorhttps://api-eu.cybedefend.com--api-url- API base URL (manual override; takes precedence over--region)--project-id- Project ID
Deprecated: The--api-keyflag andCYBEDEFEND_API_KEYenvironment variable have been removed. UseCYBEDEFEND_PATwith a Personal Access Token instead.
Commands
1. scan
--dir, -d- Directory to scan (will be zipped before uploading). Cannot be used with--file--file, -f- Pre-zipped file to scan. Cannot be used with--dir--project-id- Project ID for the scan (required if not set in config/env)--region- Platform region:us(default) oreu--api-url- Manual API URL override (takes precedence over--region)--wait, -w- Wait for scan completion before exiting (default:true)--interval- Polling interval in seconds when waiting (default:5)--break-on-fail- Exit with error code if scan fails (default:false)--break-on-severity- Exit with error code if vulnerabilities of specified severity or higher are found. Values:critical,high,medium,low--ci- CI/CD-friendly output (no colors, ASCII art, or extra formatting)
Examples
2. results
--type all) in JSON, across all pages, and saves to results.json in the current directory.
Flags:
With
--type all the JSON output keeps one array per scan type (sast, sca, iac, secret, cicd, container); the html, sarif and markdown reports flatten them into a single list. --grouped needs a single scan type — it has no effect while --type is all.
Choosing which triage states to export
--status decides which triage states end up in the file. The default, to_verify,confirmed, is the set of findings that still need attention: what you have already resolved or ignored stays out.
Any other value is rejected before a request is sent.
not_exploitable is a state you will see in the platform, but the API does not accept it as a filter value, so you cannot ask for it here.
Every finding in a JSON export carries its own state in currentState, so a file is self-describing and you can re-filter it afterwards without another call:
currentState is present in the JSON output only — the html, sarif and markdown reports do not show the triage state. --status is also not applied to --grouped --type container, which returns grouped images through a separate endpoint.--status is a recent addition. If your CLI answers unknown flag: --status, upgrade the binary from the releases page.Examples
3. version
Displays the CLI version:
4. completion
Generates shell autocompletion for bash, zsh, etc.:
CI/CD Integration
Combine thescan and results commands in your pipelines. The scan command’s --wait, --break-on-fail, and --break-on-severity flags are particularly useful for controlling pipeline flow based on scan outcomes.
For example, in GitHub Actions:
--ci for minimal logs during the scan. The --break-on-* flags allow automatic build failure based on your security policies. You can still use cybedefend results to fetch detailed reports if the scan passes the break conditions or if you need the data regardless.
Related: Code Repository Scanning · CI/CD Integrations · GitHub CLI Repository