Skip to content

Conversation

@vitorfloriano
Copy link

@vitorfloriano vitorfloriano commented Feb 2, 2026

The completion for bash now displays the short description for the subcommands and flags, similar to the bash completion in tools like kubectl and helm.

The short descriptions provide better UX with improved discoverability. It will also allow us to add usage examples to the short descriptions in follow-ups.

Current bash completion:

$ kind
build       completion  create      delete      export      get         help        load        version

$ kind export
kubeconfig  logs

$ kind export kubeconfig --
--internal     --kubeconfig   --kubeconfig=  --name         --name=        --quiet        --verbosity    --verbosity=

Bash Completion V2:

$ kind
build       (Build one of [node-image])
completion  (Output shell completion code for the specified shell (bash, zsh or fish))
create      (Creates one of [cluster])
delete      (Deletes one of [cluster])
export      (Exports one of [kubeconfig, logs])
get         (Gets one of [clusters, nodes, kubeconfig])
help        (Help about any command)
load        (Loads images into nodes)
version     (Prints the kind CLI version)

$ kind export
kubeconfig  (Exports cluster kubeconfig)                              logs        (Exports logs to a tempdir or [output-dir] if specified)

$ kind export kubeconfig --
--help        (help for kubeconfig)
--internal    (use internal address instead of external)
--kubeconfig  (sets kubeconfig path instead of $KUBECONFIG or $HOME/.kube/config)
--name        (the cluster context name)
--quiet       (silence all stderr output)
--verbosity   (info log verbosity, higher value produces more output)

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 2, 2026
@vitorfloriano vitorfloriano changed the title feat: add short description to bash completion feat(cli): add short description to bash completion Feb 2, 2026
The completion for bash now displays the short description for the subcommands and flags.
@vitorfloriano vitorfloriano force-pushed the feat-bash-completion-v2 branch from c3d3af8 to 2ce02bc Compare February 2, 2026 12:56
@stmcginnis
Copy link
Contributor

spf13/cobra#1146 for background.

Simple update to the latest and greatest from the library. Looks good.

Some test failures, but that would not be related to this change.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 2, 2026
Copy link
Member

@BenTheElder BenTheElder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!!

looks like this is fully backwards compatible so
/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: BenTheElder, vitorfloriano

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants