Azure / Azure/azure-cli

Add autocompletion support for bash/zsh

Open
#33,408 2 comments 0 reactions 0 assignees View on GitHub
Autocomplete customer-reported Feature Candidate feature-request Possible-Solution Service Attention Similar-Issue
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

**Related command**
`az completion`

**Is your feature request related to a problem? Please describe.**
When installing `azure-cli` on Arch-based distributions via AUR, the package installs to `/opt/azure-cli` and does not include a shell completion script. There is no file in `/etc/bash_completion.d/` or `/usr/share/bash-completion/completions/`, and `az completion` is not a recognized subcommand. This means users get no tab-completion out of the box for zsh (or bash).

**Describe the solution you'd like**
Ship a completion script with the AUR/Arch package, or provide a built-in `az completion` subcommand (similar to `kubectl completion zsh`, `docker completion zsh`, etc.) that outputs a working completion script for common shells.

**Describe alternatives you've considered**
- Using `register-python-argcomplete az` with the `python-argcomplete` package — this works but requires an extra dependency and manual `.zshrc` configuration.
- Manually sourcing the bash completion file from other distribution paths — not applicable since no such file is included in the Arch package.

**Additional context**
- OS: CachyOS (Arch-based)
- Shell: zsh
- Install path: `/opt/azure-cli`
- `find / -name "az.completion" -o -name "azure-cli"` only returns `/usr/share/licenses/azure-cli` and `/opt/azure-cli` — no completion files.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.