| name | az-cli |
| description | This skill should be used when working with Azure DevOps from the command line. Trigger when user mentions az devops, az repos, az pipelines, az boards, or asks about managing PRs, work items, pipelines, or repositories in Azure DevOps. Also trigger for questions about Azure DevOps CLI setup, authentication, or querying work items. |
Azure DevOps CLI
Overview
Manage Azure DevOps resources using the az CLI with the azure-devops extension. Covers repositories, pull requests, pipelines, boards, and work items.
Prerequisites
az extension add --name azure-devops
az login
az devops configure --defaults organization=https://dev.azure.com/YOUR_ORG project=YOUR_PROJECT
Most-Used Commands
My Pull Requests
az repos pr list --creator "$(az account show --query user.name -o tsv)"
az repos pr list --reviewer "$(az account show --query user.name -o tsv)"
az repos pr show --id <pr-id>
az repos pr checkout --id <pr-id>
My Work Items
az boards query --wiql "SELECT [System.Id], [System.Title], [System.State] FROM WorkItems WHERE [System.AssignedTo] = @Me AND [System.State] <> 'Closed' ORDER BY [System.ChangedDate] DESC"
az boards work-item show --id <work-item-id>
az boards work-item create --title "Task title" --type "Task"
az boards work-item update --id <id> --state "In Progress"
Pipelines
az pipelines list
az pipelines runs list --top 10
az pipelines run --name "pipeline-name"
az pipelines run --name "pipeline-name" --parameters "env=prod version=1.0"
az pipelines runs show --id <run-id>
Repositories
az repos list
az repos show --repository <repo-name>
az repos create --name "new-repo"
Pull Request Workflow
az repos pr create --source-branch feature/my-branch --target-branch main --title "PR Title" --description "Description"
az repos pr update --id <pr-id> --reviewers user@email.com
az repos pr set-vote --id <pr-id> --vote 10
az repos pr update --id <pr-id> --status completed
References
Detailed command references available:
references/repos.md - Repository management, PRs, policies, refs
references/pipelines.md - Pipeline CRUD, runs, variables, releases
references/boards.md - Work items, queries, areas, iterations
references/devops.md - Organization, projects, teams, wikis, auth
Common Flags
Most commands support:
| Flag | Description |
|---|
--org | Organization URL (or set via az devops configure) |
--project | Project name (or set via az devops configure) |
--detect | Auto-detect org/project from git remote |
-o json/table/tsv | Output format |
Troubleshooting
az devops configure --list
az account show
az extension show --name azure-devops