← 返回
未分类 Key

Aliyun Skills

Manage Alibaba Cloud resources using the Aliyun CLI tool. Use this skill whenever the user wants to manage any Alibaba Cloud resource via the aliyun CLI, inc...
使用阿里云CLI工具管理阿里云资源。当用户需要通过aliyun CLI管理任何阿里云资源时,使用此技能。
hambaobao hambaobao 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 需要
★ 0
Stars
📥 455
下载
💾 3
安装
1
版本
#latest

概述

Aliyun CLI Skill

This skill teaches you how to use the Aliyun CLI to manage

Alibaba Cloud resources. You will construct and explain aliyun commands, interpret their output,

and guide users through cloud resource management tasks.

Quick Reference

ResourceReference FileCommon Operations
--------------------------------------------
Setup & Authreferences/setup.mdinstall, configure, switch profiles
ECS (Elastic Compute Service)references/ecs.mdlist, start/stop/reboot, resize disk, create snapshot
VPC (Virtual Private Cloud)references/vpc.mdmanage VPCs, VSwitches, EIPs, NAT gateways, route tables
OSS (Object Storage Service)references/oss.mdbuckets, upload/download, sync, presigned URLs
RDS (Relational Database Service)references/rds.mdinstances, databases, accounts, backups, IP whitelist
SLB / CLB (Load Balancer)references/slb.mdcreate LB, manage listeners, add/remove backend servers
RAM (Resource Access Management)references/ram.mdusers, groups, roles, policies, access keys
DNS (AliDNS)references/dns.mdlist domains, add/update/delete records
ACR (Container Registry)references/acr.mdinstances, namespaces, repositories, image tags, docker login

Read the relevant reference file before responding to a request.

CLI Syntax Pattern

Every aliyun command follows this structure:

aliyun <Product> <Operation> [--Parameter Value ...]
  • Product: service name in PascalCase or lowercase (e.g., ecs, oss, vpc, rds, ram)
  • Operation: API action name in PascalCase (e.g., DescribeInstances, StartInstance)
  • Parameters: prefixed with -- (e.g., --RegionId cn-hangzhou, --InstanceId i-xxxx)

OSS is an exception — it uses a subcommand style like aliyun oss ls, aliyun oss cp.

Always Check These First

Before constructing any command:

  1. Region — Most operations require --RegionId. Common regions:
    • cn-hangzhou (Hangzhou), cn-beijing (Beijing), cn-shanghai (Shanghai)
    • cn-shenzhen (Shenzhen), ap-southeast-1 (Singapore), us-west-1 (US West)
    • If the user hasn't specified a region, ask or use aliyun configure get to find the default.
  1. Resource IDs — Most mutating operations (start, stop, delete) need a specific resource ID.

If the user hasn't provided one, first run a Describe/List command to find it.

  1. Pagination — Describe* APIs return paginated results. Default page size is typically 10.

Use --PageSize 100 and --PageNumber to retrieve more. Mention this if results seem incomplete.

  1. Dry run — Aliyun CLI does not have a universal dry-run flag. For destructive operations,

always confirm resource IDs with the user before executing.

Output Formats

The CLI supports multiple output formats via the --output flag:

  • Default: JSON (structured, good for parsing)
  • --output cols=, — tabular output for quick scanning
  • --output table — aligned table

For human-readable summaries, use --output cols=InstanceId,InstanceName,Status style where available.

zsh gotcha: If you use rows=Instances.Instance[], the [] will be interpreted as a glob by zsh

and cause a "no matches found" error. Quote the argument to avoid this:

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

Or simply omit rows= and use the default JSON output when tabular formatting isn't critical.

Common Workflow Pattern

When the user asks to perform an operation on a named resource (e.g., "restart my server called web-prod"):

  1. Discover — Run a Describe command to find the resource ID

```bash

aliyun ecs DescribeInstances --RegionId cn-hangzhou

```

  1. Confirm — Show the result and confirm the target with the user if there's any ambiguity
  2. Act — Run the mutating command with the confirmed resource ID
  3. Verify — Optionally run another Describe to confirm the new state

Error Handling

Common errors and what to do:

ErrorCauseSolution
------------------------
InvalidAccessKeyIdWrong or expired credentialsRun aliyun configure to reconfigure
Forbidden.RAMInsufficient RAM permissionsCheck RAM policy for required action
IncorrectInstanceStatusWrong instance state for operationDescribe instance status first
InvalidRegionIdUnsupported region for this productCheck product availability in that region
ThrottlingAPI rate limit hitAdd a brief delay and retry

If the user has not yet installed or configured the CLI, read references/setup.md and guide them

through it before attempting any commands.

Safety Guidelines

  • For destructive operations (delete instance, release EIP, drop RDS database), always:
  1. Show the user what will be deleted with a Describe command first
  2. Explicitly ask for confirmation before running the delete command
    • For cost-incurring operations (create ECS, purchase bandwidth), mention the cost implications
    • Never expose or log AccessKey secrets — remind users to use RAM roles or environment variables

instead of hardcoding credentials

Parallelism

When the user needs to operate on multiple resources (e.g., "list all instances in all regions"),

you can run several commands and combine the results. For shell loops:

for region in cn-hangzhou cn-beijing cn-shanghai cn-shenzhen ap-southeast-1; do
  echo "=== $region ==="
  aliyun ecs DescribeInstances --RegionId $region
done

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-31 08:16 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

it-ops-security

OpenClaw Backup

alex3alex
备份与恢复 OpenClaw 数据。适用于创建备份、设置自动备份计划、从备份恢复或管理备份轮转。处理 ~/.openclaw 目录归档并包含适当的排除规则。
★ 90 📥 30,931
it-ops-security

Tmux

steipete
通过发送按键和抓取窗格输出,远程控制交互式 CLI 的 tmux 会话。
★ 46 📥 29,525
it-ops-security

1password

steipete
设置和使用 1Password CLI (op)。适用于:安装 CLI、启用桌面应用集成、登录(单/多账户)、通过 op 读取/注入/运行密钥。
★ 53 📥 31,623