Configure the ktm CLI

Configure ktm using environment variables and global flags like API keys, output format, and host overrides, with no config file needed.

ktm is configured through environment variables and global flags. There is no config file to manage.

Authentication

Provide your API key in one of two ways:

  • Set the KAPPTIVATE_API_KEY environment variable (recommended).
  • Pass --api-key-file <path> to read the key from a file.

Every command needs a key except local validation (--validate). Keys are created and managed by workspace administrators under Administration > API keys.

Environment variables

VariablePurpose
KAPPTIVATE_API_KEYYour API key. Carries the same access as your account.
KAPPTIVATE_HOSTAPI host. Defaults to app.kapptivate.com.

Global flags

These apply to every command:

FlagDescription
-o, --outputOutput format: json (default), table, or plain.
-d, --debugPrint HTTP requests, timing, and verbose errors on stderr.
--hostOverride the API host (also KAPPTIVATE_HOST).
--api-key-fileRead the API key from a file instead of the environment.
-q, --quietSuppress info-level log lines; show errors only.
--no-colorDisable colored output.
--no-proxyIgnore HTTP proxy settings from the environment.
--skip-tlsSkip TLS certificate verification (insecure).

Exit codes

ktm uses stable exit codes so pipelines can branch on the outcome:

CodeMeaning
0Success
1General error
2Authentication error
3Timeout (poll timeout exceeded)
4Invalid configuration
5Tests ran but some failed

What's next?

Command reference

Every command, flag, and argument.

CI/CD

Use these settings in your pipeline.

Last updated on