The Alibaba Cloud CLI supports configuring credentials, region, behavior options, and other runtime parameters using environment variables. In CI/CD pipelines, container environments, or automation scripts, environment variables are the preferred method for passing credentials and runtime configuration. This topic lists all supported environment variables and explains their priority order to help you quickly locate the required configuration items.
Priority order
When reading configuration, the Alibaba Cloud CLI applies settings in the following priority order, from highest to lowest:
Command-line parameters (such as
--profileand--region)Configuration file (
~/.aliyun/config.json)Environment variables
For more information, see Understand command-line parameters.
Credentials and identity
Use environment variables to configure credential information such as AccessKey, Security Token Service (STS) token, OpenID Connect (OIDC), and RAM roles without storing secrets in plaintext in configuration files.
Environment variable | Description |
| AccessKey ID. |
| AccessKey secret. |
| STS temporary security token. Use together with AccessKey ID and AccessKey secret. |
| Credential service endpoint for CredentialsURI mode. No alias available. |
| ARN (Alibaba Cloud Resource Name) of the OIDC identity provider. |
| Path to the OIDC token file. |
| RAM role ARN, used with RamRoleArn and ChainableRamRoleArn authentication modes. |
| External ID, used in cross-account role assumption scenarios. |
| Cloud SSO OIDC client ID. When set, it overrides the default client ID built into the CLI. |
For configuration methods and applicable scenarios for each credential type, see Configure credentials.
Profile selection
Control which profile the CLI uses.
Environment variable | Description |
| Specifies the profile name to use. Equivalent to the |
| When set to |
Region and endpoint
Environment variable | Description |
| Default region ID, such as |
| Custom API endpoint address. When set, the CLI sends requests directly to this address and skips automatic endpoint resolution. |
| Endpoint type. For example, set to |
Plugin management
Control plugin auto-installation behavior, storage location, and download source.
Environment variable | Description |
| When set to |
| When set to |
| Custom plugin installation directory. Default is |
| When set to |
| Base URL for a custom plugin download source. Useful in private network environments or private image scenarios. |
Network, timeout, and language
The CLI automatically passes the following settings from the current profile to plugin child processes. To adjust timeout and retry policy, use the aliyun configure command or edit the configuration file directly.
Environment variable | Description |
| I/O read timeout, in seconds. |
| Connection timeout, in seconds. |
| Number of retries on request failure. |
| CLI language setting. Valid values are |