Fish
With the fish shell, you can add an alias with completion support quite easily like so:
# adds alias for "kubectl" to "kubecolor" with completionsfunction kubectl --wraps kubectl command kubecolor $argvend
# adds alias for "k" to "kubecolor" with completionsfunction k --wraps kubectl command kubecolor $argvend
To enable completions for kubecolor
, then also add the following:
# reuse "kubectl" completions on "kubecolor"function kubecolor --wraps kubectl command kubecolor $argvend
As a prerequisite, you need kubectl
completions installed.
This can be achieved by adding this to your fish config file:
# This needs to be added before "function ... --wraps kubectl"kubectl completion fish | source