aws_completer does not auto complete command aliases, even though aliases are displayed as valid choices in error message #9446
Labels
feature-request
A feature should be added or improved.
needs-triage
This issue or PR still needs to be triaged.
Describe the feature
Currently, if you were to type an invalid subcommand, you get back a list of valid subcommands
This list actually includes custom aliases defined in
~/.aws/cli/alias
However,
aws_autocomplete
does not seem to have available the aliases to be auto completed. The below command does not display any of theinstances-*
commands as shown in the error message above.The
aws_completer
command doesn't include the alias in it's results$ COMP_LINE="aws ec2 i" aws_completer import-client-vpn-client-certificate-revocation-list import-image import-key-pair import-snapshot $
Use Case
It is much faster to use autocomplete to complete long commands as well as to remind oneself of what commands exist based on a known prefix. This should include custom aliases which are created in the
~/.aws/cli/alias
file.Proposed Solution
Make sure the same method of building the list of available subcommands in error messages is used by
aws_completer
to build available command and subcommand choices including aliases from~/.aws/cli/alias
.Other Information
No response
Acknowledgements
CLI version used
aws-cli/2.17.32 Python/3.11.9 Linux/6.11.0-21-generic exe/x86_64.ubuntu.24
Environment details (OS name and version, etc.)
Ubuntu 24.04.2 LTS
The text was updated successfully, but these errors were encountered: