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
results.json in the current directory.
Flags:
--project-id- Project ID to fetch results (required if not set in config/env)--type, -t- Type of results:sast(default) oriac--page, -p- Page number to fetch (default:1). Ignored if--allis set--all, -a- Fetch all results across all pages--output, -o- Output format:json(default),html, orsarif--filename, -f- Output file name (default:results.json)--filepath- Path to save file (default:.)--ci- CI/CD-friendly output
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