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

Yandex Cloud CLI

$ yc 官方出品 高风险
Yandex Cloud · 云原生与基础设施 · Proprietary · macos / linux / windows

Yandex Cloud CLI(yc)用于管理 Yandex Cloud 上的云主机、托管 Kubernetes、Serverless 函数、VPC 与 IAM 权限。内置全局 --format json、--profile 隔离、--no-user-output 与服务账号密钥认证,适合无头自动化。

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

yc --format json 以类似 gcloud 的规范子命令直连完整 Yandex Cloud 控制面,无需 MCP 工具定义开销。

Agent 友好度体检单

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

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

FCRS-1.0 六维评分拆解

Agent 友好度 22 / 25

支持全局 --format json、--no-user-output 静默提示、YC_TOKEN/服务账号密钥认证以及类 gcloud 的规范子命令。

  • Global --format json and --no-user-output flags
  • Supports headless service-account key files and YC_TOKEN
安全与权限边界 20 / 25

支持 --profile 隔离与最小权限服务账号,但删资源与计费类云操作不可逆。

  • Profile and service-account IAM scoping
安装与运行摩擦 13 / 15

可通过 brew install yandex-cloud-cli 与官方脚本安装于 macOS、Linux、Windows,但属于闭源二进制分发。

  • Supported on macOS, Linux, and Windows via Homebrew and installer
能力覆盖与边际价值 13 / 15

单一工具配合统一 --format json 完整覆盖 Yandex Cloud 计算、K8s、Serverless、VPC 与 IAM API。

  • Unified CLI covering compute, k8s, serverless, VPC, and IAM
维护与来源背书 8 / 10

Yandex Cloud 一方官方 CLI,但非开源软件。

  • First-party vendor CLI distributed by Yandex Cloud
文档与可验证性 7 / 10

在线英文文档与本地 --help 齐全,但部分边缘报错与示例偏向俄语社区资料。

  • Published English CLI reference at yandex.cloud/en/docs/cli/

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

鉴权方式
浏览器 OAuth 服务账号密钥 本地配置文件 环境变量密钥
凭证存储位置

将配置保存在 ~/.config/yandex-cloud/config.yaml,并支持 YC_TOKEN、服务账号密钥文件(--service-account-key-file)或元数据 IAM 令牌。

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

官方闭源免费 CLI;创建云主机、托管 Kubernetes 或存储资源按 Yandex Cloud 标准计费。

可复制到 CLAUDE.md / AGENTS.md 的安全护栏
# Yandex Cloud CLI (yc) Agent Rules
- Always pass `--format json` and `--no-user-output` on automated commands.
- Pin `--profile` and `--folder-id` explicitly before mutations.
- Never run `yc ... delete` or `yc ... stop` without explicit user approval.

Agent 高频安全命令配方

只读查询(安全推荐)

以 JSON 列出云主机实例
yc compute instance list --format json

返回云主机 ID、可用区、状态与网络地址的结构化 JSON。

以 JSON 检查当前 CLI 配置
yc config list --format json

查看当前激活的 cloud-id、folder-id 与默认可用区。

受控写入与预演

创建独立的服务账号 Profile
yc config profile create sa-agent && yc config set service-account-key sa-key.json

将 Agent 权限隔离到最小权限服务账号,避免使用个人 OAuth 令牌。

核心优势

  • + 几乎所有 list/get 子命令均统一支持 --format json。
  • + 服务账号密钥与 --profile 隔离非常契合 CI 与沙箱 Agent。
  • + --no-user-output 可确保标准输出仅包含干净 JSON。

注意事项与踩坑点

  • ! 闭源专有二进制,没有公开的源码仓库。
  • ! 变更类子命令缺少全局 --dry-run 预演开关。

已验证兼容的 Agent 宿主

Claude Code Codex CLI Gemini CLI