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
--intel-modeMODEIntel data source: api, download, local, disabled. Default: api with a token, download without
--intel-requiredBOOLFail the scan if no vulnerability data was obtained (default true)
--intel-classificationBOOLUse Intel's resolved license category/severity instead of the scanner's built-in table (default false) — see License categories
--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_CONFIG_PATHPath to main config file
CODEWARD_PRIVATE_CONFIG_PATHPath to private config file
CODEWARD_MODEExecution mode (diff or main)
CODEWARD_CACHE_DIRBase cache directory (Intel snapshots, licence cache, query cache)
CODEWARD_MAIN_PATHBase checkout to scan. Overrides the container default /main — needed when running the binary directly
CODEWARD_BRANCH_PATHHead checkout to scan in diff mode. Overrides the container default /branch

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

Codeward Intel​

Intel is the scanner's vulnerability data source. See Intel for the full picture.

VariableDescription
CODEWARD_INTEL_MODEapi, download, local or disabled. Unset selects api when a token is present, download otherwise
CODEWARD_INTEL_TOKENIntel API key with the query:batch scope (sensitive — env only). Required for api mode
CODEWARD_INTEL_APIIntel API base URL (default: https://intel.codeward.io)
CODEWARD_INTEL_CACHEOverride the snapshot cache directory (default: <CODEWARD_CACHE_DIR>/intel-snapshots)
CODEWARD_INTEL_REQUIREDFail the scan when no vulnerability data was obtained (default true)
CODEWARD_INTEL_CLASSIFICATIONMake Intel's resolved license category/severity authoritative over the scanner's built-in table (default false). Gaps are filled from Intel either way; this gates only overruling a local verdict — see License categories
CODEWARD_INTEL_MIRRORSComma-separated snapshot mirror base URLs, replacing the built-in list
CODEWARD_INTEL_PUBKEYOverride the built-in Ed25519 key used to verify snapshot manifests. none disables verification
CODEWARD_INTEL_SEGMENTSExtra snapshot segments to download, by group: cwes, enrichments, rules, or all. Unset downloads only what the detected ecosystems need
CODEWARD_INTEL_MAX_AGE_DAYSDays before a snapshot is treated as stale and the scan marked degraded (default 7; 0 disables the warning)

Scanner​

VariableDescription
CODEWARD_TEMPLATES_PATHPath to a directory of custom output templates. Unset uses the templates embedded in the binary

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.
Container only

CODEWARD_WEBHOOK_SECRETS and CODEWARD_EXTRA_ENV are parsed by the image's entrypoint script, not by the scanner itself. Running the binary directly (including the action's binary runtime), export the variables yourself.

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.