Azure / Azure/azure-cli

No bash completion (or missing instructions) on Mac (Big Sur)

Open
#17,828 2 comments 0 reactions 1 assignee Assigned to @jiasli View on GitHub
act-platform-engineering-squad feature-request Packaging
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

**Describe the bug**
A clean Homebrew install of Azure CLI used to include instructions for modifying `.bash_profile` or `.zshrc` to enable bash completion. This no longer appears to be the case.

**To Reproduce**
Install Homebrew
`brew install zsh`
`brew install azure-cli`

No information provided on how to enable auto completions.

**Expected behavior**

Include helper command like `az completion zsh` that can be added, or provide instructions for how to properly enable completions.

After much digging I have determined this should be the following for ZSH:
```
autoload bashcompinit && bashcompinit
source $(brew --prefix)/etc/bash_completion.d/az
```

Note that `brew --prefix` most likely corresponds to `/opt/homebrew`

**Environment summary**

Mac OS 11.2.3. -- M1 Mac (ARM64)
zsh 5.8 (arm-apple-darwin20.2.0)

```
brew --version
Homebrew 3.1.3
Homebrew/homebrew-core (git revision 7beae5ab57; last commit 2021-04-22)
Homebrew/homebrew-cask (git revision d0318692c3; last commit 2021-04-22)
```

```
az --version
azure-cli 2.22.1

core 2.22.1
telemetry 1.0.6

Extensions:
azure-cli-ml 1.25.0
subscription 0.1.4
account 0.2.1

Python location '/opt/homebrew/Cellar/azure-cli/2.22.1/libexec/bin/python'
Extensions directory '/Users/bverst/.azure/cliextensions'

Python (Darwin) 3.8.9 (default, Apr 2 2021, 17:46:14)
[Clang 12.0.0 (clang-1200.0.32.29)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Please let us know how we are doing: https://aka.ms/azureclihats
and let us know if you're interested in trying out our newest features: https://aka.ms/CLIUXstudy
```

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.