aliyun-cli

阿里云 CLI 操作

16 stars

Best use case

aliyun-cli is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

阿里云 CLI 操作

Teams using aliyun-cli should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/aliyun-cli/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/cli-automation/aliyun-cli/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/aliyun-cli/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How aliyun-cli Compares

Feature / Agentaliyun-cliStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

阿里云 CLI 操作

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# 阿里云 CLI 操作

## 概述
阿里云 ECS、OSS、RDS 等服务的命令行操作技能。

## 配置与认证

```bash
# 配置凭证
aliyun configure
aliyun configure --profile myprofile

# 交互式配置
# Access Key ID: xxx
# Access Key Secret: xxx
# Default Region Id: cn-hangzhou
# Default Output Format: json

# 查看配置
aliyun configure list

# 使用 profile
aliyun ecs DescribeInstances --profile myprofile

# 环境变量
export ALICLOUD_ACCESS_KEY=xxx
export ALICLOUD_SECRET_KEY=xxx
export ALICLOUD_REGION=cn-hangzhou
```

## ECS 实例

### 实例管理
```bash
# 列出实例
aliyun ecs DescribeInstances
aliyun ecs DescribeInstances --RegionId cn-hangzhou

# 按状态过滤
aliyun ecs DescribeInstances --Status Running

# 查看实例详情
aliyun ecs DescribeInstanceAttribute --InstanceId i-xxx

# 启动实例
aliyun ecs StartInstance --InstanceId i-xxx

# 停止实例
aliyun ecs StopInstance --InstanceId i-xxx
aliyun ecs StopInstance --InstanceId i-xxx --ForceStop true

# 重启实例
aliyun ecs RebootInstance --InstanceId i-xxx

# 删除实例
aliyun ecs DeleteInstance --InstanceId i-xxx --Force true
```

### 创建实例
```bash
# 创建实例
aliyun ecs CreateInstance \
    --RegionId cn-hangzhou \
    --ImageId ubuntu_22_04_x64_20G_alibase_20230907.vhd \
    --InstanceType ecs.t6-c1m1.large \
    --SecurityGroupId sg-xxx \
    --VSwitchId vsw-xxx \
    --InstanceName my-instance \
    --InternetChargeType PayByTraffic \
    --InternetMaxBandwidthOut 5

# 分配公网 IP
aliyun ecs AllocatePublicIpAddress --InstanceId i-xxx
```

### 安全组
```bash
# 列出安全组
aliyun ecs DescribeSecurityGroups --RegionId cn-hangzhou

# 创建安全组
aliyun ecs CreateSecurityGroup \
    --RegionId cn-hangzhou \
    --VpcId vpc-xxx \
    --SecurityGroupName my-sg

# 添加入方向规则
aliyun ecs AuthorizeSecurityGroup \
    --SecurityGroupId sg-xxx \
    --IpProtocol tcp \
    --PortRange 22/22 \
    --SourceCidrIp 0.0.0.0/0

# 删除规则
aliyun ecs RevokeSecurityGroup \
    --SecurityGroupId sg-xxx \
    --IpProtocol tcp \
    --PortRange 22/22 \
    --SourceCidrIp 0.0.0.0/0
```

## OSS 存储

### ossutil 工具
```bash
# 配置
ossutil config

# 列出桶
ossutil ls

# 创建桶
ossutil mb oss://my-bucket

# 上传文件
ossutil cp file.txt oss://my-bucket/
ossutil cp -r ./dir oss://my-bucket/dir/

# 下载文件
ossutil cp oss://my-bucket/file.txt ./
ossutil cp -r oss://my-bucket/dir/ ./dir/

# 同步目录
ossutil sync ./local-dir oss://my-bucket/prefix/
ossutil sync oss://my-bucket/prefix/ ./local-dir

# 删除文件
ossutil rm oss://my-bucket/file.txt
ossutil rm -r oss://my-bucket/dir/

# 删除桶
ossutil rb oss://my-bucket

# 生成签名 URL
ossutil sign oss://my-bucket/file.txt --timeout 3600
```

### OSS API
```bash
# 列出桶
aliyun oss ListBuckets

# 列出对象
aliyun oss ListObjects --BucketName my-bucket

# 获取桶信息
aliyun oss GetBucketInfo --BucketName my-bucket
```

## RDS 数据库

```bash
# 列出实例
aliyun rds DescribeDBInstances --RegionId cn-hangzhou

# 查看实例详情
aliyun rds DescribeDBInstanceAttribute --DBInstanceId rm-xxx

# 创建实例
aliyun rds CreateDBInstance \
    --RegionId cn-hangzhou \
    --Engine MySQL \
    --EngineVersion 8.0 \
    --DBInstanceClass rds.mysql.s2.large \
    --DBInstanceStorage 100 \
    --DBInstanceNetType Intranet \
    --PayType Postpaid

# 创建数据库
aliyun rds CreateDatabase \
    --DBInstanceId rm-xxx \
    --DBName mydb \
    --CharacterSetName utf8mb4

# 创建账号
aliyun rds CreateAccount \
    --DBInstanceId rm-xxx \
    --AccountName admin \
    --AccountPassword 'MyPassword123!' \
    --AccountType Super

# 重启实例
aliyun rds RestartDBInstance --DBInstanceId rm-xxx
```

## ACK 容器服务

```bash
# 列出集群
aliyun cs DescribeClusters

# 获取集群详情
aliyun cs DescribeClusterDetail --ClusterId c-xxx

# 获取 kubeconfig
aliyun cs DescribeClusterUserKubeconfig --ClusterId c-xxx

# 扩容节点
aliyun cs ScaleCluster \
    --ClusterId c-xxx \
    --size 5
```

## SLB 负载均衡

```bash
# 列出实例
aliyun slb DescribeLoadBalancers --RegionId cn-hangzhou

# 创建实例
aliyun slb CreateLoadBalancer \
    --RegionId cn-hangzhou \
    --LoadBalancerName my-slb \
    --AddressType internet \
    --LoadBalancerSpec slb.s1.small

# 添加后端服务器
aliyun slb AddBackendServers \
    --LoadBalancerId lb-xxx \
    --BackendServers '[{"ServerId":"i-xxx","Weight":"100"}]'

# 创建监听
aliyun slb CreateLoadBalancerTCPListener \
    --LoadBalancerId lb-xxx \
    --ListenerPort 80 \
    --BackendServerPort 80 \
    --Bandwidth -1
```

## 常见场景

### 场景 1:批量操作实例
```bash
# 获取所有运行中实例
aliyun ecs DescribeInstances --Status Running \
    --output cols=InstanceId rows=Instances.Instance[]

# 批量停止
for id in $(aliyun ecs DescribeInstances --Status Running \
    --output cols=InstanceId rows=Instances.Instance[] | tail -n +2); do
    aliyun ecs StopInstance --InstanceId $id
done
```

### 场景 2:监控数据查询
```bash
# 查询 CPU 使用率
aliyun cms DescribeMetricLast \
    --Namespace acs_ecs_dashboard \
    --MetricName CPUUtilization \
    --Dimensions '[{"instanceId":"i-xxx"}]'
```

### 场景 3:日志查询
```bash
# 查询 SLS 日志
aliyun sls GetLogs \
    --project my-project \
    --logstore my-logstore \
    --from $(date -d '1 hour ago' +%s) \
    --to $(date +%s) \
    --query "* | select *"
```

## 故障排查

| 问题 | 排查方法 |
|------|----------|
| 认证失败 | 检查 AccessKey 配置 |
| 权限不足 | 检查 RAM 策略 |
| 区域错误 | 检查 RegionId |
| 配额超限 | 查看配额管理 |

```bash
# 调试模式
aliyun ecs DescribeInstances --debug

# 查看帮助
aliyun help
aliyun ecs DescribeInstances help
```

Related Skills

aliyun-operations

16
from diegosouzapw/awesome-omni-skill

阿里云服务器运维操作。包括ECS实例管理、安全组配置、服务部署、日志查看。适用于服务器管理、端口开放、应用部署等任务。

bgo

10
from diegosouzapw/awesome-omni-skill

Automates the complete Blender build-go workflow, from building and packaging your extension/add-on to removing old versions, installing, enabling, and launching Blender for quick testing and iteration.

Coding & Development

ai-product-evaluation-design

16
from diegosouzapw/awesome-omni-skill

Transition from traditional PRDs to "Evals" (evaluations) to guide AI model behavior. Use this skill when launching new AI features, debugging unpredictable model outputs, or moving from a prompted prototype to a production-ready agent.

ai-npc-dialogue-designer

16
from diegosouzapw/awesome-omni-skill

Design AI-powered immersive NPC systems for escape room games using proven actor techniques from Korean immersive escape rooms (Danpyeonsun, Ledasquare). Implements adaptive dialogue, emotional simulation, player profiling, and trust dynamics using Gemini/GPT-4. Creates character profiles with lying probabilities, improvisational responses, and cost-optimized streaming. Use for murder mystery NPCs, suspect interrogation, or dynamic character interactions.

ai-native-product-building

16
from diegosouzapw/awesome-omni-skill

Rapidly build, prototype, and deploy full-stack software using AI "text-to-app" tools. Use this when you need to create a greenfield application, build a high-fidelity working prototype for user testing, or bypass traditional engineering bottlenecks for internal tools.

ai-interaction-patterns

16
from diegosouzapw/awesome-omni-skill

AI-specific interaction design patterns covering wayfinding, prompt UX, human-in-the-loop controls, trust & transparency, AI identity, and context management. Based on Shape of AI (shapeof.ai). Use when asking about 'AI UX', 'AI interaction', 'prompt UX', 'AI trust', 'AI disclosure', 'AI avatar', 'AI personality', 'AI memory UX', 'action plan UX', 'stream of thought', 'AI citations', 'AI controls', 'AI wayfinding', 'AI suggestions', 'gallery pattern', 'follow-up pattern', 'draft mode', 'AI variations', 'AI consent', 'AI caveat', 'human-in-the-loop', 'AI transparency', 'AI state', 'prompt design', 'AI onboarding', or 'generative UI'.

ai-insights-and-ux-copy

16
from diegosouzapw/awesome-omni-skill

AI-powered insights, UX copywriting standards, and user experience guidelines for vehicle insurance platform. Use when designing insight panels, writing user-facing copy, implementing status messages, creating onboarding flows, or improving accessibility. Covers tone standards, interactive patterns, error messages, and empty states.

ai-file-analyzer

16
from diegosouzapw/awesome-omni-skill

Analyze Adobe Illustrator (.ai) files to extract design information including text content, fonts, color palettes, vector paths, and generate high-resolution preview images. Use when analyzing logo files, design assets, or any Adobe Illustrator documents that need programmatic inspection.

ai-eval-design-and-iteration

16
from diegosouzapw/awesome-omni-skill

Develop "quizzes" (evals) to measure model performance on specific tasks. Use these benchmarks to guide fine-tuning, determine product UX patterns, and track performance improvements over time. Use this when launching a new AI feature, switching between model versions, or optimizing for high-stakes accuracy.

ahu-thermal

16
from diegosouzapw/awesome-omni-skill

Coil Selection & Thermal Design Agent

ahu-qa

16
from diegosouzapw/awesome-omni-skill

Quality Assurance & Design Validation Agent

ahu-design

16
from diegosouzapw/awesome-omni-skill

Air Handler Configuration & Sizing Agent