Skip to main content
Version: 0.2.0

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_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).

Logging

VariableDescription
CODEWARD_LOG_LEVELGlobal log level (DEBUG, INFO, WARN, ERROR).
CODEWARD_LOG_FORMATLog output format (text or json).
CODEWARD_LOG_TIMESTAMPInclude timestamps in logs (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, and for fetching PR metadata in diff mode.

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

API & Tokens

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

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