Skip to main content
Version: Latest

CLI & Environment Variables

Codeward can be configured via CLI arguments, environment variables, and configuration files.

CLI Options

OptionArgumentDescription
-c, --configPATHPath to main config file (default: .codeward.json / .codeward.yaml)
--private-configPATHPath to private config file
-m, --modeMODEScan mode: main or diff
--log-levelLEVELLog verbosity: DEBUG, INFO, WARN, ERROR
--log-formatFORMATLog format: text or json
--export-diffPATHExport full diff results to the specified file as JSON
-v, --version-Show version information
-h, --help-Show help message

Environment Variables

Core Configuration

VariableDescription
CODEWARD_ENVEnvironment mode (local, ci)
CODEWARD_CONFIG_PATHPath to main config file
CODEWARD_PRIVATE_CONFIG_PATHPath to private config file
CODEWARD_MODEExecution mode (diff or main)
CODEWARD_CACHE_DIRCache directory for trivy-db and license cache

Logging

VariableDescription
CODEWARD_LOG_LEVELGlobal log level (DEBUG, INFO, WARN, ERROR)
CODEWARD_LOG_FORMATLog output format (text or json)
CODEWARD_LOG_TIMESTAMPInclude timestamps (true or false)
CODEWARD_LOG_SUMMARYSummary verbosity (none, minimal, standard, detailed)
CODEWARD_LOG_OUTPUTLog output destination (default: stderr)

GitHub Integration

Required for git:pr and git:issue outputs.

VariableDescription
CODEWARD_GITHUB_TOKENGitHub API token (sensitive — env only)
CODEWARD_GITHUB_REPOSITORYRepository name (e.g., my-project)
CODEWARD_GITHUB_OWNERRepository owner (user or organization)
CODEWARD_GITHUB_PR_NUMBERPull request number (integer)
CODEWARD_GITHUB_BRANCHCurrent branch name

Scanner

VariableDescription
TRIVY_SKIP_DB_UPDATESet true to skip vulnerability DB download (air-gapped/offline mode)
CODEWARD_TEMPLATES_PATHPath to custom output templates directory

SARIF Output

VariableDescription
CODEWARD_SARIF_OUTPUTWrite all findings as SARIF 2.1.0 to the specified file path
CODEWARD_SARIF_UPLOADSet true to upload SARIF to GitHub Code Scanning (requires CODEWARD_GITHUB_TOKEN)

SBOM Export

VariableDescription
CODEWARD_SBOM_OUTPUTExport CycloneDX 1.6 SBOM to the specified file path

API & Tokens

VariableDescription
CODEWARD_APICodeward API endpoint (default: https://api.codeward.io)
CODEWARD_TOKENCodeward API token (sensitive — env only)
CODEWARD_AI_TOKENAI enrichment token (sensitive — env only)

Webhook Secrets

VariableDescription
CODEWARD_WEBHOOK_SECRETSMulti-line KEY=VALUE pairs exported before scan. Unset after parsing.
CODEWARD_EXTRA_ENVAdditional KEY=VALUE pairs exported before scan.

Precedence

Configuration is resolved in this order (highest to lowest priority):

  1. CLI arguments (e.g., --mode diff)
  2. Environment variables (e.g., CODEWARD_MODE=diff)
  3. Config files (.codeward.yaml / .codeward.json)
  4. Default values
Sensitive Variables

Tokens (CODEWARD_GITHUB_TOKEN, CODEWARD_TOKEN, CODEWARD_AI_TOKEN) are never loaded from config files — environment only.