Skip to main content

CLI & Environment Variables

Codeward can be configured via command-line interface (CLI) arguments, environment variables, and configuration files. This page serves as a complete reference for all runtime parameters.

CLI Options

The Codeward CLI supports the following arguments:

OptionArgumentDescription
-c, --configPATHPath to main config file (default: .codeward.json)
--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

Codeward uses environment variables for runtime configuration, sensitive data (like tokens), and CI/CD integration.

Core Configuration

VariableDescription
CODEWARD_CONFIG_PATHPath to main config file.
CODEWARD_PRIVATE_CONFIG_PATHPath to private config file.
CODEWARD_MODEExecution mode (diff or main).

Logging

VariableDescription
CODEWARD_LOG_LEVELGlobal log level (DEBUG, INFO, WARN, ERROR).
CODEWARD_LOG_FORMATLog output format (text or json).

GitHub Integration

Required for git:pr and git:issue outputs, and for fetching PR metadata in diff mode.

VariableDescription
CODEWARD_GITHUB_TOKENGitHub API token for API access.
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.

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 (loaded from .codeward.json)
  4. Default values