Local Code Scanning
CLI Options for Local Scanner
Quickly install and use the CybeDefend CLI to scan your code locally, fetch results, and integrate secure checks into CI/CD.
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
1. Pre-built Binaries
- Download the release for your platform (e.g.,
cybedefend-darwin-amd64
,cybedefend-linux-amd64
, orcybedefend-windows-amd64.exe
). - Make Executable (Linux/macOS):
- Move to PATH:
- Check:
2. Build from Source
Configuration
- Config File (
config.yaml
in./
,$HOME/.cybedefend
, or/etc/cybedefend
): - Environment Variables:
CYBEDEFEND_API_URL
CYBEDEFEND_API_KEY
CYBEDEFEND_PROJECT_ID
- Flags override these settings:
--api-url
,--api-key
,--project-id
Commands
1. scan
--dir, -d
: Directory to zip & scan.--file, -f
: Pre-zipped file to scan.--project-id
: Associate scan with a project.--ci
: CI-friendly output (no color/ASCII).
Examples
2. results
--project-id
: Project ID to fetch results.--type, -t
:sast
(default) oriac
.--all, -a
: Fetch all pages.--output, -o
:json
,html
, orsarif
.--filename, -f
: Output file name (results.json
default).--filepath
: Path to save file (.
default).--ci
: CI-friendly mode.
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. For example, GitHub Actions:
Use --ci
for minimal logs. Fetch detailed results later with cybedefend results
.
Next Steps
- License: Apache 2.0
- Support: GitHub Issues or contact us at support@cybedefend.com
- Advanced Topics: Explore environment variables, config files, and flags to customize your local scanning workflow.