← ClaudeAtlas

aliyun-clilisted

阿里云 CLI 操作
ryukyagamilight/terminal-skills · ★ 1 · AI & Automation · score 75
Install: claude install-skill ryukyagamilight/terminal-skills
# 阿里云 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 CreateSecurityG