Azure / Azure/azure-cli-extensions
Enable completion for arguments in aliases
- Dominant language
- Python
- Stars
- 454
- Forks
- 1.7k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 64
Description
- If the issue is to do with Azure CLI 2.0 in-particular, create an issue here at [Azure/azure-cli](https://github.com/Azure/azure-cli/issues)
### Extension name: alias
### Description of issue (in as much detail as possible)
The az CLI has great tab completion support for both commands and arguments. E.g. typing `az group show -g my` and then hitting TAB will complete `my` to `mygroup`.
I'd like to get the same experience for alias arguments (BTW, it is noted that tab completion works for the alias itself - appreciate that!).
To illustrate, let's look at an example from the docs
```
az alias create \
--name "get-vm-ip {{ resourceGroup }} {{ vmName }}" \
--command "vm list-ip-addresses --resource-group {{ resourceGroup }} --name {{ vmName }}
--query [0].virtualMachine.network.publicIpAddresses[0].ipAddress"
```
With this, I'd like to be able to type `get-vm-ip my` and hit tab to complete `my` to `mygroup`.
If the alias extension could automatically determine the completion to use for an argument based on how it is used (i.e. in this case, `resourceGroup` is the value of the `--resource-group` argument) then that would be unbelievably cool. To be honest, I'd be happy with being able to add an annotation to the alias definition to hint at which completer to use, e.g. `az alias create --name "example {{ foo: resourceGroup }}" ...` to specify that the `foo` argument should be completed as a resource group name.
-----
Contributor guide
Assessment
This issue has not been assessed yet.