Skip to content

Add autocompletion support for bash/zsh #33408

@rangelovkiril

Description

@rangelovkiril

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions