All Products
Search
Document Center

:Command auto-completion

Last Updated:Jun 02, 2026

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

Supported

Linux

zsh

Supported

macOS

bash

Supported

macOS

zsh

Supported

Windows

CMD

Not supported

Windows

PowerShell

Not supported

Enable or disable auto-completion

Run the following commands to enable or disable auto-completion.

  • Enable auto-completion:

    aliyun auto-completion

    This writes a completion script to ~/.bashrc or ~/.bash_profile (bash) or ~/.zshrc (zsh). Reopen the terminal or run source ~/.bashrc / source ~/.zshrc to apply.

  • Disable auto-completion:

    aliyun auto-completion --uninstall

    This removes the completion script from ~/.bashrc or ~/.zshrc and creates a .bck backup file.

Examples

Auto-completion completes entries or displays suggestions as you type. The following examples demonstrate this behavior.

Example 1: List suggested commands

  1. Type a partial command and press Tab.

    aliyun ecs c
  2. The shell lists available commands starting with c.

    config           configure        contactcenterai

Example 2: Auto-complete a parameter

  1. Type a partial parameter and press Tab.

    aliyun configure --m
  2. The shell completes the parameter starting with m.

     --mode