azdo-tool 是 @blogic-cz/agent-tools 中面向 Azure DevOps 的命令行工具,用途是查看流水线、构建与仓库信息(只读),适合排查构建失败、查看构建日志与时间线。它仅限 Azure DevOps;若需操作 Azure 平台资源(vm、webapp、storage、aks、monitor),应使用 az-tool。
运行方式:通过 bun azdo-tool(需将 @blogic-cz/agent-tools 作为开发依赖)。不要直接运行裸 az,凭据守卫会拦截。认证使用 az login 会话。
主要能力包括:pipelines list/show、pipelines runs list/show;构建方面有 build summary(任务状态与耗时)、build timeline(完整事件时间线)、build failed-jobs(仅失败项)、build logs(列出可用日志)、build log-content(读取指定日志内容)。配置多个 Azure DevOps 组织时可用 --profile <name> 选择命名配置。
限制:命令中任意位置出现写入动词(create、delete、update、cancel、queue)会被阻止;pipelines 组之外的 run 也被阻止(pipelines run 允许,acr run、acr task run 不允许);devops invoke 仅限 build 区域、禁用其写入资源且仅允许 GET;通过 acr/account 透传读取凭据(如 acr credential show、account get-access-token,以及涉及 secret、key、credential、password、sas、connection-string 的命令)会被阻止。命令限定在已配置的组织与项目内,并以参数向量方式执行,不经过 shell。
配置示例中可设置 organization、defaultProject、timeoutMs。可用 bun azdo-tool commands 查看完整命令/参数树,--help 查看单个子命令;失败响应会包含 hint、nextCommand、retryable 字段,需检查。官方建议优先使用 CLI 工具而非 MCP 工具,以减少上下文加载。