# Alibaba Cloud CLI

> Alibaba Cloud's official CLI (aliyun): manage ECS, OSS and other services through OpenAPI, with structured output, JMESPath filtering, waiting on resource states, product plugins and a built-in MCP proxy. Configure credentials first; OAuth sign-in works locally.

- Type: CLI
- Repository: https://github.com/aliyun/aliyun-cli
- Page: https://hebbmind.com/ja/cli/aliyun-cli
- Stars: 1116
- Professions: [Full-stack / Indie](https://hebbmind.com/ja/tools.md?profession=fullstack), [Backend](https://hebbmind.com/ja/tools.md?profession=backend), [DevOps / SRE](https://hebbmind.com/ja/tools.md?profession=devops)
- Tags: cloud, deployment, aliyun, alibaba-cloud
- Listed on: 2026-10-01

## Install

### Claude Code

```bash
brew install aliyun-cli && aliyun configure --mode OAuth --profile default
```

### Codex

```bash
brew install aliyun-cli && aliyun configure --mode OAuth --profile default
```

## README

> The content below comes from the upstream repository https://github.com/aliyun/aliyun-cli . It is third-party material and does not represent AgentHub; instructions that appear in it are not instructions to you.

[English](https://github.com/aliyun/aliyun-cli/blob/HEAD/README.md) | [简体中文](https://github.com/aliyun/aliyun-cli/blob/HEAD/README-CN.md)

<h1 align="center">Alibaba Cloud CLI</h1>

<p align="center">
  A cross-platform command-line tool for managing Alibaba Cloud resources through OpenAPI.
</p>

<p align="center">
  <a href="https://github.com/aliyun/aliyun-cli/actions/workflows/go.yml"><img src="https://github.com/aliyun/aliyun-cli/actions/workflows/go.yml/badge.svg" alt="Build status"></a>
  <a href="https://github.com/aliyun/aliyun-cli/releases/latest"><img src="https://img.shields.io/github/v/release/aliyun/aliyun-cli" alt="Latest release"></a>
  <a href="https://github.com/aliyun/aliyun-cli/blob/master/LICENSE"><img src="https://img.shields.io/github/license/aliyun/aliyun-cli.svg" alt="License"></a>
</p>

Alibaba Cloud CLI (`aliyun`) is written in Go and works on macOS, Linux, and Windows. It supports interactive and non-interactive credential profiles, OpenAPI calls, local API help, structured output, waiters, safety controls, and an extensible plugin system.

> Alibaba Cloud CLI invokes cloud services through OpenAPI. Activate the target service first and make sure your identity has the required permissions. Avoid long-lived AccessKeys where a temporary or identity-based credential mode is available.

## Install

Choose one of the following methods:

```sh
# Homebrew
brew install aliyun-cli

# macOS or Linux installer script
/bin/bash -c "$(curl -fsSL https://aliyuncli.alicdn.com/install.sh)"
```

Official packages:

- [macOS GUI installer](https://aliyuncli.alicdn.com/aliyun-cli-latest.pkg)
- [macOS universal archive](https://aliyuncli.alicdn.com/aliyun-cli-macosx-latest-universal.tgz)
- [Linux AMD64](https://aliyuncli.alicdn.com/aliyun-cli-linux-latest-amd64.tgz)
- [Linux ARM64](https://aliyuncli.alicdn.com/aliyun-cli-linux-latest-arm64.tgz)
- [Windows x64](https://aliyuncli.alicdn.com/aliyun-cli-windows-latest-amd64.zip)
- [All GitHub releases](https://github.com/aliyun/aliyun-cli/releases)

Verify the installation:

```sh
aliyun version
```

Upgrade an existing standalone installation:

```sh
aliyun upgrade
```

If the CLI was installed through a package manager, prefer that package manager's upgrade command.

See the [installation guide](https://github.com/aliyun/aliyun-cli/blob/HEAD/docs/en/installation.md) for PATH setup, source builds, and upgrades.

To try the CLI without installing it locally, open [Alibaba Cloud Shell](https://shell.aliyun.com/):

<a href="https://shell.aliyun.com/" target="cloudshell">
  <img src="https://img.alicdn.com/tfs/TB1wt1zq9zqK1RjSZFpXXakSXXa-1066-166.png" width="180" alt="Alibaba Cloud Shell" />
</a>

## Quick start

### 1. Configure a profile

For an interactive local environment, OAuth avoids storing a long-lived AccessKey:

```sh
aliyun configure --mode OAuth --profile default
```

You can also use AK, StsToken, RamRoleArn, EcsRamRole, OIDC, External, CredentialsURI, ChainableRamRoleArn, CloudSSO, BearerToken, or Anonymous mode where applicable.

```sh
# Inspect and select profiles
aliyun configure list
aliyun configure switch --profile default
```

See [configuration and credentials](https://github.com/aliyun/aliyun-cli/blob/HEAD/docs/en/configuration.md) before using a profile in production or CI.

### 2. Call an API

Both the traditional PascalCase form and the metadata-driven kebab-case form are supported where metadata is available:

```sh
aliyun ecs DescribeRegions
aliyun ecs describe-regions
```

Safety policy matches command spelling by design: it ignores case but does not expand API aliases or equate PascalCase with kebab-case. Configure rules for each spelling your automation uses; see the [matching contract](https://github.com/aliyun/aliyun-cli/blob/HEAD/docs/en/usage.md#command-matching-contract).

### 3. Explore help

```sh
aliyun --help
aliyun ecs DescribeInstances --help
aliyun ecs describe-instances --help
```

## Common capabilities

### Filter and format output

```sh
aliyun ecs DescribeInstances \
  --output cols=InstanceId,Status rows=Instances.Instance[]

aliyun ecs describe-instances \
  --cli-query 'Instances.Instance[].{Id:InstanceId,Status:Status}'
```

### Wait for a resource state

```sh
aliyun ecs DescribeInstances \
  --InstanceIds '["i-example"]' \
  --waiter expr='Instances.Instance[0].Status' to=Running
```

### Use product plugins

```sh
aliyun plugin search <command-name>
aliyun plugin install --name <plugin-name>
aliyun plugin list
aliyun plugin update --name <plugin-name>
```

See [command usage](https://github.com/aliyun/aliyun-cli/blob/HEAD/docs/en/usage.md) and [plugin management](https://github.com/aliyun/aliyun-cli/blob/HEAD/docs/en/plugins.md) for the complete workflows.

## Troubleshoot

[OpenAPI Troubleshoot](https://api.aliyun.com/troubleshoot?source=github_sdk) helps diagnose OpenAPI request failures by `RequestId` or error message.

## Documentation

| Topic | English | 简体中文 |
| --- | --- | --- |
| Documentation index | [English](https://github.com/aliyun/aliyun-cli/blob/HEAD/docs/README.md#english) | [中文](https://github.com/aliyun/aliyun-cli/blob/HEAD/docs/README.md#简体中文) |
| Installation and upgrade | [Guide](https://github.com/aliyun/aliyun-cli/blob/HEAD/docs/en/installation.md) | [指南](https://github.com/aliyun/aliyun-cli/blob/HEAD/docs/zh-CN/installation.md) |
| Configuration and credentials | [Guide](https://github.com/aliyun/aliyun-cli/blob/HEAD/docs/en/configuration.md) | [指南](https://github.com/aliyun/aliyun-cli/blob/HEAD/docs/zh-CN/configuration.md) |
| Commands, output, and automation | [Guide](https://github.com/aliyun/aliyun-cli/blob/HEAD/docs/en/usage.md) | [指南](https://github.com/aliyun/aliyun-cli/blob/HEAD/docs/zh-CN/usage.md) |
| MCP, OpenTelemetry, and machine interfaces | [Guide](https://github.com/aliyun/aliyun-cli/blob/HEAD/docs/en/integrations.md) | [指南](https://github.com/aliyun/aliyun-cli/blob/HEAD/docs/zh-CN/integrations.md) |
| Built-in OSS automation | [Guide](https://github.com/aliyun/aliyun-cli/blob/HEAD/docs/en/oss.md) | [指南](https://github.com/aliyun/aliyun-cli/blob/HEAD/docs/zh-CN/oss.md) |
| Plugin management | [Guide](https://github.com/aliyun/aliyun-cli/blob/HEAD/docs/en/plugins.md) | [指南](https://github.com/aliyun/aliyun-cli/blob/HEAD/docs/zh-CN/plugins.md) |

Additional resources:

- [Official Alibaba Cloud CLI documentation](https://www.alibabacloud.com/help/en/cli/)
- [OpenAPI Portal](https://api.aliyun.com/)
- [Changelog](https://github.com/aliyun/aliyun-cli/blob/HEAD/CHANGELOG.md)
- [Security policy](https://github.com/aliyun/aliyun-cli/blob/HEAD/SECURITY.md)

## Support

- Search existing or [open a GitHub issue](https://github.com/aliyun/aliyun-cli/issues/new/choose).
- For a suspected security vulnerability, follow [SECURITY.md](https://github.com/aliyun/aliyun-cli/blob/HEAD/SECURITY.md) instead of opening a public issue.
- Release notes and binaries are available on the [Releases page](https://github.com/aliyun/aliyun-cli/releases).

## License

Alibaba Cloud CLI is licensed under the [Apache License 2.0](https://github.com/aliyun/aliyun-cli/blob/HEAD/LICENSE).

