Skip to main content
The CybeDefend CLI provides an efficient way to run local code scans and view results on our platform. It supports Linux, macOS, and Windows and is easily integrated into CI/CD pipelines or used in offline environments.

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) or cybedefend-darwin-arm64 (Apple Silicon M1/M2)
  • Linux: cybedefend-linux-amd64 (64-bit) or cybedefend-linux-386 (32-bit)
  • Windows: cybedefend-windows-amd64.exe (64-bit) or cybedefend-windows-386.exe (32-bit)
Installation Steps:
  1. Download the latest release for your platform from the GitHub Releases page
  2. Make Executable (Linux/macOS):
  3. Move to PATH:
  4. 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.
Opens the CybeDefend login page in your default browser. After completing authentication, the CLI stores your session automatically. Access tokens are refreshed transparently when they expire.
Validates your Personal Access Token and saves it locally. All subsequent commands use it automatically.

Environment Variable (no login step)

For CI/CD environments, skip cybedefend login entirely and set the PAT as an environment variable:

Credential Priority Order

  1. --pat flag (highest priority)
  2. CYBEDEFEND_PAT environment variable
  3. pat field in config file
  4. Stored credentials from cybedefend login

Logout

Deletes ~/.cybedefend/credentials.json and clears the stored session.
Deprecated: The --api-key flag has been removed. API Keys are no longer supported.

Configuration

Config File (config.yaml in ./, $HOME/.cybedefend, or /etc/cybedefend):
Environment Variables:
  • CYBEDEFEND_API_URL - API base URL
  • CYBEDEFEND_REGION - Platform region (us or eu). Ignored if CYBEDEFEND_API_URL is set
  • CYBEDEFEND_PAT - Personal Access Token (PAT) for authentication
  • CYBEDEFEND_PROJECT_ID - Default project ID
Command-Line Flags (override config and env vars):
  • --region - Platform region (us or eu). Selects https://api-us.cybedefend.com or https://api-eu.cybedefend.com
  • --api-url - API base URL (manual override; takes precedence over --region)
  • --project-id - Project ID
Deprecated: The --api-key flag and CYBEDEFEND_API_KEY environment variable have been removed. Use CYBEDEFEND_PAT with a Personal Access Token instead.

Commands

1. scan

Starts a new scan by uploading a directory or a pre-zipped file to the CybeDefend platform. By default, the command waits for the scan to complete and displays a summary of findings. Flags:
  • --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) or eu
  • --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

Retrieves scan results for a project and writes them to a file. By default it fetches every scan type (--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.
Your exports get smaller, and that is the fix. Earlier CLI versions sent this filter in a spelling the API silently discarded, so every export contained every state — resolved and ignored findings included. The filter now reaches the API. If a pipeline of yours counts rows in results.json or feeds them into a ticketing system, expect fewer rows and adjust the threshold.
Findings in the not_exploitable state were part of the old over-delivered export and cannot be requested back, so even the four-state filter above returns slightly fewer rows than the old default.
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 the scan 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:
Use --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