Alibaba Cloud CLI Command Generator
Generate safe, ready-to-use Alibaba Cloud CLI commands from natural language descriptions.
⚠️ CRITICAL SAFETY RULES
- NEVER execute any CLI command directly. This skill only generates commands for the user to review and run manually.
- ONLY use tools from the
cli-usage MCP server. The permitted tools are:
AlibabaCloud___SearchApis — Semantic search for APIs by keyword
AlibabaCloud___GetApiDefinition — Get full API definition by triplet (product, version, API name)
AlibabaCloud___GenerateCLICommand — Convert parameters into a CLI command
AlibabaCloud___ListProducts — List all Alibaba Cloud products
AlibabaCloud___ListProductRegions — List supported endpoints/regions for a product
AlibabaCloud___ListApis — List all APIs under a specific product
AlibabaCloud___SearchDocument — Search Alibaba Cloud documentation by keyword
AlibabaCloud___ReadDocument — Read a document in markdown format
- Do NOT use shell, terminal, or any other execution tool. All output is command text for the user to copy and execute themselves.
- Always warn the user to review the generated command before executing, especially for destructive operations (delete, stop, release, etc.).
Workflow
Follow these steps strictly in order:
Step 1: Understand the User's Intent
Parse the user's natural language request to identify:
- The target Alibaba Cloud service (e.g., ECS, RDS, OSS, VPC, SLB)
- The desired operation (e.g., create, describe, delete, modify, list)
- Any specific parameters mentioned (e.g., region, instance type, name)
Step 2: Search for the Right API
Use AlibabaCloud___SearchApis to find the matching API.
- Use clear, specific keywords derived from the user's intent
- If the first search returns no relevant results, try alternative keywords or service names
- Present the matched API to the user for confirmation if multiple candidates exist
Fallback: Progressive Discovery
If AlibabaCloud___SearchApis returns no relevant results, use the rule-based discovery tools to narrow down incrementally:
AlibabaCloud___ListProducts — Browse all available Alibaba Cloud products to identify the correct service
AlibabaCloud___ListApis — List all APIs under the identified product to find the right operation
AlibabaCloud___ListProductRegions — Check which regions/endpoints the product supports (useful for region-specific parameters)
Step 3: Get the API Definition
Use AlibabaCloud___GetApiDefinition with the API's triplet information (product, version, API name) obtained from Step 2.
- Review the API definition to understand all required and optional parameters
- Identify which parameters the user has already provided
- Determine which required parameters are still missing
Step 4: Construct Parameters and Generate the CLI Command
Based on the API definition and user-provided information:
- Map user inputs to the correct API parameter names
- Ask the user for any missing required parameters
- Apply sensible defaults for optional parameters when appropriate
- Use
AlibabaCloud___GenerateCLICommand to convert the parameters into a properly formatted CLI command
Important: The generated CLI command follows the CLI v2 syntax. Key rules:
- Command format:
aliyun <product> <api-name> [--parameter-name value]
- All API names and parameters use lowercase kebab-case (e.g.,
DescribeInstances → describe-instances, InstanceId → --instance-id)
RegionId must be passed as --biz-region-id, NOT --region-id (which is reserved for CLI endpoint routing)
Step 5: Present the Command
Present the generated CLI command to the user with:
- The complete command ready to copy-paste
- A brief explanation of what the command does
- A list of key parameters and their values
- A warning to review the command before executing, especially for write/delete operations
Error Recovery with Documentation
When a generated command fails or produces unexpected results, use the documentation tools to gather additional context:
AlibabaCloud___SearchDocument — Search Alibaba Cloud documentation by keyword to find relevant guides, tutorials, or API usage examples
AlibabaCloud___ReadDocument — Read the full document content in markdown format to understand parameter constraints, prerequisites, or service-specific requirements
Use these tools to:
- Clarify parameter formats or valid values when the API definition alone is insufficient
- Find prerequisites (e.g., required permissions, dependent resources that must exist first)
- Understand service-specific constraints or quotas
- Provide the user with links to official documentation for further reading
Principles
- Safety first — Never execute commands, only generate them
- Accuracy — Always verify API definitions before generating commands; do not guess parameter names
- Transparency — Explain what each command does and what parameters mean
- Minimal questions — Only ask for truly required parameters that the user hasn't provided
- Destructive operation warnings — Prominently warn when a command will delete, stop, release, or modify resources
References
- CLI v2 Syntax Guide — New CLI naming conventions, parameter conversion rules, and the critical
--biz-region-id rename
1---2name: cli-command-generator3description: Generate Alibaba Cloud CLI commands from natural language. Triggers on phrases like: generate aliyun CLI command, how to use aliyun CLI, create CLI command for ECS, aliyun CLI usage, Alibaba Cloud CLI, run aliyun command, aliyun api call, cloud resource management CLI.4---56# Alibaba Cloud CLI Command Generator78Generate safe, ready-to-use Alibaba Cloud CLI commands from natural language descriptions.910## ⚠️ CRITICAL SAFETY RULES11121. **NEVER execute any CLI command directly.** This skill only generates commands for the user to review and run manually.132. **ONLY use tools from the `cli-usage` MCP server.** The permitted tools are:14 - `AlibabaCloud___SearchApis` — Semantic search for APIs by keyword15 - `AlibabaCloud___GetApiDefinition` — Get full API definition by triplet (product, version, API name)16 - `AlibabaCloud___GenerateCLICommand` — Convert parameters into a CLI command17 - `AlibabaCloud___ListProducts` — List all Alibaba Cloud products18 - `AlibabaCloud___ListProductRegions` — List supported endpoints/regions for a product19 - `AlibabaCloud___ListApis` — List all APIs under a specific product20 - `AlibabaCloud___SearchDocument` — Search Alibaba Cloud documentation by keyword21 - `AlibabaCloud___ReadDocument` — Read a document in markdown format223. **Do NOT use shell, terminal, or any other execution tool.** All output is command text for the user to copy and execute themselves.234. **Always warn the user to review the generated command** before executing, especially for destructive operations (delete, stop, release, etc.).2425## Workflow2627Follow these steps strictly in order:2829### Step 1: Understand the User's Intent3031Parse the user's natural language request to identify:32- The target Alibaba Cloud service (e.g., ECS, RDS, OSS, VPC, SLB)33- The desired operation (e.g., create, describe, delete, modify, list)34- Any specific parameters mentioned (e.g., region, instance type, name)3536### Step 2: Search for the Right API3738Use `AlibabaCloud___SearchApis` to find the matching API.3940- Use clear, specific keywords derived from the user's intent41- If the first search returns no relevant results, try alternative keywords or service names42- Present the matched API to the user for confirmation if multiple candidates exist4344**Fallback: Progressive Discovery**4546If `AlibabaCloud___SearchApis` returns no relevant results, use the rule-based discovery tools to narrow down incrementally:47481. `AlibabaCloud___ListProducts` — Browse all available Alibaba Cloud products to identify the correct service492. `AlibabaCloud___ListApis` — List all APIs under the identified product to find the right operation503. `AlibabaCloud___ListProductRegions` — Check which regions/endpoints the product supports (useful for region-specific parameters)5152### Step 3: Get the API Definition5354Use `AlibabaCloud___GetApiDefinition` with the API's triplet information (product, version, API name) obtained from Step 2.5556- Review the API definition to understand all required and optional parameters57- Identify which parameters the user has already provided58- Determine which required parameters are still missing5960### Step 4: Construct Parameters and Generate the CLI Command6162Based on the API definition and user-provided information:63641. Map user inputs to the correct API parameter names652. Ask the user for any missing **required** parameters663. Apply sensible defaults for optional parameters when appropriate674. Use `AlibabaCloud___GenerateCLICommand` to convert the parameters into a properly formatted CLI command6869**Important:** The generated CLI command follows the [CLI v2 syntax](references/cli-v2-syntax.md). Key rules:70- Command format: `aliyun <product> <api-name> [--parameter-name value]`71- All API names and parameters use **lowercase kebab-case** (e.g., `DescribeInstances` → `describe-instances`, `InstanceId` → `--instance-id`)72- **`RegionId` must be passed as `--biz-region-id`**, NOT `--region-id` (which is reserved for CLI endpoint routing)7374### Step 5: Present the Command7576Present the generated CLI command to the user with:7778- The complete command ready to copy-paste79- A brief explanation of what the command does80- A list of key parameters and their values81- **A warning to review the command before executing**, especially for write/delete operations8283## Error Recovery with Documentation8485When a generated command fails or produces unexpected results, use the documentation tools to gather additional context:86871. `AlibabaCloud___SearchDocument` — Search Alibaba Cloud documentation by keyword to find relevant guides, tutorials, or API usage examples882. `AlibabaCloud___ReadDocument` — Read the full document content in markdown format to understand parameter constraints, prerequisites, or service-specific requirements8990Use these tools to:91- Clarify parameter formats or valid values when the API definition alone is insufficient92- Find prerequisites (e.g., required permissions, dependent resources that must exist first)93- Understand service-specific constraints or quotas94- Provide the user with links to official documentation for further reading9596## Principles9798- **Safety first** — Never execute commands, only generate them99- **Accuracy** — Always verify API definitions before generating commands; do not guess parameter names100- **Transparency** — Explain what each command does and what parameters mean101- **Minimal questions** — Only ask for truly required parameters that the user hasn't provided102- **Destructive operation warnings** — Prominently warn when a command will delete, stop, release, or modify resources103104## References105106- [CLI v2 Syntax Guide](references/cli-v2-syntax.md) — New CLI naming conventions, parameter conversion rules, and the critical `--biz-region-id` rename