Plugin Management for Alibaba Cloud CLI

Updated at:
Copy as MD

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

  1. You have installed Alibaba Cloud CLI 3.3.0 or later. For installation instructions, see Install, update, and uninstall Alibaba Cloud CLI.

  2. 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.

Warning

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

aliyun-cli-ecs

ecs

Elastic Compute Service (ECS)

aliyun-cli-fc

fc

Function Compute (FC)

aliyun-cli-rds

rds

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-all to view supported cloud products. Run aliyun ecs --help-all to view supported ECS commands.

    aliyun --help-all
    aliyun ecs --help-all
    • Remote plugin index: Run aliyun plugin list-remote to 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"
Note
  • 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

--name <name>

Install a single plugin by name. Available since v3.3.14. Mutually exclusive with --names and --package.

--names <name1> <name2> ...

Install one or more plugins by name, separated by spaces. Mutually exclusive with --name and --package.

--version <version>

Specify the version to install. Only works with --name. If not specified, the latest stable version is installed.

--enable-pre

Allow installation of pre-release versions.

--package <path-or-url>

Install from a local archive file (.zip, .tar.gz, .tgz) or a URL that points to an archive. Mutually exclusive with --name and --names.

--source-base <url>

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.gz

Verify 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.
Note

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 ecs

Example 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:                unverified

The 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 ecs

Updating a single plugin does not change your configured credentials or built-in commands.

Update all installed plugins:

aliyun plugin update

If 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 ecs

Verify 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 true

Or with an environment variable:

echo 'export ALIBABA_CLOUD_CLI_PLUGIN_AUTO_INSTALL=true' >> ~/.bashrc
source ~/.bashrc

Verify with aliyun configure get.

Allow pre-release auto-installation:

aliyun configure set --auto-plugin-install-enable-pre true

Or with an environment variable:

echo 'export ALIBABA_CLOUD_CLI_PLUGIN_AUTO_INSTALL_ENABLE_PRE=true' >> ~/.bashrc
source ~/.bashrc

Plugin 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 show

Set a custom plugin source

Set a custom source URL:

aliyun configure plugin-settings set --source-base https://internal-mirror.example.com/cli-plugins

Verify:

aliyun configure plugin-settings show

Clear custom settings

Clear custom settings and restore defaults:

aliyun configure plugin-settings clear

Source URL priority

The CLI resolves the source URL in this order (first match wins):

  1. The --source-base flag on the current command.

  2. The ALIBABA_CLOUD_CLI_PLUGIN_SOURCE_BASE environment variable.

  3. The source-base value in ~/.aliyun/plugin-settings.json.

  4. The built-in default URL.

Note
  • Plugin settings are stored in ~/.aliyun/plugin-settings.json.

  • The plugin-settings subcommands belong to aliyun configure, not aliyun plugin.

Appendix

Plugin command list

Command

Description

aliyun plugin list

Lists installed plugins.

aliyun plugin show --name <name>

Shows details of an installed plugin.

aliyun plugin list-remote

Lists the remote plugin index.

aliyun plugin search <command-name>

Searches for the plugin that corresponds to a command.

aliyun plugin install (--name <name> | --names <name1> [<name2> ...] | --package <path-or-url>) [--version <version>] [--enable-pre] [--source-base <url>]

Installs one or more plugins.

aliyun plugin update [--name <name>] [--enable-pre] [--source-base <url>]

Updates a plugin.

aliyun plugin uninstall --name <name>

Uninstalls a plugin.

aliyun configure plugin-settings show

Displays plugin system settings.

aliyun configure plugin-settings set --source-base <url>

Sets the plugin source base URL.

aliyun configure plugin-settings clear

Removes the custom source base URL and reverts to the built-in default.

Plugin environment variables

Environment variables for plugin behavior:

Environment variable

Description

ALIBABA_CLOUD_CLI_PLUGINS_DIR

Custom plugin directory. Default: ~/.aliyun/plugins.

ALIBABA_CLOUD_CLI_PLUGIN_NO_CACHE

Set to true to disable remote index caching.

ALIBABA_CLOUD_CLI_PLUGIN_AUTO_INSTALL

Set to true to enable automatic plugin installation. Routine cloud product API calls do not require this setting.

ALIBABA_CLOUD_CLI_PLUGIN_AUTO_INSTALL_ENABLE_PRE

Set to true to allow automatic installation of pre-release versions.

ALIBABA_CLOUD_CLI_PLUGIN_SOURCE_BASE

Custom plugin source URL. Equivalent to --source-base on plugin install and plugin update commands. Can also be set through aliyun configure plugin-settings set.

ALIBABA_CLOUD_<PRODUCT_CODE>_API_VERSION

Default API version for a product. Example: ALIBABA_CLOUD_ESS_API_VERSION=2022-02-22.

ALIBABA_CLOUD_CLI_MAX_LINE_LENGTH

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