Is there any way to turn on autocomplete for the IBM Cloud Kubernetes Service Cli same as for kubectl?

8/12/2020

I would like to be able to type

ibmcloud ks TAB

with the api giving me options to choose from, same as the kubectl autocomplete function. I have seen this somewhere before but can't seem to find any documentation so maybe it was a tweak.

Anyone any solutions or said tweaks? The official docs IBM Kubernetes Service Documentation

Cheers (I'm using zsh on Ubuntu 20.04)

-- Lorberta
autocomplete
ibm-cloud
kubernetes

2 Answers

8/12/2020

Article's a bit old, but: https://medium.com/@dancberg/how-to-setup-an-awesome-shell-experience-for-ibm-cloud-kubernetes-service-285467ddd455 may help (he's specifically using zsh, iirc).

In particular, the ibmcloud plugin now does the merged kube context by default, so you may be able to skip directly to the section titled "Additional awesome shell tools"

-- N Fritze
Source: StackOverflow

8/13/2020

Here's link to the official documentation you are looking for

For Linux or macOS

source /usr/local/ibmcloud/autocomplete/zsh_autocomplete

into ~/.zshrc.

Once sourced, the output of

ibmcloud ks TAB will be

enter image description here

-- Vidyasagar Machupalli
Source: StackOverflow