Skip to content

Commit ad015ad

Browse files
committed
Add instructions for enabling fish auto-completions for kubectl
1 parent 05c913e commit ad015ad

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: "fish auto-completion"
3+
description: "Optional configuration to enable fish shell auto-completion."
4+
headless: true
5+
---
6+
7+
The kubectl completion script for Fish can be generated with the command `kubectl completion fish`. Sourcing the completion script in your shell enables kubectl autocompletion.
8+
9+
To do so in all your shell sessions, add the following line to your `~/.config/fish/config.fish` file:
10+
11+
```shell
12+
kubectl completion fish | source
13+
```
14+
15+
After reloading your shell, kubectl autocompletion should be working.

content/en/docs/tasks/tools/install-kubectl-linux.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,11 @@ kubectl version --client
178178

179179
kubectl provides autocompletion support for Bash, Zsh, Fish, and PowerShell, which can save you a lot of typing.
180180

181-
Below are the procedures to set up autocompletion for Bash and Zsh.
181+
Below are the procedures to set up autocompletion for Bash, Fish, and Zsh.
182182

183183
{{< tabs name="kubectl_autocompletion" >}}
184184
{{< tab name="Bash" include="included/optional-kubectl-configs-bash-linux.md" />}}
185+
{{< tab name="Fish" include="included/optional-kubectl-configs-fish.md" />}}
185186
{{< tab name="Zsh" include="included/optional-kubectl-configs-zsh.md" />}}
186187
{{< /tabs >}}
187188

content/en/docs/tasks/tools/install-kubectl-macos.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,11 @@ If you are on macOS and using [Macports](https://macports.org/) package manager,
161161

162162
kubectl provides autocompletion support for Bash, Zsh, Fish, and PowerShell which can save you a lot of typing.
163163

164-
Below are the procedures to set up autocompletion for Bash and Zsh.
164+
Below are the procedures to set up autocompletion for Bash, Fish, and Zsh.
165165

166166
{{< tabs name="kubectl_autocompletion" >}}
167167
{{< tab name="Bash" include="included/optional-kubectl-configs-bash-mac.md" />}}
168+
{{< tab name="Fish" include="included/optional-kubectl-configs-fish.md" />}}
168169
{{< tab name="Zsh" include="included/optional-kubectl-configs-zsh.md" />}}
169170
{{< /tabs >}}
170171

0 commit comments

Comments
 (0)