Skip to content

Commit b8b31a0

Browse files
author
Joan-Angelo Enrile
committed
refactor
1 parent a9e3a04 commit b8b31a0

21 files changed

Lines changed: 839 additions & 925 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "ado-cli-skill",
3+
"owner": {
4+
"name": "yutamago"
5+
},
6+
"metadata": {
7+
"description": "AI Agent plugin marketplace for the Azure DevOps CLI",
8+
"version": "1.0.0",
9+
"homepage": "https://github.com/yutamago/ado-cli"
10+
},
11+
"plugins": [
12+
{
13+
"name": "azure-devops",
14+
"source": "./plugins/azure-devops",
15+
"description": "Skills for interacting with Azure DevOps via the ado CLI — issues, pull requests, pipeline runs, search, and repositories.",
16+
"version": "1.0.0",
17+
"author": {
18+
"name": "yutamago",
19+
"url": "https://github.com/yutamago"
20+
},
21+
"category": "workflow",
22+
"homepage": "https://github.com/yutamago/ado-cli",
23+
"keywords": ["azure-devops", "azd", "work-items", "pull-requests", "pipelines", "ci-cd"]
24+
}
25+
]
26+
}

.claude/settings.local.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"Bash(npm install:*)",
77
"Bash(node dist/index.js --help)",
88
"WebFetch(domain:github.com)",
9-
"Bash(npm run:*)"
9+
"Bash(npm run:*)",
10+
"Bash(find /home/angelo/workspaces/oss_ws/azd-skill/src -name \"*.ts\" -type f -exec wc -l {} +)"
1011
]
11-
}
12+
},
13+
"enabledPlugins": {}
1214
}

CLAUDE.md

Lines changed: 1 addition & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -36,70 +36,6 @@ src/
3636
errors/index.ts # AzdError, AuthError, NotFoundError, ConfigError
3737
```
3838

39-
## Commands Reference
40-
41-
### Auth
42-
| Command | Description |
43-
|---|---|
44-
| `azd auth login` | OAuth browser login (default); device-code for headless/CI |
45-
| `azd auth logout` | Remove stored credentials |
46-
| `azd auth status` | Show org, auth type, username, default project |
47-
48-
### Issues (Work Items)
49-
| Command | Description |
50-
|---|---|
51-
| `azd issue list` | List work items (`--state`, `--assignee`, `--tag`, `--type`, `--web`) |
52-
| `azd issue view <id>` | Work item details (`--comments`, `--web`) |
53-
| `azd issue create` | Create work item (`--type`, `--title`, `--description`, `--assignee`, `--tags`) |
54-
| `azd issue edit <id>` | Update work item fields |
55-
| `azd issue close <id>` | Set state to Closed/Resolved |
56-
| `azd issue reopen <id>` | Set state back to Active |
57-
| `azd issue comment <id>` | Add comment (`--body` or `$EDITOR`) |
58-
| `azd issue status` | Show items assigned to / created by you |
59-
| `azd issue develop <id>` | Create branch linked to work item |
60-
61-
### Pull Requests
62-
| Command | Description |
63-
|---|---|
64-
| `azd pr list` | List PRs (`--state`, `--author`, `--repo`, `--web`) |
65-
| `azd pr view <pr>` | PR details (`--comments`, `--web`) |
66-
| `azd pr comment <pr>` | Add comment (`--body` or `$EDITOR`) |
67-
| `azd pr diff <pr>` | Unified diff (`--color`, `--exclude`, `--name-only`, `--patch`, `--web`) |
68-
| `azd pr create` | Create PR (`--title`, `--body`, `--draft`, `--source-branch`, `--target-branch`) |
69-
| `azd pr review <pr>` | Approve/reject (`--approve`, `--reject`, `--comment`) |
70-
71-
### Pipeline Runs
72-
| Command | Description |
73-
|---|---|
74-
| `azd run list` | List recent runs (`--status`, `--branch`, `--limit`, `--web`) |
75-
| `azd run view <run-id>` | Run details (`--web`) |
76-
| `azd run watch <run-id>` | Stream live status until completion |
77-
| `azd run cancel <run-id>` | Cancel an in-progress run |
78-
| `azd run rerun <run-id>` | Re-queue a completed/failed run |
79-
| `azd run download <run-id>` | Download build artifacts |
80-
| `azd run delete <run-id>` | Delete pipeline run record |
81-
82-
### Search
83-
| Command | Description |
84-
|---|---|
85-
| `azd search issues <query>` | Search work items via WIQL |
86-
| `azd search code <query>` | Search code via Azure Search REST API (`--repo`, `--limit`) |
87-
| `azd search commits <query>` | Search commits (client-side filter) |
88-
| `azd search prs <query>` | Search PRs (client-side filter) |
89-
| `azd search repos <query>` | List/filter repositories |
90-
| `azd search projects <query>` | List/filter Azure DevOps projects |
91-
92-
### Repo
93-
| Command | Description |
94-
|---|---|
95-
| `azd repo list` | List repositories |
96-
| `azd repo clone <repo>` | Clone a repository |
97-
98-
### Other
99-
| Command | Description |
100-
|---|---|
101-
| `azd completion` | Generate shell completion script (bash/zsh/fish/powershell) |
102-
10339
## Authentication Architecture
10440

10541
Credential resolution order in `src/api/client.ts`:
@@ -137,7 +73,7 @@ Git remote formats supported:
13773

13874
## Keeping the Plugin Reference Up to Date
13975

140-
`plugins/azd/skills/azd-cli/reference.md` is the authoritative CLI reference used by the azd plugin skill.
76+
`plugins/azd/skills/azd-cli/reference.md` is the authoritative CLI reference used by the ado plugin skill.
14177

14278
**Update it whenever you:**
14379
- Add, rename, or remove a command or subcommand

README.md

Lines changed: 56 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
1-
# azd-cli
2-
3-
Azure DevOps CLI for agents — mirrors [GitHub CLI](https://cli.github.com/) (`gh`) conventions.
1+
# ado-cli
2+
An Azure DevOps CLI, mimicking the known and loved Github CLI syntax.
43

54
## Installation
65

76
```bash
8-
npm install -g azd-cli
7+
npm install -g ado-cli
98
```
109

1110
**Prerequisites:** Node.js 18 or later, an Azure DevOps account.
1211

13-
---
12+
13+
### Installing the Plugin in your AI Agent
14+
15+
```bash
16+
copilot plugin marketplace add https://github.com/yutamago/ado-cli.git
17+
claude plugin marketplace add https://github.com/yutamago/ado-cli.git
18+
```
19+
1420

1521
## Authentication
1622

1723
```bash
18-
azd auth login # Browser OAuth (default)
19-
azd auth login --device # Device-code flow for headless/CI environments
20-
azd auth status # Show current auth state
21-
azd auth logout # Remove stored credentials
24+
ado auth login # Browser OAuth (default)
25+
ado auth login --device # Device-code flow for headless/CI environments
26+
ado auth status # Show current auth state
27+
ado auth logout # Remove stored credentials
2228
```
2329

2430
After login you will be prompted to select a default organization and project. These can also be set via environment variables:
@@ -30,82 +36,80 @@ AZURE_DEVOPS_PROJECT=my-project
3036

3137
For CI pipelines, set `SYSTEM_ACCESSTOKEN` (Azure Pipelines built-in) or `AZURE_DEVOPS_TOKEN` (PAT) — no login step required.
3238

33-
---
3439

3540
## Commands
3641

3742
### Issues (Work Items)
3843

3944
```bash
40-
azd issue list # List work items
41-
azd issue list --state Active --assignee @me
42-
azd issue view <id> # Work item details
43-
azd issue view <id> --comments
44-
azd issue create --title "Bug report" --type Bug
45-
azd issue edit <id> --state Resolved
46-
azd issue close <id>
47-
azd issue reopen <id>
48-
azd issue comment <id> --body "LGTM"
49-
azd issue status # Items assigned to / created by you
50-
azd issue develop <id> # Create a branch linked to the work item
45+
ado issue list # List work items
46+
ado issue list --state Active --assignee @me
47+
ado issue view <id> # Work item details
48+
ado issue view <id> --comments
49+
ado issue create --title "Bug report" --type Bug
50+
ado issue edit <id> --state Resolved
51+
ado issue close <id>
52+
ado issue reopen <id>
53+
ado issue comment <id> --body "LGTM"
54+
ado issue status # Items assigned to / created by you
55+
ado issue develop <id> # Create a branch linked to the work item
5156
```
5257

5358
### Pull Requests
5459

5560
```bash
56-
azd pr list
57-
azd pr list --state abandoned --author @me
58-
azd pr view <pr>
59-
azd pr view <pr> --comments
60-
azd pr diff <pr>
61-
azd pr diff <pr> --name-only
62-
azd pr comment <pr> --body "Looks good"
63-
azd pr create --title "My PR" --draft
64-
azd pr review <pr> --approve
65-
azd pr review <pr> --reject --comment "Needs changes"
61+
ado pr list
62+
ado pr list --state abandoned --author @me
63+
ado pr view <pr>
64+
ado pr view <pr> --comments
65+
ado pr diff <pr>
66+
ado pr diff <pr> --name-only
67+
ado pr comment <pr> --body "Looks good"
68+
ado pr create --title "My PR" --draft
69+
ado pr review <pr> --approve
70+
ado pr review <pr> --reject --comment "Needs changes"
6671
```
6772

6873
### Pipeline Runs
6974

7075
```bash
71-
azd run list
72-
azd run list --status failed --branch main
73-
azd run view <run-id>
74-
azd run watch <run-id>
75-
azd run cancel <run-id>
76-
azd run rerun <run-id>
77-
azd run download <run-id>
78-
azd run delete <run-id>
76+
ado run list
77+
ado run list --status failed --branch main
78+
ado run view <run-id>
79+
ado run watch <run-id>
80+
ado run cancel <run-id>
81+
ado run rerun <run-id>
82+
ado run download <run-id>
83+
ado run delete <run-id>
7984
```
8085

8186
### Search
8287

8388
```bash
84-
azd search issues "memory leak"
85-
azd search code "TodoController" --repo my-repo
86-
azd search commits "fix auth"
87-
azd search prs "login"
88-
azd search repos "api"
89-
azd search projects "platform"
89+
ado search issues "memory leak"
90+
ado search code "TodoController" --repo my-repo
91+
ado search commits "fix auth"
92+
ado search prs "login"
93+
ado search repos "api"
94+
ado search projects "platform"
9095
```
9196

9297
### Repositories
9398

9499
```bash
95-
azd repo list
96-
azd repo clone <repo>
100+
ado repo list
101+
ado repo clone <repo>
97102
```
98103

99104
### Shell Completions
100105

101106
```bash
102-
azd completion bash >> ~/.bashrc
103-
azd completion zsh >> ~/.zshrc
104-
azd completion fish > ~/.config/fish/completions/azd.fish
105-
azd completion powershell >> $PROFILE
107+
ado completion bash >> ~/.bashrc
108+
ado completion zsh >> ~/.zshrc
109+
ado completion fish > ~/.config/fish/completions/azd.fish
110+
ado completion powershell >> $PROFILE
106111
```
107112

108-
---
109113

110114
## Output Modes
111115

@@ -118,7 +122,6 @@ azd completion powershell >> $PROFILE
118122

119123
Non-TTY output is optimized for agent consumption (GitHub Copilot, Claude, etc.).
120124

121-
---
122125

123126
## Configuration
124127

@@ -135,7 +138,6 @@ Supported remote URL formats:
135138
- `https://{org}.visualstudio.com/{project}/_git/{repo}`
136139
- `git@ssh.dev.azure.com:v3/{org}/{project}/{repo}`
137140

138-
---
139141

140142
## License
141143

TODO.md

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,45 +5,45 @@
55
- [x] Foundation modules (errors, config, auth/store)
66
- [x] API client factory (azure-devops-node-api, PAT auth)
77
- [x] Output module (TTY/non-TTY, table/detail/json)
8-
- [x] `azd auth login` — PAT-based auth with keytar + file fallback
9-
- [x] `azd issue list` — list work items with state/assignee/tag/type filters
10-
- [x] `azd issue view <id>` — work item detail view with optional comments
11-
- [x] `azd pr list` — list PRs with state/author/repo filters
12-
- [x] `azd pr view <pr>` — PR detail with optional comment threads
13-
- [x] `azd pr comment <pr>` — add comment (--body or $EDITOR)
14-
- [x] `azd pr diff <pr>` — real unified diff with `--color`, `--exclude`, `--name-only`, `--patch`, `--web` flags matching `gh pr diff`
8+
- [x] `ado auth login` — PAT-based auth with keytar + file fallback
9+
- [x] `ado issue list` — list work items with state/assignee/tag/type filters
10+
- [x] `ado issue view <id>` — work item detail view with optional comments
11+
- [x] `ado pr list` — list PRs with state/author/repo filters
12+
- [x] `ado pr view <pr>` — PR detail with optional comment threads
13+
- [x] `ado pr comment <pr>` — add comment (--body or $EDITOR)
14+
- [x] `ado pr diff <pr>` — real unified diff with `--color`, `--exclude`, `--name-only`, `--patch`, `--web` flags matching `gh pr diff`
1515
- [x] OAuth browser login as default auth (MSAL `acquireTokenInteractive`); device code flow for headless/CI
1616
- [x] DEP0169 deprecation warning suppression (upstream: azure-devops-node-api#664, fix: PR#662)
17-
- [x] `azd search issues <query>` — search work items via WIQL
18-
- [x] `azd search code <query>` — search code via Azure Search REST API
19-
- [x] `azd search commits <query>` — search commits (client-side filter)
20-
- [x] `azd search prs <query>` — search PRs (client-side filter)
21-
- [x] `azd search repos <query>` — list/filter repositories
22-
- [x] `azd auth status` — show current auth state
23-
- [x] `azd auth logout` — remove stored credentials
17+
- [x] `ado search issues <query>` — search work items via WIQL
18+
- [x] `ado search code <query>` — search code via Azure Search REST API
19+
- [x] `ado search commits <query>` — search commits (client-side filter)
20+
- [x] `ado search prs <query>` — search PRs (client-side filter)
21+
- [x] `ado search repos <query>` — list/filter repositories
22+
- [x] `ado auth status` — show current auth state
23+
- [x] `ado auth logout` — remove stored credentials
2424
- [x] After login: numbered list project selector (TTY) / plain stdin line-read (non-TTY, AI agent compatible)
25-
- [x] `azd issue create` — create a new work item (type, title, description, assignee, tags)
26-
- [x] `azd issue edit <id>` — update title, description, state, assignee, tags on an existing work item
27-
- [x] `azd issue close <id>` — set work item state to Closed/Resolved
28-
- [x] `azd issue reopen <id>` — set work item state back to Active
29-
- [x] `azd issue comment <id>` — add a comment to a work item (mirrors `azd pr comment`)
30-
- [x] `azd issue status` — show work items assigned to you / created by you
31-
- [x] `azd issue list --web` / `azd issue view --web` — open in browser
32-
- [x] `azd issue develop <id>` — create a branch linked to a work item (`GitApi.updateRefs` + `WorkItemTrackingApi.updateWorkItem` with ArtifactLink relation)
33-
- [x] `azd pr create` — create a pull request
34-
- [x] `azd pr review` — approve/reject a PR
35-
- [x] `azd pr list --web` / `azd pr view --web` — open in browser
36-
- [x] `azd search projects <query>` — list/filter Azure DevOps projects (`CoreApi.getProjects` + client-side filter)
37-
- [x] `azd repo list` — list repositories
38-
- [x] `azd repo clone` — clone a repository
39-
- [x] `azd run list` — list recent pipeline runs (`BuildApi.getBuilds`)
40-
- [x] `azd run view <run-id>` — show details of a specific run; `--web` to open in browser
41-
- [x] `azd run watch <run-id>` — stream live status until run completes
42-
- [x] `azd run cancel <run-id>` — cancel an in-progress run (`BuildApi.updateBuild` status=Cancelling)
43-
- [x] `azd run rerun <run-id>` — re-queue a completed/failed run (`BuildApi.updateBuild` retry=true)
44-
- [x] `azd run download <run-id>` — download build artifacts (`BuildApi.getArtifacts`)
45-
- [x] `azd run delete <run-id>` — delete a pipeline run record
46-
- [x] `azd completion` — generate shell completion scripts (bash/zsh/fish/powershell)
25+
- [x] `ado issue create` — create a new work item (type, title, description, assignee, tags)
26+
- [x] `ado issue edit <id>` — update title, description, state, assignee, tags on an existing work item
27+
- [x] `ado issue close <id>` — set work item state to Closed/Resolved
28+
- [x] `ado issue reopen <id>` — set work item state back to Active
29+
- [x] `ado issue comment <id>` — add a comment to a work item (mirrors `ado pr comment`)
30+
- [x] `ado issue status` — show work items assigned to you / created by you
31+
- [x] `ado issue list --web` / `ado issue view --web` — open in browser
32+
- [x] `ado issue develop <id>` — create a branch linked to a work item (`GitApi.updateRefs` + `WorkItemTrackingApi.updateWorkItem` with ArtifactLink relation)
33+
- [x] `ado pr create` — create a pull request
34+
- [x] `ado pr review` — approve/reject a PR
35+
- [x] `ado pr list --web` / `ado pr view --web` — open in browser
36+
- [x] `ado search projects <query>` — list/filter Azure DevOps projects (`CoreApi.getProjects` + client-side filter)
37+
- [x] `ado repo list` — list repositories
38+
- [x] `ado repo clone` — clone a repository
39+
- [x] `ado run list` — list recent pipeline runs (`BuildApi.getBuilds`)
40+
- [x] `ado run view <run-id>` — show details of a specific run; `--web` to open in browser
41+
- [x] `ado run watch <run-id>` — stream live status until run completes
42+
- [x] `ado run cancel <run-id>` — cancel an in-progress run (`BuildApi.updateBuild` status=Cancelling)
43+
- [x] `ado run rerun <run-id>` — re-queue a completed/failed run (`BuildApi.updateBuild` retry=true)
44+
- [x] `ado run download <run-id>` — download build artifacts (`BuildApi.getArtifacts`)
45+
- [x] `ado run delete <run-id>` — delete a pipeline run record
46+
- [x] `ado completion` — generate shell completion scripts (bash/zsh/fish/powershell)
4747
- [x] `--web` / `-w` flag audit — added to: `issue list`, `issue view`, `pr list`, `pr view`, `run list`, `run view`
4848

4949
## Backlog

0 commit comments

Comments
 (0)