Skip to content
Configuration

Configuration

kx reads ~/.kx/config.toml. Every key has an environment variable that overrides it, so a shell can differ from the file without editing anything.

theme = "dracula"
engine = "trivy"
max_history = 25
shells = ["zsh", "bash", "sh"]
debug_image = "alpine"

kx --version prints the path it resolved, which is the quickest way to find out whether the file you are editing is the file it reads.

Keys

KeyEnvironmentDefaultWhat it does
themeKX_THEMEgithub-darkColour palette for all output; see themes.
engineKX_ENGINEscoutDefault scanner for kx scanscout, trivy or grype.
max_historyKX_MAX_HISTORY10How many kx get results the history stack keeps.
shellsKX_SHELLSbash, shShell candidates kx exec tries, in order.
debug_imageKX_DEBUG_IMAGEbusyboxImage kx debug attaches to a pod; --image overrides it per run.
theme_disableKX_THEME_DISABLEfalseTurn off styling entirely — the same as --no-color.

shells is a list in the file and a comma-separated string in the environment: KX_SHELLS=zsh,bash,sh.

Two commands write to the file rather than making you edit it:

kx theme dracula     # persists theme
kx engine trivy      # persists engine

When output is styled

Styled output is emitted only when stdout is a terminal. Piped or redirected output is plain text, so this stays clean:

kx get pods | grep worker
kx get pods > pods.txt

The NO_COLOR convention is honoured too. It is a terminal-wide convention rather than a kx setting, which is why it isn’t in the table above — theme_disable and --no-color are the kx ways to say the same thing.

The files kx owns

PathEnvironmentContents
~/.kx/config.tomlKX_CONFIGThe settings above.
~/.kx/state.jsonKX_STATESaved listings and the cursor; see state.

KX_CONFIG and KX_STATE point kx at a different file entirely, for a terminal or CI job that wants its own config or history rather than sharing the one in ~/.kx — unlike the settings table above, neither can be set from inside the file it names.

Both paths are printed by kx --version and on the root kx --help screen. Neither is required to exist — kx runs on defaults without them.