{
  "version": 1,
  "instructions": "按 steps 顺序执行。每步只跑 command。success 不满足就停。不要发明命令，不要把省略号当成参数。",
  "platforms": [
    "darwin",
    "linux",
    "windows"
  ],
  "steps": [
    {
      "id": "install",
      "title": "安装 KT CLI",
      "command": "curl -fsSL https://ktcli.com/install.sh | sh",
      "windows_command": "irm https://ktcli.com/install.ps1 | iex",
      "success": "接着运行 kt version，退出码为 0，输出里有版本号。",
      "stop_if": "响应体以 < 开头是网页，不是安装包。停，不要当成装好了。"
    },
    {
      "id": "login",
      "title": "登录",
      "command": "kt login",
      "success": "kt secret whoami 印出类型 human。",
      "stop_if": "登录确认在官方服务 Bot 的私聊。不要去「KT 凭据审批」群点登录。"
    },
    {
      "id": "secret",
      "title": "安装 KTSecret 组件",
      "command": "kt component install secret",
      "success": "命令退出码为 0。这一步不取值。",
      "stop_if": "不要用 kt secret get 判断这一步是否成功。"
    },
    {
      "id": "device",
      "title": "登记这台电脑",
      "command": "kt secret device enroll --label \"这台机器\"",
      "success": "kt secret device list 里这台机器是 pending 或 approved。",
      "stop_if": "必须在要干活的那台机器上、用本人账号执行。不要给 CI runner 登记，不要在别人的电脑上 enroll。"
    }
  ],
  "do_not": [
    "用 kt secret get 验收「我装好了」。",
    "把命令里的省略号当成真实参数。",
    "向管理员要控制面 PAT、AK，或开 15 分钟委托。",
    "在审批群里点登录确认。",
    "给 CI runner 登记设备。"
  ],
  "errors": [
    {
      "text": "需要已批准设备签名 / device_required",
      "next": "在这台机器上再执行 enroll，等审批群或 Console /security/devices 批准。不要当成缺 get。"
    },
    {
      "text": "主体待开户批准 / subject_pending",
      "next": "enroll 就是开户申请。批设备时会一并开通。登录确认仍在官方 Bot。"
    },
    {
      "text": "平台代持凭据禁止取出明文 / platform_held",
      "next": "改用 kt gh、kt k8s、kt cf、kt aliyun。不要给自己开 get。"
    },
    {
      "text": "对该 locator 需要 get 权限",
      "next": "先看输出里有没有「需要已批准设备签名」。有就 enroll，并升级 CLI。"
    }
  ]
}
