azure-devops
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAzure DevOps with orbit CLI
Azure DevOps with orbit CLI
Manage Azure DevOps (VSTS) projects, work items, and saved queries from the command line. Supports both modern () and legacy () instances using PAT-based basic auth.
dev.azure.com*.visualstudio.com从命令行管理Azure DevOps(VSTS)项目、工作项和已保存查询。支持使用基于PAT的基本认证连接现代()和旧版()实例。
dev.azure.com*.visualstudio.comPrerequisites
前提条件
- CLI installed — if
orbitfails, install with:which orbit- macOS/Linux (Homebrew):
brew install jorgemuza/tap/orbit - macOS/Linux (script):
curl -sSfL https://raw.githubusercontent.com/jorgemuza/orbit/main/install.sh | sh
- macOS/Linux (Homebrew):
- A profile with an service configured in
azure-devops~/.config/orbit/config.yaml - A Personal Access Token (PAT) with appropriate scopes (Work Items Read/Write, Project Read)
- Auth method: with your email as username and the PAT as password
basic
- 已安装CLI —— 若执行
orbit无结果,可通过以下方式安装:which orbit- macOS/Linux(Homebrew):
brew install jorgemuza/tap/orbit - macOS/Linux(脚本):
curl -sSfL https://raw.githubusercontent.com/jorgemuza/orbit/main/install.sh | sh
- macOS/Linux(Homebrew):
- 在中配置包含
~/.config/orbit/config.yaml服务的配置文件azure-devops - 具备适当权限范围的个人访问令牌(PAT)(工作项读写、项目读取)
- 认证方式:,用户名填写邮箱,密码填写PAT
basic
Configuration
配置示例
yaml
profiles:
myprofile:
services:
- name: azure-devops
type: azure-devops
base_url: https://myorg.visualstudio.com # or https://dev.azure.com/myorg
proxy: none # bypass profile-level proxy if needed
auth:
method: basic
username: me@company.com
password: "MY_PAT_HERE" # supports op:// references
options:
default_project: MyProject # optional — avoids --project on every callyaml
profiles:
myprofile:
services:
- name: azure-devops
type: azure-devops
base_url: https://myorg.visualstudio.com # 或 https://dev.azure.com/myorg
proxy: none # 如有需要,绕过配置文件级代理
auth:
method: basic
username: me@company.com
password: "MY_PAT_HERE" # 支持op://引用
options:
default_project: MyProject # 可选 —— 避免每次调用都添加--project参数Quick Reference
快速参考
All commands follow the pattern:
orbit -p <profile> ado <command> [flags]All commands support and for structured output.
-o json-o yaml所有命令遵循以下格式:
orbit -p <profile> ado <command> [flags]所有命令均支持和参数以输出结构化数据。
-o json-o yamlCommand Groups
命令组
| Group | Alias | Description |
|---|---|---|
| List projects in the organization | |
| | View, list, create, update work items |
| Run and list saved queries | |
| Verify connectivity and show authenticated user |
| 命令组 | 别名 | 描述 |
|---|---|---|
| 列出组织内的项目 | |
| | 查看、列出、创建、更新工作项 |
| 运行和列出已保存的查询 | |
| 验证连接状态并显示已认证用户 |
Core Workflows
核心工作流
Verifying Connection
验证连接
bash
orbit -p myprofile ado versionbash
orbit -p myprofile ado versionListing Projects
列出项目
bash
orbit -p myprofile ado project list
orbit -p myprofile ado project list -o jsonbash
orbit -p myprofile ado project list
orbit -p myprofile ado project list -o jsonWork Items
工作项操作
bash
undefinedbash
undefinedView a single work item
查看单个工作项
orbit -p myprofile ado wi view 12345
orbit -p myprofile ado wi view 12345 -o json
orbit -p myprofile ado wi view 12345
orbit -p myprofile ado wi view 12345 -o json
List work items with filters (builds WIQL automatically)
带筛选条件列出工作项(自动生成WIQL)
orbit -p myprofile ado wi list --project Fusion --type Bug --state New
orbit -p myprofile ado wi list --project Fusion --type "User Story" --state Active
orbit -p myprofile ado wi list --project Fusion --assigned-to "me@company.com"
orbit -p myprofile ado wi list --project Fusion --max-results 100
orbit -p myprofile ado wi list --project Fusion --type Bug --state New
orbit -p myprofile ado wi list --project Fusion --type "User Story" --state Active
orbit -p myprofile ado wi list --project Fusion --assigned-to "me@company.com"
orbit -p myprofile ado wi list --project Fusion --max-results 100
Raw WIQL query
原生WIQL查询
orbit -p myprofile ado wi list --project Fusion --wiql "SELECT [System.Id], [System.Title] FROM WorkItems WHERE [System.State] = 'Active' ORDER BY [System.CreatedDate] DESC"
orbit -p myprofile ado wi list --project Fusion --wiql "SELECT [System.Id], [System.Title] FROM WorkItems WHERE [System.State] = 'Active' ORDER BY [System.CreatedDate] DESC"
Create a work item
创建工作项
orbit -p myprofile ado wi create --project Fusion --type Bug
--field "System.Title=Login page broken"
--field "System.Description=Steps to reproduce..."
--field "System.Title=Login page broken"
--field "System.Description=Steps to reproduce..."
orbit -p myprofile ado wi create --project Fusion --type Bug
--field "System.Title=Login page broken"
--field "System.Description=Steps to reproduce..."
--field "System.Title=Login page broken"
--field "System.Description=Steps to reproduce..."
Update a work item (any field)
更新工作项(支持任意字段)
orbit -p myprofile ado wi update 12345 --field "System.State=Active"
orbit -p myprofile ado wi update 12345 --field "System.AssignedTo=someone@company.com"
orbit -p myprofile ado wi update 12345
--field "System.State=Resolved"
--field "Microsoft.VSTS.Common.ResolvedReason=Fixed"
--field "System.State=Resolved"
--field "Microsoft.VSTS.Common.ResolvedReason=Fixed"
undefinedorbit -p myprofile ado wi update 12345 --field "System.State=Active"
orbit -p myprofile ado wi update 12345 --field "System.AssignedTo=someone@company.com"
orbit -p myprofile ado wi update 12345
--field "System.State=Resolved"
--field "Microsoft.VSTS.Common.ResolvedReason=Fixed"
--field "System.State=Resolved"
--field "Microsoft.VSTS.Common.ResolvedReason=Fixed"
undefinedSaved Queries
已保存查询操作
bash
undefinedbash
undefinedRun a saved query by its UUID
通过UUID运行已保存的查询
orbit -p myprofile ado query run a670954b-e739-47ca-a09a-acc10f623123 --project Fusion
orbit -p myprofile ado query run a670954b-e739-47ca-a09a-acc10f623123 --project Fusion
List saved queries and folders
列出已保存的查询和文件夹
orbit -p myprofile ado query list --project Fusion
orbit -p myprofile ado query list --project Fusion --depth 3
undefinedorbit -p myprofile ado query list --project Fusion
orbit -p myprofile ado query list --project Fusion --depth 3
undefinedCommon Field Names
常用字段名称
Azure DevOps uses fully-qualified field names. The most common:
| Field | Description |
|---|---|
| Work item title |
| State (New, Active, Resolved, Closed) |
| Type (Bug, Task, User Story, Epic, Feature) |
| Assigned user (email or display name) |
| HTML description |
| Area path (e.g. |
| Iteration/sprint path |
| Semicolon-separated tags |
| Priority (1-4) |
| Severity (1-4) |
| Why it was resolved |
Azure DevOps使用全限定字段名称,最常用的字段如下:
| 字段 | 描述 |
|---|---|
| 工作项标题 |
| 状态(新建、活跃、已解决、已关闭) |
| 类型(缺陷、任务、用户故事、史诗、特性) |
| 分配用户(邮箱或显示名称) |
| HTML描述 |
| 区域路径(例如 |
| 迭代/冲刺路径 |
| 分号分隔的标签 |
| 优先级(1-4) |
| 严重程度(1-4) |
| 解决原因 |
WIQL (Work Item Query Language)
WIQL(工作项查询语言)
WIQL is Microsoft's query language for work items, similar to SQL:
sql
SELECT [System.Id], [System.Title], [System.State]
FROM WorkItems
WHERE [System.TeamProject] = 'Fusion'
AND [System.WorkItemType] = 'Bug'
AND [System.State] <> 'Closed'
AND [System.AssignedTo] = @Me
ORDER BY [System.CreatedDate] DESCKey differences from Jira JQL:
- Field names use brackets:
[System.Title] - String values use single quotes:
'Active' - Current user:
@Me - Not equal:
<> - Table: (always)
FROM WorkItems
WIQL是微软针对工作项的查询语言,类似SQL:
sql
SELECT [System.Id], [System.Title], [System.State]
FROM WorkItems
WHERE [System.TeamProject] = 'Fusion'
AND [System.WorkItemType] = 'Bug'
AND [System.State] <> 'Closed'
AND [System.AssignedTo] = @Me
ORDER BY [System.CreatedDate] DESC与Jira JQL的主要区别:
- 字段名称使用方括号:
[System.Title] - 字符串值使用单引号:
'Active' - 当前用户:
@Me - 不等于:
<> - 固定表名:
FROM WorkItems
Important Notes
重要说明
- PAT auth: Azure DevOps uses the PAT as the password in basic auth. The username is your email.
- API version: All requests use (latest stable).
api-version=7.1 - JSON Patch: Create/update use format internally — the CLI handles this; just pass
application/json-patch+json.--field Key=Value - default_project: Set in to avoid
options.default_projecton every command.--project - Proxy bypass: If your profile has a proxy for VPN services but Azure DevOps is on the public internet, set on the service to bypass.
proxy: none - 1Password integration: PAT in config can use and is resolved at runtime via
op://vault/item/field.orbit auth
- PAT认证:Azure DevOps在基本认证中使用PAT作为密码,用户名填写你的邮箱。
- API版本:所有请求使用(最新稳定版)。
api-version=7.1 - JSON Patch:创建/更新操作内部使用格式——CLI会自动处理,只需传入
application/json-patch+json参数即可。--field Key=Value - default_project:在中设置后,可避免每次命令都添加
options.default_project参数。--project - 代理绕过:如果你的配置文件为VPN服务设置了代理,但Azure DevOps处于公网,可在服务配置中设置来绕过代理。
proxy: none - 1Password集成:配置中的PAT可使用格式,运行
op://vault/item/field时会在运行时解析。orbit auth