DigitalOcean doctl
$ doctl 官方出品 高风险DigitalOcean 官方 CLI(doctl)通过单文件 Go 二进制管理 Droplet、Kubernetes 集群、App Platform、托管数据库与 Spaces,支持 --output json(-o json)、--format 字段筛选、--context 切换以及删除操作 --force 防护。
brew install doctl doctl 以单文件二进制提供全量 --output json API 覆盖,命令行调用比 MCP 更加直接高效。
Agent 友好度体检单
当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。
FCRS-1.0 六维评分拆解
全命令支持 --output json(-o json)与 --format 列选择,且 Go 二进制启动极快。
- Supports
-o jsonand--formatglobally
支持 --context 账号隔离,且所有破坏性 delete 命令默认要求确认(除非显式传 --force)。
- Destructive
deletecommands prompt unless--forceis passed
单文件静态 Go 二进制,支持通过 Homebrew、Snap 与官方包跨平台安装。
- Single Go binary via
brew install doctl
简洁覆盖 DigitalOcean 计算、DOKS、App Platform 与网络管理。
- Unified control over DigitalOcean infrastructure
DigitalOcean 官方仓库(digitalocean/doctl)基于 Apache-2.0 持续维护。
- First-party
digitalocean/doctlrepository
内置一致的 --help 说明及结构清晰的官方参考文档。
- Complete online reference at docs.digitalocean.com
安全边界、鉴权与放权指南
将多上下文令牌保存在 ~/.config/doctl/config.yaml,或读取 DIGITALOCEAN_ACCESS_TOKEN 环境变量。
CLI 本身开源免费(Apache-2.0);创建 Droplet 或托管集群会产生 DigitalOcean 费用。
# doctl Agent Rules - Always pass `--output json` and verify `doctl account get --output json` first. - Pin `--context` when working across multiple DigitalOcean teams. - Never pass `--force` (`-f`) on `delete` subcommands without user confirmation.
Agent 高频安全命令配方
只读查询(安全推荐)
doctl account get --output json
以标准 JSON 返回当前账号邮箱、状态与资源配额。
doctl compute droplet list --output json
结构化展示运行中 Droplet 的 IP、区域与状态。
核心优势
- + 单文件 Go 二进制冷启动快,普遍支持
--output json。 - + 破坏性
delete操作在非交互模式下必须显式传入--force。 - +
--context机制便于隔离个人与团队账号令牌。
注意事项与踩坑点
- ! 创建云资源时缺少原生
--dry-run预演模式。 - ! 使用
--output json时--format列过滤不生效,会返回完整 JSON 对象。