Guide for Alibaba Cloud CLI (aliyun) command syntax, plugin system, parameter naming, and best practices. Use this skill to generate correct CLI commands, understand plugin vs built-in command differences, structured parameter syntax, output filtering, pagination, and error troubleshooting. This skill is a CLI knowledge reference — when MCP tools (AlibabaCloud___CallCLI, etc.) are available, always prefer MCP tools for execution rather than running aliyun commands locally in the shell.
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Um comando direto ignora o prompt de revisão. Verifique a origem antes de executá-lo.
Instruções da origem · Visualização somente leitura
name
alibabacloud-cli-guidance
description
Guide for Alibaba Cloud CLI (aliyun) command syntax, plugin system, parameter naming, and best practices. Use this skill to generate correct CLI commands, understand plugin vs built-in command differences, structured parameter syntax, output filtering, pagination, and error troubleshooting. This skill is a CLI knowledge reference — when MCP tools (AlibabaCloud___CallCLI, etc.) are available, always prefer MCP tools for execution rather than running aliyun commands locally in the shell.
Guide for managing Alibaba Cloud resources using the aliyun command-line tool.
MCP Tools vs Local CLI Execution
IMPORTANT: This skill provides CLI command knowledge and syntax guidance. It does
NOT mean you should always run aliyun commands locally in the shell.
Execution priority:
MCP tools (highest priority) — When AlibabaCloud___CallCLI and other MCP tools
are available, always use them for API execution. MCP tools handle authentication,
cross-account access (x_assume_account_id), and output filtering (x_output_jmespath_filter)
without requiring local CLI installation or configuration.
Local CLI (fallback) — Only use local aliyun commands in the Bash tool when:
MCP tools are not available or not configured
The operation requires local file system access (e.g., aliyun oss cp, aliyun ossutil sync)
The user explicitly asks for a local CLI command to copy/paste or use in scripts
The user needs to install/configure the CLI itself
Use this skill's knowledge for:
Understanding correct command syntax when calling AlibabaCloud___CallCLI
Generating CLI commands via AlibabaCloud___GenerateCLICommand
Knowing the difference between plugin-style and built-in-style commands
Troubleshooting CLI errors returned by MCP or local execution
Guiding users who want to run commands locally in their own terminals
Pivot to alibabacloud-find-skills when: the user's request reads as a
solution pattern (batch ops, audits, rotations, scheduled cleanup, runbooks)
or targets a product not covered by any in-plugin skill — a packaged official
skill usually beats hand-rolled CLI sequences. See mcp-core-best-practices
→ Skill Discovery for the full trigger list.
Agent Execution: AI-mode and User-Agent
Only applicable when running aliyun commands locally (not via MCP tools).
Use exactly one way to attach this skill to requests. Do not combine AI-mode
(configure ai-mode + set-user-agent) with ALIBABA_CLOUD_USER_AGENT or a per-command
env prefix for the same skill token — the CLI stacks those sources, and
User-Agent / attribution will duplicate (bad for telemetry).
[MUST]aliyun configure ai-mode disable before the final response on every exit (success, failure, error, cancel, session end). Do notexport ALIBABA_CLOUD_USER_AGENT to the same value while AI-mode is on.
B — Environment or one-shot
One-off commands, scripts without configure, or no AI-mode
export ALIBABA_CLOUD_USER_AGENT=AlibabaCloud-Agent-Skills/alibabacloud-cli-guidance for the session, or prefix each API call: ALIBABA_CLOUD_USER_AGENT=AlibabaCloud-Agent-Skills/alibabacloud-cli-guidance aliyun ...
If you used export, run unset ALIBABA_CLOUD_USER_AGENT when done so other skills are not mis-attributed. Inline prefix needs no unset. Do not enable AI-mode on path B for the same skill string.
Pre-check: Aliyun CLI >= 3.3.3 required — Run aliyun version. If too low:
curl -fsSL https://aliyuncli.alicdn.com/setup.sh | bash or see references/installation-guide.md.
Baseline for product plugins and flows in this skill.
>= 3.3.5
aliyun upgrade — update the CLI from the binary itself.
>= 3.3.8
aliyun plugin show --name <plugin> — details for an installed plugin.
Instructions
1. Install and Configure the CLI
If the user hasn't installed or configured the CLI, guide them through setup.
See ./references/installation-guide.md for full details. Quick path:
# Install or update (macOS / Linux — one command)
/bin/bash -c "$(curl -fsSL --connect-timeout 10 --max-time 120 https://aliyuncli.alicdn.com/setup.sh)"
After the CLI is at 3.3.5 or newer, routine self-updates can use aliyun upgrade.
OAuth (browser login)
When a browser can be opened on the same machine, prefer OAuth over storing
AccessKey pairs. Requires CLI 3.0.299 or later. Not suitable for headless environments.
Note for MCP tools: AlibabaCloud___CallCLI uses OpenAPI-style (PascalCase) commands.
The plugin-style commands are for local CLI execution. When generating commands for MCP
execution, use PascalCase subcommands (e.g., aliyun ecs DescribeInstances).
Aspect
Plugin (CLI Native)
Built-in (OpenAPI)
Subcommand
describe-instances
DescribeInstances
Parameters
kebab-case (consistent)
Mixed (inconsistent)
ROA Body
Expanded to individual params
Single --body JSON
Header params
Visible in help, usable directly
Hidden, manual --header only
Help
Comprehensive with structure
Basic
5. Understand Global vs Business Parameter Naming
The CLI plugin system reserves certain global parameters:
--region-id / --region — controls which API endpoint the request is sent to.
Other globals: --profile, --api-version, --output, etc.
Many APIs also define their own RegionId parameter. The plugin resolves this with: