Skip to content

Commit 267564d

Browse files
author
Kalle Fagerberg
committed
Added missing docs from reference docs
1 parent d41866b commit 267564d

4 files changed

Lines changed: 139 additions & 13 deletions

File tree

src/content/docs/customizing/custom-kubectl.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ internally in kubecolor. For example, when you want to use a versioned-kubectl
1111
<Tabs syncKey="config">
1212
<TabItem label="Environment variables">
1313
```bash
14-
export KUBECTL_COMMAND="kubectl.1.19"
14+
export KUBECOLOR_KUBECTL="kubectl.1.19"
1515
```
1616
</TabItem>
1717
<TabItem label="Config file">
@@ -31,7 +31,7 @@ This feature can be used to use kubecolor with the OpenShift CLI (`oc`) as well:
3131
<Tabs syncKey="config">
3232
<TabItem label="Environment variables">
3333
```bash
34-
export KUBECTL_COMMAND="oc"
34+
export KUBECOLOR_KUBECTL="oc"
3535
```
3636
</TabItem>
3737
<TabItem label="Config file">
@@ -54,5 +54,5 @@ to also set the environment variable:
5454

5555
```bash
5656
# ~/.bashrc
57-
alias oc="env KUBECTL_COMMAND=oc kubecolor"
57+
alias oc="env KUBECOLOR_KUBECTL=oc kubecolor"
5858
```

src/content/docs/customizing/themes.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ sidebar:
1212
import { Tabs, TabItem } from '@astrojs/starlight/components';
1313
import SvgCommandOutput from '../../../components/svg-command-output.astro';
1414

15-
# Default color scheme
15+
## Default color scheme
1616

1717
As of version v0.3.0, `kubecolor` bundles new themes (also referred to as "presets"):
1818

@@ -53,7 +53,7 @@ Set your configuration to match your color-blindness type so you will benefit of
5353
[We gladly accept suggestions](https://github.com/kubecolor/kubecolor/issues/new) on how to improve them.
5454
:::
5555

56-
# Switching to a different color theme
56+
## Switching to a different color theme
5757

5858
There's three way to switch to a different color theme:
5959

src/content/docs/reference/config.mdx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ pager: # the command to use as pager; default uses $PAGER, less, or more
2020
# Color theme options
2121
theme:
2222
base:
23+
danger: red # (color) general color for when things are bad
2324
info: white # (color) general color for when things are informational
25+
muted: gray:italic # (color) general color for when things are less relevant
2426
primary: magenta # (color) general color for when things are focus
2527
secondary: cyan # (color) general color for when things are secondary focus
2628
success: green # (color) general color for when things are good
2729
warning: yellow # (color) general color for when things are wrong
28-
danger: red # (color) general color for when things are bad
29-
muted: gray:italic # (color) general color for when things are less relevant
3030
key: hicyan / cyan # (color[]) general color for keys (fallback to [theme.base.secondary])
3131
default: green # (color) default when no specific mapping is found for the command
3232
shell:
@@ -64,6 +64,7 @@ theme:
6464
created: green # (color) used on "deployment.apps/foo created" (fallback to theme.base.success)
6565
configured: yellow # (color) used on "deployment.apps/bar configured" (fallback to theme.base.warning)
6666
unchanged: magenta # (color) used on "deployment.apps/quux unchanged" (fallback to theme.base.primary)
67+
serverside: yellow # (color) used on "deployment.apps/quux serverside-applied" (fallback to theme.base.warning)
6768
dryRun: cyan # (color) used on "(dry run)" and "(server dry run)" (fallback to theme.base.secondary)
6869
fallback: green # (color) used when outputs unknown format (fallback to theme.base.success)
6970
create:
@@ -133,11 +134,19 @@ theme:
133134
error: red # (color) (fallback to theme.base.danger)
134135
fatal: red # (color) (fallback to theme.base.danger)
135136
panic: red # (color) (fallback to theme.base.danger)
137+
diff:
138+
added: green # (color) used on added lines (fallback to theme.base.success)
139+
removed: red # (color) used on removed lines (fallback to theme.base.danger)
140+
unchanged: gray:italic # (color) used on unchanged lines (fallback to theme.base.muted)
136141
```
137142
138143
You can also override the path of the config file using the `KUBECOLOR_CONFIG`
139144
environment variable:
140145

141146
```bash
147+
# Default
148+
export KUBECOLOR_CONFIG="$HOME/.kube/color.yaml"
149+
150+
# But you can override it to someplace else
142151
export KUBECOLOR_CONFIG="$HOME/.config/kubecolor.yaml"
143152
```

src/content/docs/reference/environment-variables.md

Lines changed: 123 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,44 @@ title: Environment variables
33
description: Variables that are supported by kubecolor
44
---
55

6+
## `KUBECOLOR_CONFIG`
7+
8+
Override the path of the config file.
9+
10+
```bash
11+
export KUBECOLOR_CONFIG="$HOME/.kube/color.yaml" # default
12+
export KUBECOLOR_CONFIG="$HOME/.config/kubecolor.yaml"
13+
```
14+
15+
See: [Reference / Config file](/reference/config/)
16+
17+
## `KUBECOLOR_KUBECTL`
18+
19+
Changes which `kubectl` command to run.
20+
21+
```bash
22+
export KUBECOLOR_KUBECTL=kubectl # default
23+
export KUBECOLOR_KUBECTL=kubectl1.19
24+
export KUBECOLOR_KUBECTL=oc # openshift
25+
```
26+
27+
See: [Customizing / Custom kubectl or OpenShift CLI](/customizing/custom-kubectl/)
28+
629
## `KUBECOLOR_OBJ_FRESH`
730

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

10-
Please see [Specify object fresh age threshold](#specify-object-fresh-age-threshold)
33+
```bash
34+
export KUBECOLOR_OBJ_FRESH="0" # default
35+
export KUBECOLOR_OBJ_FRESH="10h"
36+
```
37+
38+
See: [Customizing / Fresh objects](/customizing/obj-fresh/)
1139

1240
## `KUBECOLOR_FORCE_COLORS`
1341

1442
In addition to forcing colors with `--force-colors`, you can also do so by setting the environment variable `KUBECOLOR_FORCE_COLORS=auto`.
15-
See [Dynamic color support](#dynamic-color-support) section for all possible values.
43+
See [Dynamic color support](/usage/how-it-works/#dynamic-color-support) section for all possible values.
1644

1745
You can use this environment variable to colorize output when you invoke kubecolor in the `watch` command (e.g. `watch kubecolor get pods`).
1846
Set the following alias:
@@ -27,21 +55,76 @@ watch kubecolor get pods
2755

2856
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).
2957

30-
## `KUBECOLOR_LIGHT_BACKGROUND`
58+
## `NO_COLOR`
59+
60+
Coloring is disabled if `NO_COLOR` is set to any non-empty value.
61+
This is equivalent to the `--plain` or `--force-colors=none` command-line flags.
62+
63+
```bash
64+
# These disable coloring
65+
export NO_COLOR=1
66+
export NO_COLOR="no"
67+
export NO_COLOR="yes"
68+
export NO_COLOR="Lorem ipsum"
69+
70+
# These revert to kubecolor's default coloring logic
71+
export NO_COLOR=""
72+
unset NO_COLOR
73+
```
74+
75+
## `KUBECOLOR_PRESET`
76+
77+
Changes which color theme kubecolor uses.
78+
Defaults to `dark`
79+
80+
```bash
81+
export KUBECOLOR_PRESET="dark" # default
82+
export KUBECOLOR_PRESET="light"
83+
export KUBECOLOR_PRESET="protanopia-dark"
84+
```
85+
86+
See: [Customizing / Color themes](/customizing/themes/#switching-to-a-different-color-theme)
87+
88+
## `KUBECOLOR_PAGING`
89+
90+
Whether to pipe supported subcommands to a pager.
91+
Valid values: `auto` or `never`.
92+
Defaults to `never`.
93+
94+
```bash
95+
export KUBECOLOR_PAGING="auto"
96+
export KUBECOLOR_PAGING="never" # default
97+
```
98+
99+
## `KUBECOLOR_PAGER`
100+
101+
Sets which pager application to use.
102+
Defaults to `$PAGER`, `less`, or `more` (depending on which are available)
103+
104+
```bash
105+
export KUBECOLOR_PAGER="less"
106+
```
107+
108+
## `PAGER`
31109

32-
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`.
110+
Sets which pager application to use. Used as a default if `KUBECOLOR_PAGER`
111+
environment variable, the `pager` config, or `--pager` flag are unset.
112+
113+
```bash
114+
export PAGER="less"
115+
```
33116

34117
## Theme variables
35118

36119
| Environment variable | Type | Description | Dark theme
37120
| -------------------- | ---- | ----------- | ----------
121+
| `KUBECOLOR_THEME_BASE_DANGER` | color | general color for when things are bad | `red`
38122
| `KUBECOLOR_THEME_BASE_INFO` | color | general color for when things are informational | `white`
123+
| `KUBECOLOR_THEME_BASE_MUTED` | color | general color for when things are less relevant | `gray:italic`
39124
| `KUBECOLOR_THEME_BASE_PRIMARY` | color | general color for when things are focus | `magenta`
40125
| `KUBECOLOR_THEME_BASE_SECONDARY` | color | general color for when things are secondary focus | `cyan`
41126
| `KUBECOLOR_THEME_BASE_SUCCESS` | color | general color for when things are good | `green`
42127
| `KUBECOLOR_THEME_BASE_WARNING` | color | general color for when things are wrong | `yellow`
43-
| `KUBECOLOR_THEME_BASE_DANGER` | color | general color for when things are bad | `red`
44-
| `KUBECOLOR_THEME_BASE_MUTED` | color | general color for when things are less relevant | `gray:italic`
45128
| `KUBECOLOR_THEME_BASE_KEY` | color[] | general color for keys<br/>*(fallback to `[KUBECOLOR_THEME_BASE_SECONDARY]`)* | `hicyan / cyan`
46129
| | | |
47130
| `KUBECOLOR_THEME_DEFAULT` | color | default when no specific mapping is found for the command | `green`
@@ -80,6 +163,7 @@ In addition to use the light color preset with `--light-background`, you can als
80163
| `KUBECOLOR_THEME_APPLY_CREATED` | color | used on "deployment.apps/foo created"<br/>*(fallback to `KUBECOLOR_THEME_BASE_SUCCESS`)* | `green`
81164
| `KUBECOLOR_THEME_APPLY_CONFIGURED` | color | used on "deployment.apps/bar configured"<br/>*(fallback to `KUBECOLOR_THEME_BASE_WARNING`)* | `yellow`
82165
| `KUBECOLOR_THEME_APPLY_UNCHANGED` | color | used on "deployment.apps/quux unchanged"<br/>*(fallback to `KUBECOLOR_THEME_BASE_PRIMARY`)* | `magenta`
166+
| `KUBECOLOR_THEME_APPLY_SERVERSIDE` | color | used on "deployment.apps/quux serverside-applied"<br/>*(fallback to `KUBECOLOR_THEME_BASE_WARNING`)* | `yellow`
83167
| `KUBECOLOR_THEME_APPLY_DRYRUN` | color | used on "(dry run)" and "(server dry run)"<br/>*(fallback to `KUBECOLOR_THEME_BASE_SECONDARY`)* | `cyan`
84168
| `KUBECOLOR_THEME_APPLY_FALLBACK` | color | used when outputs unknown format<br/>*(fallback to `KUBECOLOR_THEME_BASE_SUCCESS`)* | `green`
85169
| | | |
@@ -149,4 +233,37 @@ In addition to use the light color preset with `--light-background`, you can als
149233
| `KUBECOLOR_THEME_LOGS_SEVERITY_ERROR` | color | *(fallback to `KUBECOLOR_THEME_BASE_DANGER`)* | `red`
150234
| `KUBECOLOR_THEME_LOGS_SEVERITY_FATAL` | color | *(fallback to `KUBECOLOR_THEME_BASE_DANGER`)* | `red`
151235
| `KUBECOLOR_THEME_LOGS_SEVERITY_PANIC` | color | *(fallback to `KUBECOLOR_THEME_BASE_DANGER`)* | `red`
236+
| | | |
237+
| `KUBECOLOR_THEME_DIFF_ADDED` | color | used on added lines<br/>*(fallback to `KUBECOLOR_THEME_BASE_SUCCESS`)* | `green`
238+
| `KUBECOLOR_THEME_DIFF_REMOVED` | color | used on removed lines<br/>*(fallback to `KUBECOLOR_THEME_BASE_DANGER`)* | `red`
239+
| `KUBECOLOR_THEME_DIFF_UNCHANGED` | color | used on unchanged lines<br/>*(fallback to `KUBECOLOR_THEME_BASE_MUTED`)* | `gray:italic`
240+
241+
## Deprecated flags
242+
243+
:::caution
244+
Deprecated: these environment variables are kept for backwards compatibility and
245+
but may be removed in a future version.
246+
:::
247+
248+
### `KUBECTL_COMMAND`
249+
250+
Changes which `kubectl` command to run.
251+
252+
```bash
253+
export KUBECTL_COMMAND=kubectl # default
254+
export KUBECTL_COMMAND=kubectl1.19
255+
export KUBECTL_COMMAND=oc # openshift
256+
```
257+
258+
Please use `KUBECOLOR_KUBECTL=kubectl` instead.
259+
260+
### `KUBECOLOR_LIGHT_BACKGROUND`
261+
262+
In addition to use the light color preset with `--light-background`.
263+
Defaults to `false`
264+
265+
```bash
266+
export KUBECOLOR_LIGHT_BACKGROUND=true
267+
```
152268

269+
Please use `KUBECOLOR_PRESET=light` instead.

0 commit comments

Comments
 (0)