ctroenv check
CI-friendly validation command. Designed for continuous integration pipelines.
Usage
ctroenv check [options]Options
Same as validate.
CI Integration
# .github/workflows/env-check.yml
name: Environment Check
on: [pull_request]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: npm ci
- run: npx ctroenv checkExit Codes
| Code | Meaning |
|---|---|
0 | All variables valid |
1 | Validation errors found |
2 | Configuration error |
Combine with .env.example in CI:
# Validate against the example file (all required vars present)
ctroenv check --source .env.example
# Strict mode: validate values against schema validators
ctroenv check --source .env --strictStrict Mode
Without --strict, check only compares key sets — it reports missing and
unused keys but does not validate values.
With --strict, each value is validated against its schema validator (same as
ctroenv validate). This catches type mismatches, invalid URLs, out-of-range
numbers, and other value-level errors.
# Key comparison only (fast)
ctroenv check --source .env
# Key comparison + value validation
ctroenv check --source .env --strict