Skip to main content

azure-devops

Manage Azure DevOps work items, pipelines, and repos via the REST API.

来源信息

仓库
ThinkfleetAI/thinkfleet-engine
最近来源活动
2026年2月1日 16:21
检测到的 SKILL.md 语言
英语
星标
0
分支
0

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
azure-devops
description
Manage Azure DevOps work items, pipelines, and repos via the REST API.
metadata
{"thinkfleetbot":{"emoji":"🔷","requires":{"bins":"[Truncated]","env":"[Truncated]"}}}
# Azure DevOps Manage work items, pipelines, and repos via the Azure DevOps REST API. ## Environment Variables - `AZDO_ORG_URL` - Organization URL (e.g. `https://dev.azure.com/yourorg`) - `AZDO_PAT` - Personal access token - `AZDO_PROJECT` - Default project name (optional) ## Auth header ```bash AZDO_AUTH=$(echo -n ":$AZDO_PAT" | base64) ``` ## List projects ```bash curl -s -H "Authorization: Basic $(echo -n ":$AZDO_PAT" | base64)" \ "$AZDO_ORG_URL/_apis/projects?api-version=7.1" | jq '.value[] | {name, state}' ``` ## Get work item ```bash curl -s -H "Authorization: Basic $(echo -n ":$AZDO_PAT" | base64)" \ "$AZDO_ORG_URL/$AZDO_PROJECT/_apis/wit/workitems/123?api-version=7.1" | jq '{id, title: .fields["System.Title"], state: .fields["System.State"], assignedTo: .fields["System.AssignedTo"].displayName}' ``` ## Create work item ```bash curl -s -X POST -H "Authorization: Basic $(echo -n ":$AZDO_PAT" | base64)" \ -H "Content-Type: application/json-patch+json" \ "$AZDO_ORG_URL/$AZDO_PROJECT/_apis/wit/workitems/\$Bug?api-version=7.1" \ -d '[ {"op": "add", "path": "/fields/System.Title", "value": "Login page broken"}, {"op": "add", "path": "/fields/System.Description", "value": "Description here"} ]' | jq '{id, url}' ``` ## Query work items (WIQL) ```bash curl -s -X POST -H "Authorization: Basic $(echo -n ":$AZDO_PAT" | base64)" \ -H "Content-Type: application/json" \ "$AZDO_ORG_URL/$AZDO_PROJECT/_apis/wit/wiql?api-version=7.1" \ -d '{"query": "SELECT [System.Id],[System.Title],[System.State] FROM WorkItems WHERE [System.State] = '\''Active'\'' ORDER BY [System.ChangedDate] DESC"}' | jq '.workItems[] | {id, url}' ``` ## List pipelines ```bash curl -s -H "Authorization: Basic $(echo -n ":$AZDO_PAT" | base64)" \ "$AZDO_ORG_URL/$AZDO_PROJECT/_apis/pipelines?api-version=7.1" | jq '.value[] | {id, name}' ``` ## Run pipeline ```bash curl -s -X POST -H "Authorization: Basic $(echo -n ":$AZDO_PAT" | base64)" \ -H "Content-Type: application/json" \ "$AZDO_ORG_URL/$AZDO_PROJECT/_apis/pipelines/123/runs?api-version=7.1" \ -d '{"resources": {"repositories": {"self": {"refName": "refs/heads/main"}}}}' | jq '{id: .id, state: .state}' ``` ## List repos ```bash curl -s -H "Authorization: Basic $(echo -n ":$AZDO_PAT" | base64)" \ "$AZDO_ORG_URL/$AZDO_PROJECT/_apis/git/repositories?api-version=7.1" | jq '.value[] | {name, defaultBranch, webUrl}' ``` ## Notes - Use API version `7.1` for latest features. - PATs can be scoped to specific permissions (work items, code, build, etc.). - Work item type names in URLs must be prefixed with `$` (e.g. `$Bug`, `$Task`). - Always confirm before creating work items or running pipelines.
在 GitHub 查看