What is Alibaba Cloud CLI
Alibaba Cloud CLI is an open-source, cross-platform command-line tool for managing Alibaba Cloud resources. Run almost any console operation from a terminal, and combine commands into scripts to automate operations.
Benefits of Alibaba Cloud CLI
Alibaba Cloud CLI uses a single command syntax to manage 300+ cloud services such as ECS, RDS, OSS, SLB, and FC. Commands are text-based, produce structured output, and behave predictably, so they can be saved in scripts for automated execution, and programs and AI agents can generate commands and parse results directly.
Scripting and automation
Save commands in shell scripts to run them repeatedly or integrate them into CI/CD pipelines, for tasks such as batch resource creation, scheduled cleanup, and cross-region inspection.
For example, query ECS instances across multiple regions:
for region in cn-hangzhou cn-shanghai cn-beijing; do
aliyun ecs describe-instances --biz-region-id "$region" --pager
done
Switch between environments
CLI lets you save multiple credential profiles and switch between development, testing, and production environments, regions, or accounts with the --profile parameter, without re-entering credentials:
aliyun ecs describe-instances --profile dev
aliyun ecs describe-instances --profile prod
Structured output and composition
Commands return structured text such as JSON, which pipes cleanly into standard tools like jq, grep, and awk for further processing or programmatic parsing.
For example, extract the IDs of all running instances in the current region:
aliyun ecs describe-instances --biz-region-id cn-hangzhou --pager \
| jq -r '.Instances.Instance[] | select(.Status=="Running") | .InstanceId'
AI agent integration
Commands are text-based and behave predictably, so AI agents can generate commands and parse results directly, without a graphical interface.
CLI includes a built-in MCP authentication proxy (aliyun utils mcp-proxy) that connects third-party AI applications such as Dify and LangChain to OpenAPI MCP Server.
After you start the local authentication proxy, the AI agent application accesses OpenAPI MCP Server through http://127.0.0.1:8088:
aliyun utils mcp-proxy --port 8088
For configuration details, see Proxy an OpenAPI MCP server with aliyun mcp-proxy.
Supported environments
-
Linux (Bash, Zsh, etc.)
-
macOS Terminal
-
Windows (Command Prompt, PowerShell)
-
Remote environments (SSH to ECS instances, Use Cloud Shell)
Version information
Check your locally installed version. For the latest release, see GitHub Releases:
aliyun version
Alibaba Cloud CLI is hosted on the GitHub aliyun-cli repository. To report issues or suggest improvements, submit a GitHub Issue.