Skip to content

kubectl

The community/apps/kubectl directory contains files that add voice control for the kubectl command-line tool.

The main file is kubectl.talon, which defines the voice commands for interacting with kubectl. Most of the commands are straightforward mappings, for example saying "cube get" will insert kubectl get. Some commands like "cube shell" insert more complex text like kubectl exec -it -- /bin/bash. A few commands are also mapped to keyboard shortcuts, like "cube detach" which is mapped to ctrl-p ctrl-q. Some commands use the lists defined in kubectl.py, for example "cube {user.kubectl_action} [{user.kubectl_object}]" will insert a command like kubectl get pods, where {user.kubectl_action} and {user.kubectl_object} are values from the lists.

kubectl.py defines the user.kubectl tag, which is used to enable these commands when the user is working in a terminal. It also defines two lists: kubectl_action and kubectl_object. These lists provide the possible values for the commands mentioned above that take user input. The kubectl_action list includes get, delete, describe, and label. The kubectl_object list includes common Kubernetes objects like nodes, jobs, pods, namespaces, services, events, deployments, replicasets, and daemonsets.