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:
| Option | Argument | Description |
|---|---|---|
-c, --config | PATH | Path to main config file (default: .codeward.json) |
--private-config | PATH | Path to private config file |
-m, --mode | MODE | Scan mode: main or diff |
--log-level | LEVEL | Log verbosity: DEBUG, INFO, WARN, ERROR |
--log-format | FORMAT | Log format: text or json |
--export-diff | PATH | Export 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
| Variable | Description |
|---|---|
CODEWARD_CONFIG_PATH | Path to main config file. |
CODEWARD_PRIVATE_CONFIG_PATH | Path to private config file. |
CODEWARD_MODE | Execution mode (diff or main). |
Logging
| Variable | Description |
|---|---|
CODEWARD_LOG_LEVEL | Global log level (DEBUG, INFO, WARN, ERROR). |
CODEWARD_LOG_FORMAT | Log output format (text or json). |
GitHub Integration
Required for git:pr and git:issue outputs, and for fetching PR metadata in diff mode.
| Variable | Description |
|---|---|
CODEWARD_GITHUB_TOKEN | GitHub API token for API access. |
CODEWARD_GITHUB_REPOSITORY | Repository name (e.g., my-project). |
CODEWARD_GITHUB_OWNER | Repository owner (user or organization). |
CODEWARD_GITHUB_PR_NUMBER | Pull request number (integer). |
CODEWARD_GITHUB_BRANCH | Current branch name. |
Precedence
Configuration is resolved in this order (highest to lowest priority):
- CLI arguments (e.g.
--mode diff) - Environment variables (e.g.
CODEWARD_MODE=diff) - Config files (loaded from
.codeward.json) - Default values