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

DigitalOcean doctl

$ doctl 官方出品 高风险
DigitalOcean · 云原生与基础设施 · Apache-2.0 · macos / linux / windows

DigitalOcean 官方 CLI(doctl)通过单文件 Go 二进制管理 Droplet、Kubernetes 集群、App Platform、托管数据库与 Spaces,支持 --output json(-o json)、--format 字段筛选、--context 切换以及删除操作 --force 防护。

FCRS-1.0 综合评分
88 /100
良好 (Good)
中置信度 (源码/文档)
零摩擦安装命令
brew install doctl
CLI vs MCP 选型建议 优先选 CLI

doctl 以单文件二进制提供全量 --output json API 覆盖,命令行调用比 MCP 更加直接高效。

Agent 友好度体检单

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

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

FCRS-1.0 六维评分拆解

Agent 友好度 23 / 25

全命令支持 --output json(-o json)与 --format 列选择,且 Go 二进制启动极快。

  • Supports -o json and --format globally
安全与权限边界 20 / 25

支持 --context 账号隔离,且所有破坏性 delete 命令默认要求确认(除非显式传 --force)。

  • Destructive delete commands prompt unless --force is passed
安装与运行摩擦 14 / 15

单文件静态 Go 二进制,支持通过 Homebrew、Snap 与官方包跨平台安装。

  • Single Go binary via brew install doctl
能力覆盖与边际价值 13 / 15

简洁覆盖 DigitalOcean 计算、DOKS、App Platform 与网络管理。

  • Unified control over DigitalOcean infrastructure
维护与来源背书 9 / 10

DigitalOcean 官方仓库(digitalocean/doctl)基于 Apache-2.0 持续维护。

  • First-party digitalocean/doctl repository
文档与可验证性 9 / 10

内置一致的 --help 说明及结构清晰的官方参考文档。

  • Complete online reference at docs.digitalocean.com

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

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

将多上下文令牌保存在 ~/.config/doctl/config.yaml,或读取 DIGITALOCEAN_ACCESS_TOKEN 环境变量。

潜在副作用
只读查询 本地写入 远端写入 破坏性删除 计费影响
费用与配额提示

CLI 本身开源免费(Apache-2.0);创建 Droplet 或托管集群会产生 DigitalOcean 费用。

可复制到 CLAUDE.md / AGENTS.md 的安全护栏
# 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 高频安全命令配方

只读查询(安全推荐)

核验当前认证的 DigitalOcean 账号
doctl account get --output json

以标准 JSON 返回当前账号邮箱、状态与资源配额。

以 JSON 格式列出所有 Droplet
doctl compute droplet list --output json

结构化展示运行中 Droplet 的 IP、区域与状态。

核心优势

  • + 单文件 Go 二进制冷启动快,普遍支持 --output json。
  • + 破坏性 delete 操作在非交互模式下必须显式传入 --force。
  • + --context 机制便于隔离个人与团队账号令牌。

注意事项与踩坑点

  • ! 创建云资源时缺少原生 --dry-run 预演模式。
  • ! 使用 --output json 时 --format 列过滤不生效,会返回完整 JSON 对象。

已验证兼容的 Agent 宿主

Claude Code Codex CLI Gemini CLI