Yandex Cloud CLI
$ yc 官方出品 高风险Yandex Cloud CLI(yc)用于管理 Yandex Cloud 上的云主机、托管 Kubernetes、Serverless 函数、VPC 与 IAM 权限。内置全局 --format json、--profile 隔离、--no-user-output 与服务账号密钥认证,适合无头自动化。
brew install yandex-cloud-cli yc --format json 以类似 gcloud 的规范子命令直连完整 Yandex Cloud 控制面,无需 MCP 工具定义开销。
Agent 友好度体检单
当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。
FCRS-1.0 六维评分拆解
支持全局 --format json、--no-user-output 静默提示、YC_TOKEN/服务账号密钥认证以及类 gcloud 的规范子命令。
- Global
--format jsonand--no-user-outputflags - Supports headless service-account key files and
YC_TOKEN
支持 --profile 隔离与最小权限服务账号,但删资源与计费类云操作不可逆。
- Profile and service-account IAM scoping
可通过 brew install yandex-cloud-cli 与官方脚本安装于 macOS、Linux、Windows,但属于闭源二进制分发。
- Supported on macOS, Linux, and Windows via Homebrew and installer
单一工具配合统一 --format json 完整覆盖 Yandex Cloud 计算、K8s、Serverless、VPC 与 IAM API。
- Unified CLI covering compute, k8s, serverless, VPC, and IAM
Yandex Cloud 一方官方 CLI,但非开源软件。
- First-party vendor CLI distributed by Yandex Cloud
在线英文文档与本地 --help 齐全,但部分边缘报错与示例偏向俄语社区资料。
- Published English CLI reference at yandex.cloud/en/docs/cli/
安全边界、鉴权与放权指南
将配置保存在 ~/.config/yandex-cloud/config.yaml,并支持 YC_TOKEN、服务账号密钥文件(--service-account-key-file)或元数据 IAM 令牌。
官方闭源免费 CLI;创建云主机、托管 Kubernetes 或存储资源按 Yandex Cloud 标准计费。
# 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 高频安全命令配方
只读查询(安全推荐)
yc compute instance list --format json
返回云主机 ID、可用区、状态与网络地址的结构化 JSON。
yc config list --format json
查看当前激活的 cloud-id、folder-id 与默认可用区。
受控写入与预演
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预演开关。