Skip to content

✨ feat(cli): add short description to tab completion in bash#5408

Merged
k8s-ci-robot merged 1 commit intokubernetes-sigs:masterfrom
vitorfloriano:feat-improve-completion
Jan 28, 2026
Merged

✨ feat(cli): add short description to tab completion in bash#5408
k8s-ci-robot merged 1 commit intokubernetes-sigs:masterfrom
vitorfloriano:feat-improve-completion

Conversation

@vitorfloriano
Copy link
Contributor

@vitorfloriano vitorfloriano commented Jan 28, 2026

This PR enhances the tab completion in bash with a short description for all available subcommands and flags, similar to kubectl and docker tab completion.

Current completion in bash:

$ kubebuilder
alpha       completion  create      edit        help        init        version

$ kubebuilder init --
--domain                 --license                --owner=                 --project-name           --project-version=       --skip-go-version-check
--domain=                --license=               --plugins                --project-name=          --repo
--fetch-deps             --owner                  --plugins=               --project-version        --repo=

New completion in bash:

$ kubebuilder
alpha       (Alpha-stage subcommands)                   help        (Help about any command)
completion  (Load completions for the specified shell)  init        (Initialize a new project)
create      (Scaffold a Kubernetes API or webhook)      version     (Print the kubebuilder version)
edit        (Update the project configuration)

$ kubebuilder init --
--domain                 (domain for groups)
--fetch-deps             (ensure dependencies are downloaded)
--help                   (help for init)
--license                (license to use to boilerplate, may be one of 'apache2', 'none')
--owner                  (owner to add to the copyright)
--plugins                (plugin keys to be used for this subcommand execution)
--project-name           (name of this project)
--project-version        (project version)
--repo                   (name to use for go module (e.g., github.com/user/repo), defaults to the go package of the current working directory.)
--skip-go-version-check  (if specified, skip checking the Go version)

This greatly improves the UX and allows us to add examples to the short descriptions in follow-ups.

The tab completion in bash now displays the short description for
subcommands and flags.
@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 Jan 28, 2026
@vitorfloriano
Copy link
Contributor Author

/retest

Copy link
Member

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

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

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86, 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 Jan 28, 2026
@k8s-ci-robot k8s-ci-robot merged commit 44c4d03 into kubernetes-sigs:master Jan 28, 2026
19 checks passed
@vitorfloriano vitorfloriano deleted the feat-improve-completion branch January 28, 2026 22:47
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.

3 participants