Plugin Management for Alibaba Cloud CLI
Cloud product API commands are built into Alibaba Cloud CLI and available immediately after installation, with no separate plugin install required. Update a plugin only when a product API has been updated but your CLI has not yet incorporated the changes and you need timely access to the latest API. This topic covers plugin inspection, installation, updates, uninstallation, and configuration.
Prerequisites
You have installed Alibaba Cloud CLI 3.3.0 or later. For installation instructions, see Install, update, and uninstall Alibaba Cloud CLI.
You have configured credentials for Alibaba Cloud CLI. For instructions, see Configure and manage credentials.
Plugin overview
Plugins can be installed, updated, and uninstalled independently.
Plugins are stored in ~/.aliyun/plugins and tracked in manifest.json.
After you install a product plugin, the product's help may switch to the commands provided by the plugin, whose operation names and parameter names use kebab-case (for example, describe-instances and --biz-region-id); calling the same API in an existing form such as DescribeInstances is unaffected. If you have already configured a safety policy, an exact rule matches only the actual command spelling, so a rule configured for one spelling does not block another. To protect high-risk operations, use a wildcard rule (such as *:Delete*) or configure rules for both spellings separately. For more information, see Safety policy.
Plugin naming convention
Plugins follow the naming format aliyun-cli-<ProductCode>, where the product code matches Alibaba Cloud OpenAPI:
Name | Product code | Cloud product |
|
| Elastic Compute Service (ECS) |
|
| Function Compute (FC) |
|
| ApsaraDB RDS |
You can use either the full name (aliyun-cli-ecs) or product code (ecs). Names are case-insensitive.
Install plugins
Check whether a product is supported by the CLI
Use the following methods to check which products and commands are supported by your CLI version:
Online query (recommended): Browse by category, search by keyword, and view command examples in the CLI Center.
Command-line query: Run
aliyun --help-allto view supported cloud products. Runaliyun ecs --help-allto view supported ECS commands.aliyun --help-all aliyun ecs --help-allRemote plugin index: Run
aliyun plugin list-remoteto view the remote plugin index. This command is for plugin management, not for deciding whether routine API calls require plugin installation.aliyun plugin list-remote
Search for a plugin
Find which plugin provides a specific command. Prefix matching is supported.
# Search for plugins containing "ecs"
aliyun plugin search ecs
# Search for commands in the ecs plugin that start with "describe"
aliyun plugin search "ecs describe"Plugins follow Semantic Versioning (SemVer):
0.x.x versions are experimental with no compatibility guarantee.
1.0.0+ versions are stable within the same major version. Major version bumps may introduce breaking changes.
The remote index is cached for one hour. To force a refresh, set
ALIBABA_CLOUD_CLI_PLUGIN_NO_CACHE=true.
Install a plugin
aliyun plugin install uses --name to specify a single plugin name. Use --names for batch installation and --package to install from a local archive or URL. See the following table for all flags.
Flag | Description |
| Install a single plugin by name. Available since v3.3.14. Mutually exclusive with |
| Install one or more plugins by name, separated by spaces. Mutually exclusive with |
| Specify the version to install. Only works with |
| Allow installation of pre-release versions. |
| Install from a local archive file ( |
| Use a custom plugin source URL for this command. Overrides the environment variable and configuration file settings. |
Examples:
# Install a single plugin by name
aliyun plugin install --name ecs
# Install a specific version
aliyun plugin install --name fc --version 1.0.0
# Install multiple plugins at once
aliyun plugin install --names ecs rds vpc
# Install from a local archive file (for offline environments)
aliyun plugin install --package /path/to/ecs-plugin.zip
# Install from a URL
aliyun plugin install --package https://example.com/plugins/ecs-plugin.tar.gzVerify with aliyun plugin list:
Name Version Trust Index Version Description
---- ------- ----- ------------- -----------
aliyun-cli-ecs 0.9.4 unverified - Aliyun CLI plugin for Elastic Compute Service operations.
aliyun-cli-ims 0.9.0 unverified - Aliyun CLI plugin for RAM Identity Management Service operations.
aliyun-cli-ram 0.9.0 unverified - Aliyun CLI plugin for Resource Access Management operations.The CLI auto-detects OS and architecture (darwin-arm64, linux-amd64) and downloads the matching package. In batch installs, one failure does not block others. Plugins requiring a newer CLI version prompt you to upgrade.
View plugin details
Run aliyun plugin list to list installed plugins. To view details of a specific plugin, run:
aliyun plugin show --name ecsExample output:
Name: aliyun-cli-ecs
Version: 0.9.4
Type: meta
Product code: Ecs
Command: aliyun-cli-ecs
Path: ~/.aliyun/plugins/aliyun-cli-ecs
Minimum CLI version: 3.5.0
Metadata format: protobuf
Short description: Aliyun Ecs Plugin
Description: Aliyun CLI plugin for Elastic Compute Service operations.
API default: 2014-05-26
API supported: 2014-05-26
Trust: unverifiedThe output includes the plugin name, current version, installation path, and supported API versions.
Update and uninstall plugins
Update a plugin
If a product API has been updated but your CLI version has not yet incorporated the changes and you need timely access, update the corresponding plugin. For example, update the ECS plugin:
aliyun plugin update --name ecsUpdating a single plugin does not change your configured credentials or built-in commands.
Update all installed plugins:
aliyun plugin updateIf already at the latest version, the CLI reports no update needed. Add --enable-pre for pre-release versions.
Verify with aliyun plugin list.
Uninstall a plugin
Remove a plugin:
aliyun plugin uninstall --name ecsVerify removal with aliyun plugin list.
Configure automatic installation
The following settings control automatic plugin installation. You do not need to enable automatic plugin installation for routine cloud product API calls.
Enable automatic installation
Enable via command:
aliyun configure set --auto-plugin-install trueOr with an environment variable:
echo 'export ALIBABA_CLOUD_CLI_PLUGIN_AUTO_INSTALL=true' >> ~/.bashrc
source ~/.bashrcVerify with aliyun configure get.
Allow pre-release auto-installation:
aliyun configure set --auto-plugin-install-enable-pre trueOr with an environment variable:
echo 'export ALIBABA_CLOUD_CLI_PLUGIN_AUTO_INSTALL_ENABLE_PRE=true' >> ~/.bashrc
source ~/.bashrcPlugin global settings
Use aliyun configure plugin-settings to set a custom plugin source for restricted networks or centralized URL management. Settings are stored in ~/.aliyun/plugin-settings.json.
View current settings
View current settings:
aliyun configure plugin-settings showSet a custom plugin source
Set a custom source URL:
aliyun configure plugin-settings set --source-base https://internal-mirror.example.com/cli-pluginsVerify:
aliyun configure plugin-settings showClear custom settings
Clear custom settings and restore defaults:
aliyun configure plugin-settings clearSource URL priority
The CLI resolves the source URL in this order (first match wins):
The
--source-baseflag on the current command.The
ALIBABA_CLOUD_CLI_PLUGIN_SOURCE_BASEenvironment variable.The
source-basevalue in~/.aliyun/plugin-settings.json.The built-in default URL.
Plugin settings are stored in
~/.aliyun/plugin-settings.json.The
plugin-settingssubcommands belong toaliyun configure, notaliyun plugin.
Appendix
Plugin command list
Command | Description |
| Lists installed plugins. |
| Shows details of an installed plugin. |
| Lists the remote plugin index. |
| Searches for the plugin that corresponds to a command. |
| Installs one or more plugins. |
| Updates a plugin. |
| Uninstalls a plugin. |
| Displays plugin system settings. |
| Sets the plugin source base URL. |
| Removes the custom source base URL and reverts to the built-in default. |
Plugin environment variables
Environment variables for plugin behavior:
Environment variable | Description |
| Custom plugin directory. Default: |
| Set to |
| Set to |
| Set to |
| Custom plugin source URL. Equivalent to |
| Default API version for a product. Example: |
| Maximum line length for help output. |
FAQ
Installation fails: "no stable version available"
The plugin has only pre-release versions. Add --enable-pre:
aliyun plugin install --name <plugin-name> --enable-pre