Quick Start
1. Authenticate
Section titled “1. Authenticate”# Interactive (stores credentials locally)adtk auth
# Or via environment variablesexport AZURE_DEVOPS_ORG=myorgexport AZURE_DEVOPS_PAT=your-pat-here2. List Projects
Section titled “2. List Projects”adtk projects listOutput:
NAME ID STATEMyProject a1b2c3d4-e5f6-7890-abcd-ef1234567890 wellFormedAnotherProject b2c3d4e5-f6a7-8901-bcde-f12345678901 wellFormed3. Get a Work Item
Section titled “3. Get a Work Item”adtk work-items get 42Output:
ID: 42Type: User StoryTitle: Implement login pageState: ActiveAssigned To: jane@example.comPriority: 2Tags: frontend; authAuto-detect from git branch
Section titled “Auto-detect from git branch”If your branch name contains a work item ID (e.g., feature/12345-add-login), you can omit the ID:
# On branch feature/42-implement-loginadtk work-items get# Automatically detects work item 42 from the branch name3b. View Work Item Metrics
Section titled “3b. View Work Item Metrics”adtk work-items metrics 42 -p MyProjectOutput:
Current Status: ActiveCycle Time: 3d 4hLead Time: 5d 12h
Time in Status: New: 1d 8h Active: 3d 4h
Status Transitions: FROM TO AT New 2025-01-10 09:00 New Active 2025-01-11 17:004. Search with WIQL
Section titled “4. Search with WIQL”adtk search wiql "SELECT [System.Id], [System.Title], [System.State] \ FROM WorkItems \ WHERE [System.State] = 'Active' \ AND [System.AssignedTo] = @Me \ ORDER BY [System.ChangedDate] DESC"5. Search Code
Section titled “5. Search Code”adtk search code "func main" -p MyProject6. Enable Writes and Create a Work Item
Section titled “6. Enable Writes and Create a Work Item”export ADTK_ENABLE_WRITES=true
adtk work-items create -p MyProject \ --type "User Story" \ --title "Add dark mode support" \ --description "Implement dark mode toggle in the settings page" \ --priority 2 \ --tags "frontend;ux"7. List Pull Requests
Section titled “7. List Pull Requests”adtk pull-requests list myrepo -p MyProject8. View Pipeline Runs
Section titled “8. View Pipeline Runs”adtk pipelines list -p MyProjectadtk pipelines runs 42 -p MyProject9. Check Current Sprint
Section titled “9. Check Current Sprint”adtk iterations current -p MyProject10. Get JSON Output
Section titled “10. Get JSON Output”Every command supports --json for raw JSON output, useful for scripting:
adtk projects list --json | jq '.[].name'Using as an MCP Server
Section titled “Using as an MCP Server”stdio mode (for AI agents)
Section titled “stdio mode (for AI agents)”adtk mcpHTTP Streamable mode
Section titled “HTTP Streamable mode”adtk mcp --port 8080Example MCP Interaction
Section titled “Example MCP Interaction”An AI agent using adtk might:
Tool: manage_work_itemsInput: { "action": "get", "work_item_id": 42 }
Tool: manage_searchInput: { "action": "wiql", "query": "SELECT [System.Id] FROM WorkItems WHERE [System.State] = 'Active'", "project_key": "MyProject" }
Tool: manage_pull_requestsInput: { "action": "list", "repo_id": "my-repo", "project_key": "MyProject", "status": "active" }Next Steps
Section titled “Next Steps”- Usage Examples — Real-world workflows
- WIQL Guide — Master Azure DevOps queries
- Architecture — How adtk works under the hood