zsh and az (azure) command autocomplete

az” autocomplete command from azure-cli package do not work by default. By autocomplete I understand the functionality where command can populate additional options by pressing <TAB> button twice.

In zsh 5.8.1 (macOS ver. 12.6.1) to make it work, create the following file in your home directory: “.zshrc” with the content:


autoload bashcompinit && bashcompinit &&
autoload compinit && compinit
source /usr/local/etc/bash_completion.d/az

Assumption is that you have installed az with the brew: brew update && brew install azure-cli

az binary are then in /usr/local/bin/az, and autocompletion file in /usr/local/etc/bash_completion.d/az

This functionality do not work for az extensions. For example, vmware extension needs to be typed (az vmware), but then subcommands are autocomplete and everything works as expected.

I believe autocomplete was one of the main features that makes Linux shell (bash in particular) so popular. Everyone appreciate the fact that there is no need to remember every command option by hard. And also, less typing means more works can be done 🙂

No Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Free(BSD)
Search for duplicated files

This will be short (but hopefully I will find more time to show entire process to search duplicated files together with some examples). In case you are searching for duplicated files I can recommend two software which actually rocks in openSource world

Azure
NFS issue, cannot be mounted or is not visible

The same kind of issue I have encountered numerous times while working across different environments and with various customers. The problem with NFS mounts connected from remote locations is so common. This issue extends beyond communication solely over WAN and also include connections between datacenters (DC) where we lack control …

Azure
Why Firefox is important and people should use this browser in 2024, my thoughts.

Can you remember the times when everyone was using Internet Explorer? Back in the ’90s and the early part of this century, Internet Explorer dominated the browser market. Software Incompatibility with Other Browsers Incompatibility issues with software and other browsers have been a persistent problem. Even in 2022, this remains …