Skip to main content

Configuration Model

kdx has two configuration layers: Profiles are still the normal way to use the CLI interactively. Sync environments are the preferred way to run repeatable GitOps deployments because the environment, target, and credential variable are declared with the metadata repository.

Browser Login

Use browser login when your environment supports CLI token exchange:
Flags: Device-code login is useful for SSH sessions and CI-like terminals where a browser cannot open locally:

API Key Profiles

Create or update a profile:
Create a production profile with confirmation prompts enabled:
Manage profiles:
list-profiles also accepts the alias get-profiles.

Command-Line Overrides

For a single command, override the current profile:
For automation where you do not want to write a profile file, pass both URL and API key:
The general interactive CLI does not implicitly read a global KODEXA_API_KEY. Use profiles or explicit --url and --api-key overrides. kdx sync can read environment variables through sync-config.yaml.

Sync Environment Credentials

kdx sync resolves environments from sync-config.yaml:
Then run:
Environment entries can also reference a profile:
Use api_key_env for CI/CD and profile for local development when you already have a saved profile.

Production Safeguards

Profiles marked with --production trigger confirmation before mutating commands such as apply and delete.
For non-interactive automation where the workflow itself provides approval, use:
Use this only in controlled automation. The bypass is logged.

File Locations

Security Practices

  • Do not commit ~/.kodexa/config.yaml.
  • Prefer environment-backed sync credentials in CI/CD.
  • Use environment-specific API keys.
  • Mark production profiles with --production.
  • Rotate API keys regularly.
  • Use kdx secret set for organization secrets so secret values do not appear in command history.

Troubleshooting

No Active Profile

Create or select a profile:

Profile Not Found

List profiles and rerun the command with an existing name:

Resource Cache Is Stale

Refresh discovery:

Sync Cannot Resolve An Environment

Check that the environment is declared in sync-config.yaml and that its API key environment variable is set: