github/awesome-copilot / skills/azure-devops-cli
azure-devops-cli
FlaggedManage Azure DevOps resources via CLI including projects, repos, pipelines, builds, pull requests, work items, artifacts, and service endpoints. Use when working with Azure DevOps, az commands, devops automation, CI/CD, or when user mentions Azure DevOps CLI.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 4.2 KB |
| references/advanced-usage.md | markdown | 5.3 KB |
| references/boards-and-iterations.md | markdown | 6.0 KB |
| references/long-comments-on-windows.md | markdown | 3.1 KB |
| references/org-and-security.md | markdown | 9.0 KB |
| references/pipelines-and-builds.md | markdown | 4.7 KB |
| references/repos-and-prs.md | markdown | 6.6 KB |
| references/variables-and-agents.md | markdown | 3.7 KB |
| references/workflows-and-patterns.md | markdown | 16.0 KB |
references/repos-and-prs.md
View on GitHub# Repositories & Pull Requests
## Table of Contents
- [Repositories](#repositories)
- [Repository Import](#repository-import)
- [Pull Requests](#pull-requests)
- [Git References](#git-references)
- [Repository Policies](#repository-policies)
---
## Repositories
### List Repositories
```bash
az repos list --org https://dev.azure.com/{org} --project {project}
az repos list --output table
```
### Show Repository Details
```bash
az repos show --repository {repo-name} --project {project}
```
### Create Repository
```bash
az repos create --name {repo-name} --project {project}
```
### Delete Repository
```bash
az repos delete --id {repo-id} --project {project} --yes
```
### Update Repository
```bash
az repos update --id {repo-id} --name {new-name} --project {project}
```
## Repository Import
### Import Git Repository
```bash
# Import from public Git repository
az repos import create \
--git-source-url https://github.com/user/repo \
--repository {repo-name}
# Import with authentication
az repos import create \
--git-source-url https://github.com/user/private-repo \
--repository {repo-name} \
--user {username} \
--password {password-or-pat}
```
## Pull Requests
### Create Pull Request
```bash
# Basic PR creation
az repos pr create \
--repository {repo} \
--source-branch {source-branch} \
--target-branch {target-branch} \
--title "PR Title" \
--description "PR description" \
--open
# PR with work items
az repos pr create \
--repository {repo} \
--source-branch {source-branch} \
--work-items 63 64
# Draft PR with reviewers
az repos pr create \
--repository {repo} \
--source-branch feature/new-feature \
--target-branch main \
--title "Feature: New functionality" \
--draft true \
--reviewers user1@example.com user2@example.com \
--required-reviewers lead@example.com \
--labels "enhancement" "backlog"
```
### List Pull Requests
```bash
# All PRs
az repos pr list --repository {repo}
# Filter by status
az repos pr list --repository {repo} --status active
# Filter by creator
az repos pr list --repository {repo} --creator {email}
# Output as table
az repos pr list --repository {repo} --output table
```
### Show PR Details
```bash
az repos pr show --id {pr-id}
az repos pr show --id {pr-id} --open # Open in browser
```
### Update PR (Complete/Abandon/Draft)
```bash
# Complete PR
az repos pr update --id {pr-id} --status completed
# Abandon PR
az repos pr update --id {pr-id} --status abandoned
# Set to draft
az repos pr update --id {pr-id} --draft true
# Publish draft PR
az repos pr update --id {pr-id} --draft false
# Auto-complete when policies pass
az repos pr update --id {pr-id} --auto-complete true
# Set title and description
az repos pr update --id {pr-id} --title "New title" --description "New description"
```
### Checkout PR Locally
```bash
# Checkout PR branch
az repos pr checkout --id {pr-id}
# Checkout with specific remote
az repos pr checkout --id {pr-id} --remote-name upstream
```
### Vote on PR
```bash
az repos pr set-vote --id {pr-id} --vote approve
az repos pr set-vote --id {pr-id} --vote approve-with-suggestions
az repos pr set-vote --id {pr-id} --vote reject
az repos pr set-vote --id {pr-id} --vote wait-for-author
az repos pr set-vote --id {pr-id} --vote reset
```
### PR Reviewers
```bash
# Add reviewers
az repos pr reviewer add --id {pr-id} --reviewers user1@example.com user2@example.com
# List reviewers
az repos pr reviewer list --id {pr-id}
# Remove reviewers
az repos pr reviewer remove --id {pr-id} --reviewers user1@example.com
```
### PR Work Items
```bash
# Add work items to PR
az repos pr work-item add --id {pr-id} --work-items {id1} {id2}
# List PR work items
az repos pr work-item list --id {pr-id}
# Remove work items from PR
az repos pr work-item remove --id {pr-id} --work-items {id1}
```
### PR Policies
```bash
# List policies for a PR
az repos pr policy list --id {pr-id}
# Queue policy evaluation for a PR
az repos pr policy queue --id {pr-id} --evaluation-id {evaluation-id}
```
## Git References
### List References (Branches)
```bash
az repos ref list --repository {repo}
az repos ref list --repository {repo} --query "[?name=='refs/heads/main']"
```
### Create Reference (Branch)
```bash
az repos ref create --name refs/heads/new-branch --object-type commit --object {commit-sha}
```
### Delete Reference (Branch)
```bash
az repos ref delete --name refs/heads/old-branch --repository {repo} --project {project}
```
### Lock/Unlock Branch
```bash
az repos ref lock --name refs/heads/main --repository {repo} --project {project}
az repos ref unlock --name refs/heads/main --repository {repo} --project {project}
```
## Repository Policies
### List All Policies
```bash
az repos policy list --repository {repo-id} --branch main
```
### Create/Update/Delete Policy
```bash
# Create from config file
az repos policy create --config policy.json
# Update
az repos policy update --id {policy-id} --config updated-policy.json
# Delete
az repos policy delete --id {policy-id} --yes
```
### Approver Count Policy
```bash
az repos policy approver-count create \
--blocking true \
--enabled true \
--branch main \
--repository-id {repo-id} \
--minimum-approver-count 2 \
--creator-vote-counts true
```
### Build Policy
```bash
az repos policy build create \
--blocking true \
--enabled true \
--branch main \
--repository-id {repo-id} \
--build-definition-id {definition-id} \
--queue-on-source-update-only true \
--valid-duration 720
```
### Work Item Linking Policy
```bash
az repos policy work-item-linking create \
--blocking true \
--branch main \
--enabled true \
--repository-id {repo-id}
```
### Required Reviewer Policy
```bash
az repos policy required-reviewer create \
--blocking true \
--enabled true \
--branch main \
--repository-id {repo-id} \
--required-reviewers user@example.com
```
### Merge Strategy Policy
```bash
az repos policy merge-strategy create \
--blocking true \
--enabled true \
--branch main \
--repository-id {repo-id} \
--allow-squash true \
--allow-rebase true \
--allow-no-fast-forward true
```
### Case Enforcement Policy
```bash
az repos policy case-enforcement create \
--blocking true \
--enabled true \
--branch main \
--repository-id {repo-id}
```
### Comment Required Policy
```bash
az repos policy comment-required create \
--blocking true \
--enabled true \
--branch main \
--repository-id {repo-id}
```
### File Size Policy
```bash
az repos policy file-size create \
--blocking true \
--enabled true \
--branch main \
--repository-id {repo-id} \
--maximum-file-size 10485760 # 10MB in bytes
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |