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:
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:list-profiles also accepts the alias get-profiles.
Command-Line Overrides
For a single command, override the current profile: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:
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.
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 setfor 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 insync-config.yaml and that its API key environment variable is set:
