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.

VMware
Adding vCenter inventory into VCF Automation

4. From tree, expand vCenter and run workflow: Add a vCenter instance. It might be required to disable option “Do you want to create a session per user to the vCenter?” 5. Under Administration -> Inventory, select vCenter and verify if Datacenters folder is visible Now you can run workflows …

VMware
VCF, backup configuration

Backup implementation for VMware component is fairly easy. Just the requirements is to configure SFTP server in proper way and make it network available to the VMware components. SDDC Manager and NSX Manager backup In VCF Operations it is possible to configure backup for SDDC Manager and NSX Manager. Go …

VMware
VCF Automation, fresh environment configuration with identity providers and access control.

Introduction Login Login as user admin to the Organization name: system or if selected manual: Check the connections (in Administration section), where you should see connection to the vCenter and NSX-t manager as those are provided automatically via VCF Operations: the same for VCF Instances: Also check your networking: Identity …