
- Installs
- 56
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/chaterm/terminal-skills --skill aws-cli- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads aws-cli automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
AWS CLI 操作
概述
EC2、S3、IAM、Lambda 等 AWS 服务的命令行操作技能。
配置与认证
# 配置凭证
aws configure
aws configure --profile myprofile
# 查看配置
aws configure list
aws configure list --profile myprofile
# 配置文件位置
~/.aws/credentials
~/.aws/config
# 使用环境变量
export AWS_ACCESS_KEY_ID=xxx
export AWS_SECRET_ACCESS_KEY=xxx
export AWS_DEFAULT_REGION=us-east-1
# 使用 profile
export AWS_PROFILE=myprofile
aws s3 ls --profile myprofile
# 获取当前身份
aws sts get-caller-identity
EC2 实例
实例管理
# 列出实例
aws ec2 describe-instances
aws ec2 describe-instances --filters "Name=instance-state-name,Values=running"
aws ec2 describe-instances --query 'Reservations[*].Instances[*].[InstanceId,State.Name,PublicIpAddress]' --output table
# 启动/停止实例
aws ec2 start-instances --instance-ids i-1234567890abcdef0
aws ec2 stop-instances --instance-ids i-1234567890abcdef0
aws ec2 reboot-instances --instance-ids i-1234567890abcdef0
# 终止实例
aws ec2 terminate-instances --instance-ids i-1234567890abcdef0
# 创建实例
aws ec2 run-instances \
--image-id ami-12345678 \
--instance-type t3.micro \
--key-name my-key \
--security-group-ids sg-12345678 \
--subnet-id subnet-12345678 \
--count 1
安全组
# 列出安全组
aws ec2 describe-security-groups
aws ec2 describe-security-groups --group-ids sg-12345678
# 创建安全组
aws ec2 create-security-group \
--group-name my-sg \
--description "My security group" \
--vpc-id vpc-12345678
# 添加入站规则
aws ec2 authorize-security-group-ingress \
--group-id sg-12345678 \
--protocol tcp \
--port 22 \
--cidr 0.0.0.0/0
# 删除规则
aws ec2 revoke-security-group-ingress \
--group-id sg-12345678 \
--protocol tcp \
--port 22 \
--cidr 0.0.0.0/0
S3 存储
基础操作
# 列出桶
aws s3 ls
# 列出对象
aws s3 ls s3://bucket-name/
aws s3 ls s3://bucket-name/prefix/ --recursive
# 创建桶
aws s3 mb s3://bucket-name
aws s3 mb s3://bucket-name --region us-west-2
# 删除桶
aws s3 rb s3://bucket-name
aws s3 rb s3://bucket-name --force # 包括内容
文件操作
# 上传文件
aws s3 cp file.txt s3://bucket-name/
aws s3 cp file.txt s3://bucket-name/path/file.txt
# 下载文件
aws s3 cp s3://bucket-name/file.txt ./
aws s3 cp s3://bucket-name/path/ ./ --recursive
# 同步目录
aws s3 sync ./local-dir s3://bucket-name/prefix/
aws s3 sync s3://bucket-name/prefix/ ./local-dir
aws s3 sync ./local-dir s3://bucket-name/ --delete # 删除目标多余文件
# 删除对象
aws s3 rm s3://bucket-name/file.txt
aws s3 rm s3://bucket-name/prefix/ --recursive
# 移动/重命名
aws s3 mv s3://bucket-name/old.txt s3://bucket-name/new.txt
高级操作
# 预签名 URL
aws s3 presign s3://bucket-name/file.txt --expires-in 3600
# 设置公开访问
aws s3api put-object-acl --bucket bucket-name --key file.txt --acl public-read
# 查看桶策略
aws s3api get-bucket-policy --bucket bucket-name
# 设置生命周期
aws s3api put-bucket-lifecycle-configuration \
--bucket bucket-name \
--lifecycle-configuration file://lifecycle.json
IAM 管理
# 列出用户
aws iam list-users
# 创建用户
aws iam create-user --user-name myuser
# 创建访问密钥
aws iam create-access-key --user-name myuser
# 附加策略
aws iam attach-user-policy \
--user-name myuser \
--policy-arn arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess
# 列出角色
aws iam list-roles
# 获取角色
aws iam get-role --role-name myrole
Lambda 函数
# 列出函数
aws lambda list-functions
# 调用函数
aws lambda invoke \
--function-name my-function \
--payload '{"key": "value"}' \
output.json
# 查看函数配置
aws lambda get-function --function-name my-function
# 更新函数代码
aws lambda update-function-code \
--function-name my-function \
--zip-file fileb://function.zip
# 查看日志
aws logs filter-log-events \
--log-group-name /aws/lambda/my-function \
--start-time $(date -d '1 hour ago' +%s)000
EKS 集群
# 列出集群
aws eks list-clusters
# 获取集群信息
aws eks describe-cluster --name my-cluster
# 更新 kubeconfig
aws eks update-kubeconfig --name my-cluster --region us-east-1
# 列出节点组
aws eks list-nodegroups --cluster-name my-cluster
常见场景
场景 1:批量操作实例
# 获取所有运行中实例 ID
aws ec2 describe-instances \
--filters "Name=instance-state-name,Values=running" \
--query 'Reservations[*].Instances[*].InstanceId' \
--output text
# 批量停止
aws ec2 stop-instances --instance-ids $(aws ec2 describe-instances \
--filters "Name=tag:Environment,Values=dev" \
--query 'Reservations[*].Instances[*].InstanceId' \
--output text)
场景 2:S3 大文件传输
# 多部分上传(自动)
aws s3 cp large-file.zip s3://bucket-name/ \
--storage-class STANDARD_IA
# 配置传输加速
aws s3api put-bucket-accelerate-configuration \
--bucket bucket-name \
--accelerate-configuration Status=Enabled
场景 3:查询 CloudWatch 日志
# 查询日志
aws logs filter-log-events \
--log-group-name /aws/lambda/my-function \
--filter-pattern "ERROR" \
--start-time $(date -d '1 hour ago' +%s)000
# 实时跟踪
aws logs tail /aws/lambda/my-function --follow
故障排查
| 问题 | 排查方法 |
|---|---|
| 认证失败 | aws sts get-caller-identity |
| 权限不足 | 检查 IAM 策略 |
| 区域错误 | 检查 --region 参数 |
| 超时 | 检查网络、增加超时设置 |
# 调试模式
aws s3 ls --debug
# 检查配置
aws configure list
FAQ
What does the aws-cli skill do?
AWS CLI 操作
How do I install aws-cli?
Run npx skills add https://github.com/chaterm/terminal-skills --skill aws-cli in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/aws-cli/ (personal) or .claude/skills/aws-cli/ (project).
Which AI agents can use aws-cli?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is aws-cli safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains aws-cli?
It is published by chaterm in chaterm/terminal-skills. It has 56 recorded installs.
More from chaterm/terminal-skills
system-admin
chaterm/terminal-skills
Linux system administration and monitoring
Popular devops & cloud skills
microsoft-foundry
microsoft/azure-skills
Build, deploy, evaluate, optimize, fine-tune, and manage Microsoft Foundry agents, models, and resources end to end. USE FOR: foundry, azd ai agent, azd provision/deploy, hosted agent scaffold/develop/run/deploy/troubleshoot, prompt agent create, managed harness agent create, GitHub Copilot harness agent, create agent, update agent, add tool to agent, invoke agent, agent insights, evaluate agent, batch eval, continuous eval, continuous monitoring, agent CI/CD, optimize prompt, improve prompt, optimize agent instructions, Agent Optimizer scaffold, dataset curation from traces, deploy model, model fine-tuning (SFT/DPO/RFT), Foundry project, RBAC, role assignment, permissions, quota, capacity, region, deployment failure, AI Services, create Foundry resource, knowledge index, customize deployment, onboard, availability, training-data, grader, distillation, large file upload. DO NOT USE FOR: Azure Functions, App Service, general Azure deploy (use azure-deploy), general Azure prep (use azure
azure-diagnostics
microsoft/azure-skills
Debug Azure production issues on Azure using AppLens, Azure Monitor, resource health, and safe triage. WHEN: debug production issues, troubleshoot app service, app service high CPU, app service deployment failure, troubleshoot container apps, container app 503 or target port mismatch, troubleshoot functions, function telemetry missing or stopped after a config/connection-string change, troubleshoot AKS, VM RDP, Linux SSH, VM black screen, can't connect to VM, reset VM password, NSG or firewall blocking, kubectl cannot connect, kube-system/CoreDNS failures, pod pending, crashloop, node not ready, upgrade failures, analyze logs, KQL, insights, image pull failures, cold start issues, health probe failures, resource health, root cause of errors, troubleshoot event hubs, troubleshoot service bus, messaging SDK error, AMQP connection failure, message lock lost, lock renewal during long-running processing, service bus dead letter.
azure-prepare
microsoft/azure-skills
Prepare azd-based Azure projects for deployment: generates azure.yaml, infrastructure (Bicep/Terraform), and Dockerfiles for the Azure Developer CLI (azd) workflow. USE ONLY when the user explicitly wants to use azd as the deployment tool, or the project already has an azure.yaml file. DO NOT USE FOR: non-azd deployments, Python App Service code-only deploys (use python-appservice-deploy), or cross-cloud migration (use azure-cloud-migrate). WHEN: prepare app for azd, create azure.yaml, set up azd infrastructure, modernize app for Azure with azd, deploy with azd, function app, timer trigger, service bus trigger, event-driven function, managed identity, generate Bicep, generate Terraform, create and deploy to Azure.
azure-ai
microsoft/azure-skills
Use for Azure AI: Search, Speech, OpenAI, Document Intelligence. Helps with search, vector/hybrid search, speech-to-text, text-to-speech, transcription, OCR. WHEN: AI Search, query search, vector search, hybrid search, semantic search, speech-to-text, text-to-speech, transcribe, OCR, convert text to speech.
azure-deploy
microsoft/azure-skills
Execute Azure deployments for ALREADY-PREPARED applications that have existing .azure/deployment-plan.md and infrastructure files. DO NOT use this skill when the user asks to CREATE a new application — use azure-prepare instead. This skill runs azd up, azd deploy, terraform apply, and az deployment commands with built-in error recovery. Requires .azure/deployment-plan.md from azure-prepare and validated status from azure-validate. WHEN: "run azd up", "run azd deploy", "execute deployment", "push to production", "push to cloud", "go live", "ship it", "bicep deploy", "terraform apply", "publish to Azure", "launch on Azure". DO NOT USE WHEN: "create and deploy", "build and deploy", "create a new app", "set up infrastructure", "create and deploy to Azure using Terraform" — use azure-prepare for these.
azure-validate
microsoft/azure-skills
Pre-deployment validation for Azure readiness. Run deep checks on configuration, infrastructure (Bicep or Terraform), RBAC role assignments, managed identity permissions, and prerequisites before deploying. WHEN: validate my app, check deployment readiness, run preflight checks, verify configuration, check if ready to deploy, validate azure.yaml, validate Bicep, test before deploying, troubleshoot deployment errors, validate Azure Functions, validate function app, validate serverless deployment, verify RBAC roles, check role assignments, review managed identity permissions, what-if analysis, validate Container Apps deployment.