Skip to content

Environment variables

KUBECOLOR_OBJ_FRESH

When setting the variable KUBECOLOR_OBJ_FRESH to a duration, you can change the color of the object depending on its creation time.

Please see Specify object fresh age threshold

KUBECOLOR_FORCE_COLORS

In addition to forcing colors with --force-colors, you can also do so by setting the environment variable KUBECOLOR_FORCE_COLORS=auto. See Dynamic color support section for all possible values.

You can use this environment variable to colorize output when you invoke kubecolor in the watch command (e.g. watch kubecolor get pods). Set the following alias:

Terminal window
# Add this line to your ~/.bashrc, ~/.zshrc, or similar:
alias watch='KUBECOLOR_FORCE_COLORS=auto watch --color '
# Usage:
watch kubecolor get pods

Be sure to include the space at the end to enable alias expansion (without this additional space, the command watch kgp would fail, for example).

KUBECOLOR_LIGHT_BACKGROUND

In addition to use the light color preset with --light-background, you can also do so by setting the environment variable KUBECOLOR_LIGHT_BACKGROUND=true.

Theme variables

Environment variableTypeDescriptionDark theme
KUBECOLOR_THEME_BASE_INFOcolorgeneral color for when things are informationalwhite
KUBECOLOR_THEME_BASE_PRIMARYcolorgeneral color for when things are focusmagenta
KUBECOLOR_THEME_BASE_SECONDARYcolorgeneral color for when things are secondary focuscyan
KUBECOLOR_THEME_BASE_SUCCESScolorgeneral color for when things are goodgreen
KUBECOLOR_THEME_BASE_WARNINGcolorgeneral color for when things are wrongyellow
KUBECOLOR_THEME_BASE_DANGERcolorgeneral color for when things are badred
KUBECOLOR_THEME_BASE_MUTEDcolorgeneral color for when things are less relevantgray:italic
KUBECOLOR_THEME_BASE_KEYcolor[]general color for keys
(fallback to [KUBECOLOR_THEME_BASE_SECONDARY])
hicyan / cyan
KUBECOLOR_THEME_DEFAULTcolordefault when no specific mapping is found for the commandgreen
KUBECOLOR_THEME_SHELL_COMMENTcolorused on comments, e.g # this is a comment
(fallback to KUBECOLOR_THEME_BASE_MUTED)
gray:italic
KUBECOLOR_THEME_SHELL_COMMANDcolorused on commands, e.g kubectl or echo
(fallback to KUBECOLOR_THEME_BASE_SUCCESS)
green
KUBECOLOR_THEME_SHELL_ARGcolorused on arguments, e.g get pods in kubectl get pods
(fallback to KUBECOLOR_THEME_BASE_INFO)
white
KUBECOLOR_THEME_SHELL_FLAGcolorused on flags, e.g --watch in kubectl get pods --watch
(fallback to KUBECOLOR_THEME_BASE_SECONDARY)
cyan
KUBECOLOR_THEME_DATA_KEYcolor[]used for the key
(fallback to KUBECOLOR_THEME_BASE_KEY)
hicyan / cyan
KUBECOLOR_THEME_DATA_STRINGcolorused when value is a string
(fallback to KUBECOLOR_THEME_BASE_INFO)
hiyellow
KUBECOLOR_THEME_DATA_TRUEcolorused when value is true
(fallback to KUBECOLOR_THEME_BASE_SUCCESS)
green
KUBECOLOR_THEME_DATA_FALSEcolorused when value is false
(fallback to KUBECOLOR_THEME_BASE_DANGER)
red
KUBECOLOR_THEME_DATA_NUMBERcolorused when the value is a number
(fallback to KUBECOLOR_THEME_BASE_PRIMARY)
magenta
KUBECOLOR_THEME_DATA_NULLcolorused when the value is null, nil, or none
(fallback to KUBECOLOR_THEME_BASE_MUTED)
gray:italic
KUBECOLOR_THEME_DATA_QUANTITYcolorused when the value is a quantity, e.g “100m” or “5Gi”
(fallback to KUBECOLOR_THEME_DATA_NUMBER)
magenta
KUBECOLOR_THEME_DATA_DURATIONcolorused when the value is a duration, e.g “12m” or “1d12h”
KUBECOLOR_THEME_DATA_DURATIONFRESHcolorcolor used when the time value is under a certain delay
(fallback to KUBECOLOR_THEME_BASE_SUCCESS)
green
KUBECOLOR_THEME_DATA_RATIO_ZEROcolorused for “0/0”
(fallback to KUBECOLOR_THEME_BASE_MUTED)
gray:italic
KUBECOLOR_THEME_DATA_RATIO_EQUALcolorused for “n/n”, e.g “1/1”
KUBECOLOR_THEME_DATA_RATIO_UNEQUALcolorused for “n/m”, e.g “0/1”
(fallback to KUBECOLOR_THEME_BASE_WARNING)
yellow
KUBECOLOR_THEME_STATUS_SUCCESScolorused in status keywords, e.g “Running”, “Ready”
(fallback to KUBECOLOR_THEME_BASE_SUCCESS)
green
KUBECOLOR_THEME_STATUS_WARNINGcolorused in status keywords, e.g “Terminating”
(fallback to KUBECOLOR_THEME_BASE_WARNING)
yellow
KUBECOLOR_THEME_STATUS_ERRORcolorused in status keywords, e.g “Failed”, “Unhealthy”
(fallback to KUBECOLOR_THEME_BASE_DANGER)
red
KUBECOLOR_THEME_TABLE_HEADERcolorused on table headers
(fallback to KUBECOLOR_THEME_BASE_INFO)
bold
KUBECOLOR_THEME_TABLE_COLUMNScolor[]used on table columns when no other coloring applies such as status or duration coloring. The multiple colors are cycled based on column ID, from left to right.
(fallback to [KUBECOLOR_THEME_BASE_INFO / KUBECOLOR_THEME_BASE_SECONDARY])
white / cyan
KUBECOLOR_THEME_STDERR_ERRORcolore.g when text contains “error”
(fallback to KUBECOLOR_THEME_BASE_DANGER)
red
KUBECOLOR_THEME_STDERR_NONEFOUNDcolorused on table output like “No resources found”
(fallback to KUBECOLOR_THEME_DATA_NULL)
gray:italic
KUBECOLOR_THEME_STDERR_NONEFOUNDNAMESPACEcolorused on the namespace name of “No resources found in my-ns namespace”
(fallback to KUBECOLOR_THEME_DATA_STRING)
hiyellow
KUBECOLOR_THEME_STDERR_DEFAULTcolordeprecated: this field is no longer used (since v0.4.0)
KUBECOLOR_THEME_APPLY_CREATEDcolorused on “deployment.apps/foo created”
(fallback to KUBECOLOR_THEME_BASE_SUCCESS)
green
KUBECOLOR_THEME_APPLY_CONFIGUREDcolorused on “deployment.apps/bar configured”
(fallback to KUBECOLOR_THEME_BASE_WARNING)
yellow
KUBECOLOR_THEME_APPLY_UNCHANGEDcolorused on “deployment.apps/quux unchanged”
(fallback to KUBECOLOR_THEME_BASE_PRIMARY)
magenta
KUBECOLOR_THEME_APPLY_DRYRUNcolorused on “(dry run)” and “(server dry run)“
(fallback to KUBECOLOR_THEME_BASE_SECONDARY)
cyan
KUBECOLOR_THEME_APPLY_FALLBACKcolorused when outputs unknown format
(fallback to KUBECOLOR_THEME_BASE_SUCCESS)
green
KUBECOLOR_THEME_CREATE_CREATEDcolorused on “deployment.apps/foo created”
(fallback to KUBECOLOR_THEME_BASE_SUCCESS)
green
KUBECOLOR_THEME_CREATE_DRYRUNcolorused on “(dry run)” and “(server dry run)“
(fallback to KUBECOLOR_THEME_APPLY_DRYRUN)
cyan
KUBECOLOR_THEME_CREATE_FALLBACKcolorused when outputs unknown format
(fallback to KUBECOLOR_THEME_BASE_SUCCESS)
green
KUBECOLOR_THEME_DELETE_DELETEDcolorused on “deployment.apps “nginx” deleted”
(fallback to KUBECOLOR_THEME_BASE_DANGER)
red
KUBECOLOR_THEME_DELETE_DRYRUNcolorused on “(dry run)” and “(server dry run)“
(fallback to KUBECOLOR_THEME_APPLY_DRYRUN)
cyan
KUBECOLOR_THEME_DELETE_FALLBACKcolorused when outputs unknown format
(fallback to KUBECOLOR_THEME_BASE_DANGER)
red
KUBECOLOR_THEME_DESCRIBE_KEYcolor[]used on keys. The multiple colors are cycled based on indentation.
(fallback to KUBECOLOR_THEME_BASE_KEY)
hicyan / cyan
KUBECOLOR_THEME_DRAIN_CORDONEDcolorused on “node/my-worker-node-01 cordoned”
(fallback to KUBECOLOR_THEME_BASE_PRIMARY)
magenta
KUBECOLOR_THEME_DRAIN_EVICTINGPODcolorused on “evicting pod my-namespace/my-pod”
(fallback to KUBECOLOR_THEME_BASE_MUTED)
gray:italic
KUBECOLOR_THEME_DRAIN_EVICTEDcolorused on “pod/my-pod evicted”
(fallback to KUBECOLOR_THEME_BASE_WARNING)
yellow
KUBECOLOR_THEME_DRAIN_DRAINEDcolorused on “node/my-worker-node-01 drained”
(fallback to KUBECOLOR_THEME_BASE_SUCCESS)
green
KUBECOLOR_THEME_DRAIN_DRYRUNcolorused on “(dry run)” and “(server dry run)“
(fallback to KUBECOLOR_THEME_APPLY_DRYRUN)
cyan
KUBECOLOR_THEME_DRAIN_FALLBACKcolorused when outputs unknown format
(fallback to KUBECOLOR_THEME_BASE_WARNING)
yellow
KUBECOLOR_THEME_EXPLAIN_KEYcolor[]used on keys. The multiple colors are cycled based on indentation.
(fallback to KUBECOLOR_THEME_BASE_KEY)
hicyan / cyan
KUBECOLOR_THEME_EXPLAIN_REQUIREDcolorused on the trailing “-required-” string
(fallback to KUBECOLOR_THEME_BASE_DANGER)
red
KUBECOLOR_THEME_EXPOSE_EXPOSEDcolorused on “deployment.apps/foo created”
(fallback to KUBECOLOR_THEME_BASE_PRIMARY)
magenta
KUBECOLOR_THEME_EXPOSE_DRYRUNcolorused on “(dry run)” and “(server dry run)“
(fallback to KUBECOLOR_THEME_APPLY_DRYRUN)
cyan
KUBECOLOR_THEME_EXPOSE_FALLBACKcolorused when outputs unknown format
(fallback to KUBECOLOR_THEME_BASE_PRIMARY)
magenta
KUBECOLOR_THEME_OPTIONS_FLAGcolore.g “—kubeconfig”
(fallback to KUBECOLOR_THEME_BASE_SECONDARY)
cyan
KUBECOLOR_THEME_PATCH_PATCHEDcolorused on “deployment.apps/foo patched”
(fallback to KUBECOLOR_THEME_BASE_WARNING)
yellow
KUBECOLOR_THEME_PATCH_DRYRUNcolorused on “(dry run)” and “(server dry run)“
(fallback to KUBECOLOR_THEME_APPLY_DRYRUN)
cyan
KUBECOLOR_THEME_PATCH_FALLBACKcolorused when outputs unknown format
(fallback to KUBECOLOR_THEME_BASE_WARNING)
yellow
KUBECOLOR_THEME_ROLLOUT_ROLLEDBACKcolorused on “deployment.apps/foo rolled back”
(fallback to KUBECOLOR_THEME_BASE_WARNING)
yellow
KUBECOLOR_THEME_ROLLOUT_PAUSEDcolorused on “deployment.apps/foo paused”
(fallback to KUBECOLOR_THEME_BASE_PRIMARY)
magenta
KUBECOLOR_THEME_ROLLOUT_RESUMEDcolorused on “deployment.apps/foo resumed”
(fallback to KUBECOLOR_THEME_BASE_SECONDARY)
cyan
KUBECOLOR_THEME_ROLLOUT_RESTARTEDcolorused on “deployment.apps/foo restarted”
(fallback to KUBECOLOR_THEME_BASE_WARNING)
yellow
KUBECOLOR_THEME_ROLLOUT_DRYRUNcolorused on “(dry run)” and “(server dry run)“
(fallback to KUBECOLOR_THEME_APPLY_DRYRUN)
cyan
KUBECOLOR_THEME_ROLLOUT_FALLBACKcolorused when outputs unknown format
(fallback to KUBECOLOR_THEME_BASE_WARNING)
yellow
KUBECOLOR_THEME_SCALE_SCALEDcolorused on “deployment.apps/foo scaled”
(fallback to KUBECOLOR_THEME_BASE_WARNING)
yellow
KUBECOLOR_THEME_SCALE_DRYRUNcolorused on “(dry run)” and “(server dry run)“
(fallback to KUBECOLOR_THEME_APPLY_DRYRUN)
cyan
KUBECOLOR_THEME_SCALE_FALLBACKcolorused when outputs unknown format
(fallback to KUBECOLOR_THEME_BASE_WARNING)
yellow
KUBECOLOR_THEME_UNCORDON_UNCORDONEDcolorused on “node/my-worker-node-01 uncordoned”
(fallback to KUBECOLOR_THEME_BASE_SECONDARY)
cyan
KUBECOLOR_THEME_UNCORDON_DRYRUNcolorused on “(dry run)” and “(server dry run)“
(fallback to KUBECOLOR_THEME_APPLY_DRYRUN)
cyan
KUBECOLOR_THEME_UNCORDON_FALLBACKcolorused when outputs unknown format
(fallback to KUBECOLOR_THEME_BASE_WARNING)
yellow
KUBECOLOR_THEME_VERSION_KEYcolor[]used on the key
(fallback to KUBECOLOR_THEME_BASE_KEY)
hicyan / cyan
KUBECOLOR_THEME_HELP_HEADERcolore.g “Examples:” or “Options:“
(fallback to KUBECOLOR_THEME_TABLE_HEADER)
bold
KUBECOLOR_THEME_HELP_FLAGcolore.g “—kubeconfig”
(fallback to KUBECOLOR_THEME_BASE_SECONDARY)
cyan
KUBECOLOR_THEME_HELP_FLAGDESCcolorFlag descripion under “Options:” heading
(fallback to KUBECOLOR_THEME_BASE_INFO)
white
KUBECOLOR_THEME_HELP_URLcolore.g [https://example.com]
(fallback to KUBECOLOR_THEME_BASE_SECONDARY)
cyan
KUBECOLOR_THEME_HELP_TEXTcolorFallback text color
(fallback to KUBECOLOR_THEME_BASE_INFO)
white
KUBECOLOR_THEME_LOGS_KEYcolor[](fallback to KUBECOLOR_THEME_DATA_KEY)hicyan / cyan
KUBECOLOR_THEME_LOGS_QUOTEDSTRINGcolorUsed on quoted strings that are not part of a key="value"
(fallback to KUBECOLOR_THEME_DATA_STRING)
hiyellow
KUBECOLOR_THEME_LOGS_DATEcolor(fallback to KUBECOLOR_THEME_BASE_MUTED)gray:italic
KUBECOLOR_THEME_LOGS_SOURCEREFcolor(fallback to KUBECOLOR_THEME_BASE_MUTED)gray:italic
KUBECOLOR_THEME_LOGS_GUIDcolor(fallback to KUBECOLOR_THEME_BASE_MUTED)gray:italic
KUBECOLOR_THEME_LOGS_SEVERITY_TRACEcolor(fallback to KUBECOLOR_THEME_BASE_MUTED)gray:italic
KUBECOLOR_THEME_LOGS_SEVERITY_DEBUGcolor(fallback to KUBECOLOR_THEME_BASE_MUTED)gray:italic
KUBECOLOR_THEME_LOGS_SEVERITY_INFOcolor(fallback to KUBECOLOR_THEME_BASE_SUCCESS)green
KUBECOLOR_THEME_LOGS_SEVERITY_WARNcolor(fallback to KUBECOLOR_THEME_BASE_WARNING)yellow
KUBECOLOR_THEME_LOGS_SEVERITY_ERRORcolor(fallback to KUBECOLOR_THEME_BASE_DANGER)red
KUBECOLOR_THEME_LOGS_SEVERITY_FATALcolor(fallback to KUBECOLOR_THEME_BASE_DANGER)red
KUBECOLOR_THEME_LOGS_SEVERITY_PANICcolor(fallback to KUBECOLOR_THEME_BASE_DANGER)red