Skip to content

Commit 73fa0a7

Browse files
author
Joan-Angelo Enrile
committed
refactor: Adjusted the parsing of remote URLs to include repository information.
1 parent 5a11c13 commit 73fa0a7

36 files changed

Lines changed: 212 additions & 152 deletions

.claude-plugin/marketplace.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@
55
},
66
"metadata": {
77
"description": "AI Agent plugin marketplace for the Azure DevOps CLI",
8-
"version": "1.0.0",
8+
"version": "1.0.3",
99
"homepage": "https://github.com/yutamago/ado-cli"
1010
},
1111
"plugins": [
1212
{
1313
"name": "azure-devops",
1414
"source": "./plugins/azure-devops",
1515
"description": "Skills for interacting with Azure DevOps via the ado CLI — issues, pull requests, pipeline runs, search, and repositories.",
16-
"version": "1.0.0",
16+
"version": "1.0.3",
1717
"author": {
1818
"name": "yutamago",
1919
"url": "https://github.com/yutamago"
2020
},
2121
"category": "workflow",
2222
"homepage": "https://github.com/yutamago/ado-cli",
23-
"keywords": ["azure-devops", "azd", "work-items", "pull-requests", "pipelines", "ci-cd"]
23+
"keywords": ["azure-devops", "ado", "work-items", "pull-requests", "pipelines", "ci-cd"]
2424
}
2525
]
2626
}

.vscode/launch.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "ado: debug local (bun)",
6+
"type": "bun",
7+
"request": "launch",
8+
"program": "${workspaceFolder}/src/index.ts",
9+
"args": [
10+
"pr",
11+
"list"
12+
],
13+
"cwd": "/home/angelo/workspaces/stp_ws/Winsolvenz.Assist"
14+
}
15+
]
16+
}

CLAUDE.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ src/
2121
builds.ts # Pipeline run list/view/cancel/rerun/download/delete
2222
search.ts # Code (Azure Search REST), commits, repos (client-side filter)
2323
auth/
24-
store.ts # Keytar + ~/.azd/credentials.json fallback
24+
store.ts # Keytar + ~/.ado/credentials.json fallback
2525
oauth.ts # MSAL OAuth2 (browser + device-code flows)
2626
commands/
2727
auth/ # login, logout, status
@@ -31,9 +31,9 @@ src/
3131
search/ # issues, code, commits, prs, repos, projects
3232
repo/ # list, clone
3333
completion.ts # Shell completions (bash/zsh/fish/powershell)
34-
config/index.ts # Config load: CLI > env > git remote > ~/.azd/config.json
34+
config/index.ts # Config load: CLI > env > git remote > ~/.ado/config.json
3535
output/index.ts # TTY/non-TTY formatting, table, detail, JSON
36-
errors/index.ts # AzdError, AuthError, NotFoundError, ConfigError
36+
errors/index.ts # AdoError, AuthError, NotFoundError, ConfigError
3737
```
3838

3939
## Authentication Architecture
@@ -43,13 +43,13 @@ Credential resolution order in `src/api/client.ts`:
4343
2. `AZURE_DEVOPS_TOKEN` env var — explicit PAT for scripts/CI
4444
3. Stored credential (OAuth token or PAT) — persisted across sessions
4545

46-
OAuth uses MSAL `PublicClientApplication` with browser redirect (loopback), falling back to device-code for headless environments. Tokens are stored via keytar (native credential manager) with `~/.azd/credentials.json` as a file fallback.
46+
OAuth uses MSAL `PublicClientApplication` with browser redirect (loopback), falling back to device-code for headless environments. Tokens are stored via keytar (native credential manager) with `~/.ado/credentials.json` as a file fallback.
4747

48-
Config location: `~/.azd/` (`config.json`, `credentials.json`, `oauth-cache.json`)
48+
Config location: `~/.ado/` (`config.json`, `credentials.json`, `oauth-cache.json`)
4949

5050
## Configuration Resolution Order
5151

52-
CLI flags → environment variables → git remote (auto-detect org/project) → `~/.azd/config.json`
52+
CLI flags → environment variables → git remote (auto-detect org/project) → `~/.ado/config.json`
5353

5454
Environment variables: `AZURE_DEVOPS_TOKEN`, `SYSTEM_ACCESSTOKEN`, `AZURE_DEVOPS_ORG`, `AZURE_DEVOPS_PROJECT`
5555

@@ -73,7 +73,7 @@ Git remote formats supported:
7373

7474
## Keeping the Plugin Reference Up to Date
7575

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

7878
**Update it whenever you:**
7979
- Add, rename, or remove a command or subcommand
@@ -86,7 +86,7 @@ Keep the reference in sync with the source — it is generated from the actual `
8686

8787
## Core Principles
8888

89-
- `azd` commands should work the same as their `gh` counterparts, unless the Azure DevOps API makes this impossible.
89+
- `ado` commands should work the same as their `gh` counterparts, unless the Azure DevOps API makes this impossible.
9090
- If the user uses an unrecognized command, return a clear message explaining the wrong usage and how to properly use the command.
9191
- The core target audience for this CLI is Agents (such as Claude and GitHub Copilot).
9292

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2026 azd-cli contributors
3+
Copyright (c) 2026 ado-cli contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ ado repo clone <repo>
122122
```bash
123123
ado completion bash >> ~/.bashrc
124124
ado completion zsh >> ~/.zshrc
125-
ado completion fish > ~/.config/fish/completions/azd.fish
125+
ado completion fish > ~/.config/fish/completions/ado.fish
126126
ado completion powershell >> $PROFILE
127127
```
128128

@@ -146,7 +146,7 @@ Config is resolved in this order:
146146
1. CLI flags (`--org`, `--project`)
147147
2. Environment variables (`AZURE_DEVOPS_ORG`, `AZURE_DEVOPS_PROJECT`)
148148
3. Git remote (auto-detected from `origin`)
149-
4. `~/.azd/config.json`
149+
4. `~/.ado/config.json`
150150

151151
Supported remote URL formats:
152152

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ado-cli",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "An Azure DevOps CLI, mimicking the known and loved Github CLI syntax.",
55
"main": "./dist/index.js",
66
"bin": {

plugins/azure-devops/plugin.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "azd",
3-
"version": "1.0.0",
2+
"name": "ado",
3+
"version": "1.0.3",
44
"description": "Azure DevOps skills for AI Agents — issues, pull requests, pipeline runs, search, and repositories.",
55
"author": {
66
"name": "yutamago",

plugins/azure-devops/skills/azure-devops/SKILL.md

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ description: >
1414

1515
# ado CLI Skill
1616

17-
`azd` is an Azure DevOps CLI optimized for agentic use. It mirrors GitHub CLI (`gh`) conventions so commands map predictably. All commands are non-interactive by default; TTY output is styled tables, non-TTY output is tab-separated plain text (pipeline-safe). Use `--json` for structured JSON.
17+
`ado` is an Azure DevOps CLI optimized for agentic use. It mirrors GitHub CLI (`gh`) conventions so commands map predictably. All commands are non-interactive by default; TTY output is styled tables, non-TTY output is tab-separated plain text (pipeline-safe). Use `--json` for structured JSON.
1818

19-
## First Run: Detect Installation
19+
## On Errors: Detect Installation
2020

21-
**Run this check once at the start of each session, before any other command.**
21+
**Run this check once per session if the first `ado` command fails, before continuing with any other command.**
2222

2323
Check for the `ado` binary in this order:
2424

@@ -59,22 +59,15 @@ Once installed, run `ado --version` to confirm, then retry your original request
5959

6060
## Authentication
6161

62-
Credential resolution order (highest to lowest priority):
63-
64-
1. `SYSTEM_ACCESSTOKEN` env var — Azure Pipelines built-in token (CI)
65-
2. `AZURE_DEVOPS_TOKEN` env var — explicit PAT for scripts/CI
66-
3. Stored credential from `ado auth login` (OAuth token or PAT)
67-
68-
### Login
69-
62+
If the CLI returns an authentication error, prompt the user to run one of the following commands to log in:
7063
```bash
7164
ado auth login # OAuth browser flow (default)
7265
ado auth login --with-token # PAT via stdin: echo $PAT | ado auth login --with-token
7366
ado auth login --token <pat> # PAT inline
74-
ado auth login --org <url> # Specify org URL at login time
67+
ado auth login --org <url> # Specify org URL at login time
7568
```
7669

77-
After login, select a default project interactively, or set env vars:
70+
After login, the CLI attempts to select a default project interactively, or set env vars:
7871

7972
```bash
8073
export AZURE_DEVOPS_ORG=https://dev.azure.com/myorg
@@ -89,7 +82,7 @@ ado auth status --json
8982

9083
## Configuration Resolution Order
9184

92-
CLI flags → environment variables → git remote (auto-detect) → `~/.azd/config.json`
85+
CLI flags → environment variables → git remote (auto-detect) → `~/.ado/config.json`
9386

9487
Git remote formats supported: `https://dev.azure.com/{org}/{project}/_git/{repo}`, `https://{org}.visualstudio.com/{project}/_git/{repo}`, `git@ssh.dev.azure.com:v3/{org}/{project}/{repo}`
9588

@@ -232,4 +225,4 @@ ado repo clone my-repo ./local-dir
232225

233226
For the complete flag inventory (every flag, short alias, default, and accepted values for every subcommand), read:
234227

235-
`${CLAUDE_PLUGIN_ROOT}/skills/azd-cli/reference.md`
228+
`${CLAUDE_PLUGIN_ROOT}/skills/ado-cli/reference.md`

src/api/pullRequests.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
import { createTwoFilesPatch } from 'diff';
77
import { minimatch } from 'minimatch';
88
import { handleApiError } from '../errors/index.js';
9-
import { AzdError } from '../errors/index.js';
9+
import { AdoError } from '../errors/index.js';
1010

1111
export interface PrSummary {
1212
id: number;
@@ -282,7 +282,7 @@ export async function getPrDiff(
282282
const targetCommit = pr.lastMergeTargetCommit?.commitId;
283283

284284
if (!sourceCommit || !targetCommit) {
285-
throw new AzdError('PR does not have committed changes yet.');
285+
throw new AdoError('PR does not have committed changes yet.');
286286
}
287287

288288
// Get changed files from the latest iteration
@@ -415,7 +415,7 @@ export async function reviewPullRequest(
415415
const connData = await connection.connect();
416416
const userId = connData?.authenticatedUser?.id;
417417
if (!userId) {
418-
throw new AzdError('Could not determine current user identity.');
418+
throw new AdoError('Could not determine current user identity.');
419419
}
420420

421421
await gitApi.createPullRequestReviewer(
@@ -441,13 +441,13 @@ export async function resolveRepo(
441441
const repos = await gitApi.getRepositories(project);
442442

443443
if (!repos || repos.length === 0) {
444-
throw new AzdError(`No repositories found in project '${project}'.`);
444+
throw new AdoError(`No repositories found in project '${project}'.`);
445445
}
446446
if (repos.length === 1) {
447447
return repos[0].name ?? '';
448448
}
449449

450-
throw new AzdError(
450+
throw new AdoError(
451451
`Multiple repositories found. Specify one with --repo:\n` +
452452
repos.map(r => ` ${r.name}`).join('\n')
453453
);

src/auth/store.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as fs from 'fs';
22
import * as path from 'path';
33
import { getConfigDir } from '../config/index.js';
44

5-
const KEYTAR_SERVICE = 'azd-cli';
5+
const KEYTAR_SERVICE = 'ado-cli';
66
const KEYTAR_OAUTH_CACHE_ACCOUNT = '__oauth_cache__';
77

88
const CREDENTIALS_FILE = path.join(getConfigDir(), 'credentials.json');

0 commit comments

Comments
 (0)