Idempotency
apply reconciles your config against live API state; there is no state file. It creates what is missing, updates what drifted, and leaves what already matches. Re-applying an unchanged config plans no changes, so a pipeline can run apply on every push without creating duplicates.
plan first as a review gate, then apply only when the diff is what you expect.
Exit-code contract
| Code | Meaning |
|---|---|
0 | Success. plan returns 0 for any valid plan, including one with pending changes. |
1 | The command failed: a validation error, a failed plan/apply/destroy operation, or a failed test. |
2 | Usage error: an unknown flag, a missing required argument, or an invalid --output value. |
101 | An internal wxctl error (a panic / source bug). Re-run with --full-trace and inspect the run record. |
130 | Interrupted (SIGINT / Ctrl-C). |
apply, destroy, and test exit 1 if any resource or test fails, so a CI job fails automatically without extra scripting. Pair this with WXCTL_LOG_PATH for a machine-readable JSON log of the run (see Troubleshooting).
Secrets
Keep credentials out of YAML. Per-environment values come from the environment with${env:VAR}:
~/.wxctl/profiles.yaml). In CI, write the profile from a single secret and reference it, or point at a generated file with --profile-path. A missing or empty ${env:VAR} is caught during validation, before any service call.
GitHub Actions
This workflow buildswxctl from source, writes a profile from a repository secret, then plans and applies the config in your repo:
Store the profile YAML and every
${env:VAR} value as repository or environment secrets. Map each ${env:VAR} your config references to a job env: entry sourced from secrets.*.Next steps
Profiles & credentials
How wxctl stores endpoints and authenticates to each service.
Troubleshooting
Logging, concurrency, and timeout environment variables.

