All Products
Search
Document Center

:Alibaba Cloud CLI command-line options

Last Updated:Jun 02, 2026

Alibaba Cloud CLI provides command-line options that override default command behaviors or enable specific features.

Syntax

Append options to an API command:

aliyun <Command> <SubCommand> --options [optionParams]
  • Separate options and parameters with spaces. If an option has a subfield, use the subfield=value format. Parameter formats.

Available options

Option

Description

--profile,-p

Specifies a configuration profile. The specified profile overrides the default credential and environment variable settings.

Example: Call the DescribeInstances operation of Elastic Compute Service (ECS) using the akProfile profile.

aliyun ecs DescribeInstances --profile akProfile

--region

Use --region to specify a region. Overrides the region in the default credential and environment variable settings.

Example: Call the ECS DescribeInstances operation in the cn-beijing region.

aliyun ecs DescribeInstances --region cn-beijing

--endpoint

Specifies an endpoint. Find supported endpoints in Developer Reference > API Reference > Endpoints of each service.

Example: Call the CloudMonitor DescribeMonitorGroups operation using the metrics.cn-qingdao.aliyuncs.com endpoint.

aliyun cms DescribeMonitorGroups --endpoint metrics.cn-qingdao.aliyuncs.com

--endpoint-type

Specifies the endpoint type. Valid values: vpc (VPC access) and empty (public access, default).

Example: Call the DescribeInstances API of ECS using a VPC endpoint.

  • Specify in the command line

    aliyun ecs DescribeInstances --endpoint-type vpc
  • Configure for persistence

    aliyun configure set --endpoint-type vpc
    aliyun ecs DescribeInstances

--version

Specifies an API version. Must be used with the --force option. Forcibly call an API operation.

Example: Call the CloudMonitor DescribeMetricList operation with API version 2017-03-01.

aliyun cms QueryMetricList \
  --Project acs_ecs_dashboard \
  --Metric cpu_idle \
  --version 2017-03-01 \
  --force

--header

Adds a request header. Use this option multiple times to add multiple headers.

Example: Add the X-foo=bar header.

aliyun <product> <ApiName> --header X-foo=bar

--body

Adds a string as the request body for ROA API calls.

Example: Call the RunClusterCheck operation of Container Service for Kubernetes (ACK) with a JSON request body.

aliyun cs POST /clusters/{cluster_id}/checks --body "{\"type\":\"NodePoolUpgrade\",\"target\":\"np1f6779297c4444a3a1cdd29be8e5****\"}"

--body-file

Adds a file as the request body for RPC API calls. Takes precedence over --body.

Example: Call the RunClusterCheck operation of Container Service for Kubernetes (ACK) with a file request body.

aliyun cs POST /clusters/{cluster_id}/checks --body-file /usr/local/bin/example.json

Sample code of the JSON file

{
    "type": "NodePoolUpgrade",
    "target": "np1f6779297c4444a3a1cdd29be8e5****"
}

--read-timeout

Specifies the I/O timeout in seconds. Overrides the default I/O timeout in credential settings.

Example: Set the I/O timeout to 20 seconds.

aliyun <product> <ApiName> --read-timeout 20

--connect-timeout

Specifies the connection timeout in seconds. Overrides the default connection timeout in credential settings.

Example: Set the connection timeout to 20 seconds.

aliyun <product> <ApiName> --connect-timeout 20

--retry-count

Specifies the maximum number of retries. Overrides the default retry count in credential settings.

Example: Set the retry count to 5.

aliyun <product> <ApiName> --retry-count 5

--secure

Forces HTTPS for the request. Fails if the API operation does not support HTTPS.

Note

Alibaba Cloud CLI uses HTTPS by default.

--insecure

Forces HTTP for the request. Fails if the API operation does not support HTTP.

--quiet,-q

Suppresses API return results in the output.

--help

Use --help to display help for a command.

Use the help command.

--output,-o

Extracts fields from the OpenAPI response and displays them in a table.

Extract parameters and tabulate output.

--pager

Retrieves all results from a paginated API without manual pagination.

Aggregate the results of paging operations.

--force

Forcibly calls API operations and allows parameters not in the metadata list.

Forcibly call an API operation.

--waiter

Polls API results until a specified field reaches a target value.

Poll the return results.

--dryrun

Simulates an API call and returns the result without performing actual operations on cloud resources.

Simulate a call.