Alibaba Cloud CLI auto-completes commands and lists suggestions as you type in bash or zsh on Linux and macOS.
Supported platforms and shells
Auto-completion relies on the shell completion mechanism (COMP_LINE and COMP_POINT environment variables). The following table lists supported platforms and shells.
|
Operating system |
Shell |
Supported |
|
Linux |
bash |
|
|
Linux |
zsh |
|
|
macOS |
bash |
|
|
macOS |
zsh |
|
|
Windows |
CMD |
|
|
Windows |
PowerShell |
|
Enable or disable auto-completion
Run the following commands to enable or disable auto-completion.
-
Enable auto-completion:
aliyun auto-completionThis writes a completion script to
~/.bashrcor~/.bash_profile(bash) or~/.zshrc(zsh). Reopen the terminal or runsource ~/.bashrc/source ~/.zshrcto apply. -
Disable auto-completion:
aliyun auto-completion --uninstallThis removes the completion script from
~/.bashrcor~/.zshrcand creates a.bckbackup file.
Examples
Auto-completion completes entries or displays suggestions as you type. The following examples demonstrate this behavior.
Example 1: List suggested commands
-
Type a partial command and press
Tab.aliyun ecs c -
The shell lists available commands starting with
c.config configure contactcenterai
Example 2: Auto-complete a parameter
-
Type a partial parameter and press
Tab.aliyun configure --m -
The shell completes the parameter starting with
m.--mode