bazelbuild / bazelbuild/bazel

New command "bazel completion (bash|zsh|fish)"

Open
#26,472 2 comments 2 reactions 0 assignees View on GitHub
help wanted P3 team-CLI type: feature request
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the feature request:

Bazel should support printable completions like [kubectl](https://kubernetes.io/docs/reference/kubectl/generated/kubectl_completion/), [helm](https://helm.sh/docs/helm/helm_completion/), [gh-cli](https://cli.github.com/manual/gh_completion), [rustup](https://rust-lang.github.io/rustup/installation/index.html#enable-tab-completion-for-bash-fish-zsh-or-powershell)... I can keep going.
The main cause of delay of bazelbuild/bazelisk#29 although it was the most upvoted issue in bazelisk was that there was no trivial way to actually get it. I believe this shouldn't be the work of bazelisk, but rather a command in bazel itself.

Even if not for the `bazelisk` use case, providing completions directly in the subcommand itself is much more useful, coherent and simpler.

### Which category does this issue belong to?

CLI

### What underlying problem are you trying to solve with this feature?

_No response_

### Which operating system are you running Bazel on?

_No response_

### What is the output of `bazel info release`?

_No response_

### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.

_No response_

### What's the output of `git remote get-url origin; git rev-parse HEAD` ?

```text

```

### Have you found anything relevant by searching the web?

_No response_

### Any other information, logs, or outputs that you want to share?

_No response_

Contributor guide

Open the contributing guide

Research direction

The issue names no files, tests, or implementation entry point. First locate Bazel's CLI command definitions and determine how a command can print completions for bash, zsh, and fish; done means the new command produces usable output for all three shells.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.