Alibaba Cloud CLI is a command-line tool built on OpenAPI for managing Apsara DevOps services such as Codeup (code management), Flow (pipelines), Packages (artifact management), and more. This quickstart shows you how to install Alibaba Cloud CLI, configure Apsara DevOps credentials, and call Yunxiao OpenAPI operations. The example uses the flow-get-flow-tag-group command to retrieve pipeline tag group details.
Prerequisites
An Alibaba Cloud account
An Apsara DevOps (Yunxiao) organization, Region edition
A Yunxiao personal access token, which you create in the Yunxiao console. For instructions, see Obtain a personal access token.
(Optional) If you are new to Alibaba Cloud CLI, see What is Alibaba Cloud CLI.
Step 1: Install Alibaba Cloud CLI
Install Alibaba Cloud CLI based on your operating system:
Windows: Install CLI on Windows
Linux: Install or update CLI
macOS: Install CLI on macOS
You can also use Cloud Shell to run Alibaba Cloud CLI commands without a local installation. For more information, see What is Cloud Shell.
Step 2: Configure the Yunxiao CLI
The Apsara DevOps identity system differs from other Alibaba Cloud services. Yunxiao does not use profiles (AccessKey pairs) to store credentials. Instead, create a personal access token in the Yunxiao console and pass it through environment variables or command-line parameters, not through aliyun configure.
Obtain a personal access token
You can use a personal access token to access Yunxiao API operations and perform Git operations over HTTP. For more information, see Obtain a personal access token.
When you create a token, select the minimum required API permissions and set a reasonable validity period. Do not create a permanent token.
A token is displayed only when it is first created. You cannot view the token again. Store the token in a safe location.
Do not pass tokens as plain text on the command line. We recommend that you use environment variables.
If a token is leaked, delete it immediately.
Configure credentials
Yunxiao CLI supports two credential configuration methods: environment variables and command-line parameters.
Method 1: Use environment variables (recommended)
Yunxiao CLI uses the following environment variables:
Environment variable | Description | Required (Region edition) |
| Yunxiao personal access token | Yes |
| API endpoint | Yes |
| Organization identifier | No |
Region edition example:
export ALIBABA_CLOUD_YUNXIAO_ACCESS_TOKEN=<your-personal-access-token>
export ALIBABA_CLOUD_YUNXIAO_API_BASE_URL=<your-api-base-url>Method 2: Use command-line parameters
You can also pass credentials as parameters in each command:
Parameter | Description | Required (Region edition) |
| Yunxiao personal access token | Yes |
| API endpoint | Yes |
| Organization identifier | No |
Region edition example:
aliyun devops flow-get-flow-tag-group --id 0 \
--api-base-url=<your-api-base-url> \
--yunxiao-access-token=<your-personal-access-token>Verify your configuration
Run the following command to verify that the Yunxiao CLI plugin is available:
aliyun devops versionIf the command returns version information without errors, your environment is ready.
Step 3: Call API operations
Example 1: List available commands
Run the following command to view all Yunxiao CLI commands:
aliyun devops --helpThe following output is returned (partial):
Description: Aliyun CLI plugin for yunxiao operations.
Usage: aliyun devops <command> [flags]
Available Commands:
app-stack-create-application Create an application
app-stack-list-applications List applications
codeup-create-repository Create a code repository
codeup-list-repositories List code repositories
flow-create-pipeline Create a pipeline
flow-list-pipelines List pipelines
flow-get-flow-tag-group Get pipeline tag group details
projex-search-projects Search projects
projex-search-workitems Search work items
...Yunxiao CLI covers the following modules:
Module prefix | Description |
| AppStack (application delivery) |
| Base (organizations, members, and roles) |
| Codeup (code management) |
| Flow (pipelines) |
| Insight (efficiency analytics) |
| Packages (artifact management) |
| Projex (project collaboration) |
| TestHub (test management) |
On the International site (alibabacloud.com), only Codeup, Flow, and Packages modules are available. Commands with the projex-*, test-hub-*, app-stack-*, and insight-* prefixes are not supported on the International site.
Example 2: Get pipeline tag group details
The following example calls the flow-get-flow-tag-group command to get pipeline tag group details.
# Region edition (environment variables)
export ALIBABA_CLOUD_YUNXIAO_ACCESS_TOKEN=<your-personal-access-token>
export ALIBABA_CLOUD_YUNXIAO_API_BASE_URL=<your-api-base-url>
aliyun devops flow-get-flow-tag-group --id 0Sample response:
{
"id": 0,
"name": "Environment Tags",
"tags": [
{
"id": 1,
"name": "Production",
"color": "#FF6B6B"
},
{
"id": 2,
"name": "Staging",
"color": "#4ECDC4"
}
]
}If an error is returned when you call a Yunxiao OpenAPI operation, check the following common causes:
Invalid or expired token — Verify that your personal access token is valid and has the required permissions.
Incorrect endpoint — Make sure you are using the correct API endpoint for your edition.
Missing required parameters — The Central edition requires
--organization-id. The Region edition requires--api-base-url.
More examples
The following examples show common Yunxiao CLI operations.
List code repositories
aliyun devops codeup-list-repositories --page 1 --per-page 20Search projects
aliyun devops projex-search-projects --page 1 --per-page 10List pipelines
aliyun devops flow-list-pipelines --page 1 --per-page 20List applications
aliyun devops app-stack-list-applications --pagination '{"page":1,"perPage":20}' --order-by createdAtFilter output by using JMESPath
aliyun devops codeup-list-repositories --cli-query 'result[].{name:name,id:id}'