diff --git a/content/en/docs/tasks/tools/included/optional-kubectl-configs-fish.md b/content/en/docs/tasks/tools/included/optional-kubectl-configs-fish.md new file mode 100644 index 0000000000..a64d0e184c --- /dev/null +++ b/content/en/docs/tasks/tools/included/optional-kubectl-configs-fish.md @@ -0,0 +1,15 @@ +--- +title: "fish auto-completion" +description: "Optional configuration to enable fish shell auto-completion." +headless: true +--- + +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. + +To do so in all your shell sessions, add the following line to your `~/.config/fish/config.fish` file: + +```shell +kubectl completion fish | source +``` + +After reloading your shell, kubectl autocompletion should be working. diff --git a/content/en/docs/tasks/tools/install-kubectl-linux.md b/content/en/docs/tasks/tools/install-kubectl-linux.md index dcb6e2d6c9..fb9c5c3a2e 100644 --- a/content/en/docs/tasks/tools/install-kubectl-linux.md +++ b/content/en/docs/tasks/tools/install-kubectl-linux.md @@ -178,10 +178,11 @@ kubectl version --client kubectl provides autocompletion support for Bash, Zsh, Fish, and PowerShell, which can save you a lot of typing. -Below are the procedures to set up autocompletion for Bash and Zsh. +Below are the procedures to set up autocompletion for Bash, Fish, and Zsh. {{< tabs name="kubectl_autocompletion" >}} {{< tab name="Bash" include="included/optional-kubectl-configs-bash-linux.md" />}} +{{< tab name="Fish" include="included/optional-kubectl-configs-fish.md" />}} {{< tab name="Zsh" include="included/optional-kubectl-configs-zsh.md" />}} {{< /tabs >}} diff --git a/content/en/docs/tasks/tools/install-kubectl-macos.md b/content/en/docs/tasks/tools/install-kubectl-macos.md index 676fa968c8..2dc56e5235 100644 --- a/content/en/docs/tasks/tools/install-kubectl-macos.md +++ b/content/en/docs/tasks/tools/install-kubectl-macos.md @@ -161,10 +161,11 @@ If you are on macOS and using [Macports](https://macports.org/) package manager, kubectl provides autocompletion support for Bash, Zsh, Fish, and PowerShell which can save you a lot of typing. -Below are the procedures to set up autocompletion for Bash and Zsh. +Below are the procedures to set up autocompletion for Bash, Fish, and Zsh. {{< tabs name="kubectl_autocompletion" >}} {{< tab name="Bash" include="included/optional-kubectl-configs-bash-mac.md" />}} +{{< tab name="Fish" include="included/optional-kubectl-configs-fish.md" />}} {{< tab name="Zsh" include="included/optional-kubectl-configs-zsh.md" />}} {{< /tabs >}}