CLI 目录 横向对比 FCRS-1.0 标准 /llms.txt
← 返回 CLI 目录

cloud-nuke

$ cloud-nuke 社区开源 高风险
Gruntwork · 云原生与基础设施 · Apache-2.0 · macos / linux / windows

Gruntwork 出品的 cloud-nuke 用于扫描并清理 AWS、GCP 与 Azure 账号中的孤儿资源,非常适合回收临时测试沙箱环境。支持 --dry-run、--output-format json、--older-than、--region 与 --resource-type 精确筛选。

FCRS-1.0 综合评分
74 /100
可用但有局限
中置信度 (源码/文档)
零摩擦安装命令
brew install cloud-nuke
CLI vs MCP 选型建议 仅 CLI 可用

全账号级破坏性清理必须在本地经 --dry-run 核验并受 --force 门控保护,不应直接作为删除型 MCP 工具暴露给模型。

Agent 友好度体检单

✓ 原生 JSON 输出
— 字段裁剪
✓ 无头非交互
✓ 支持 Dry-Run
— 只读模式开关
— 支持 NO_COLOR
✓ 自省/Schema 发现
— 官方 SKILL.md

当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。

FCRS-1.0 六维评分拆解

Agent 友好度 19 / 25

支持 --dry-run、--output-format json、--older-than 与 --force,在只读预演清点场景下非常可靠。

  • Supports --dry-run and --output-format json
  • Interactive confirmation prompt blocks unless --force is passed
安全与权限边界 14 / 25

默认要求交互确认(或显式 --force)并提供 --dry-run 与 --config 排除规则,但核心功能是不可逆的批量删资源操作。

  • --dry-run and --config exclude filters mitigate risk
  • High blast radius: --force deletes matched resources across regions
安装与运行摩擦 14 / 15

静态 Go 单二进制,支持 Homebrew 与 macOS/Linux/Windows 官方发布包。

  • Available via brew install cloud-nuke
能力覆盖与边际价值 11 / 15

跨区域盘点并回收测试沙箱残留资源的效率极高。

  • Parallel multi-region resource discovery and deletion
维护与来源背书 8 / 10

由 Gruntwork(gruntwork-io/cloud-nuke)基于 Apache-2.0 维护。

  • Gruntwork open-source repository under Apache-2.0
文档与可验证性 8 / 10

仓库 README 与 cloud-nuke aws --help 详述了 --config、--dry-run 过滤规则与资源支持清单。

  • Repository README and cloud-nuke aws --help

安全边界、鉴权与放权指南

鉴权方式
本地配置文件 环境变量密钥
凭证存储位置

复用标准 AWS(~/.aws/credentials、AWS_*)、GCP(GOOGLE_APPLICATION_CREDENTIALS)或 Azure(AZURE_*)环境变量凭证。

潜在副作用
只读查询 破坏性删除
费用与配额提示

Apache-2.0 开源 CLI 免费;合理清理可节省闲置云账单,但误操作将造成不可逆数据丢失。

可复制到 CLAUDE.md / AGENTS.md 的安全护栏
# cloud-nuke Agent Rules
- ALWAYS run with `--dry-run --output-format json` first and show the full target list to the user.
- NEVER pass `--force` or run `cloud-nuke` without `--region` and `--resource-type` filters unless explicitly instructed for an ephemeral sandbox account.

Agent 高频安全命令配方

只读查询(安全推荐)

以 --dry-run JSON 审计超过 24 小时的 AWS 资源
cloud-nuke aws --dry-run --older-than 24h --region us-east-1 --output-format json

仅扫描并以 JSON 输出待清理目标列表,不执行任何删除。

使用 --dry-run 按资源类型定向扫描
cloud-nuke aws --dry-run --resource-type ec2 --resource-type ebs --region us-east-1

将扫描范围严格限定在单一区域的 EC2 实例与 EBS 卷。

受控写入与预演

经确认后传入 --force 按过滤条件清理沙箱 EC2 实例
cloud-nuke aws --resource-type ec2 --older-than 72h --region us-east-1 --force

仅在 --dry-run 核对无误且获得用户明确批准后使用 --force 执行清理。

核心优势

  • + --dry-run --output-format json 是安全高效的跨区域资源盘点利器。
  • + 缺少交互确认或 --force 时默认拒绝删除。
  • + 提供细粒度的 --resource-type、--region、--older-than 与 --config 排除机制。

注意事项与踩坑点

  • ! 在非沙箱生产账号误传 --force 会造成严重破坏。
  • ! GCP 与 Azure 支持的资源类型覆盖度不如 AWS 全面。

已验证兼容的 Agent 宿主

Claude Code Codex CLI Gemini CLI