azdo-cli 0.21.0 → 0.22.0-ci-harden-workflow.876
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -9,13 +9,14 @@ Azure DevOps CLI focused on work item read/write workflows.
|
|
|
9
9
|
## Features
|
|
10
10
|
|
|
11
11
|
- Retrieve work items with readable output (`get-item`)
|
|
12
|
+
- List work items by state, tag, assignee or title (`list-items`)
|
|
12
13
|
- Update work item state, assignee, or any field (`set-state`, `assign`, `set-field`)
|
|
13
14
|
- Create or update work items from markdown documents (`upsert`)
|
|
14
15
|
- Read and post work item comments (`comments`)
|
|
15
16
|
- Attach a local file to a work item, or remove a named attachment (`add-attachment`, `delete-attachment`)
|
|
16
17
|
- Read/write rich-text fields as markdown (`get-md-field`, `set-md-field`)
|
|
17
18
|
- Download images embedded in rich-text fields, optionally resized for LLM use (`get-item`/`get-md-field` `--download-images`, `--resize-images`)
|
|
18
|
-
-
|
|
19
|
+
- List pull requests with their draft state, dates, reviewers, labels and linked work item ids (`pr list --work-items`), check branch pull request status, open PRs to `develop` (optionally pre-filled from a repository-defined template), update an existing PR's title or description (`pr update`), abandon or reactivate one (`pr abandon` / `pr reactivate`), list PR comment threads for any PR (`--pr-number`), resolve/reopen threads, link/unlink work items, and add/remove required or optional reviewers — all from the CLI (`pr`)
|
|
19
20
|
- Feed long PR titles, descriptions and comment bodies from a file or a pipe instead of the shell (`--title-file`, `--description-file`, `--file`; `-` reads standard input)
|
|
20
21
|
- Persist org/project/default fields in local config (`config`)
|
|
21
22
|
- List all fields of a work item (`list-fields`)
|
|
@@ -44,10 +45,14 @@ azdo config set credentialStore dpapi --copy-credentials
|
|
|
44
45
|
|
|
45
46
|
# Read a work item
|
|
46
47
|
azdo get-item 12345
|
|
48
|
+
azdo get-item 12345 --json # machine-readable: identities, tags and all relations incl. pull requests
|
|
47
49
|
|
|
48
50
|
# Download images embedded in a work item's rich-text fields (opt-in)
|
|
49
51
|
azdo get-item 12345 --download-images # saved to the system temp dir
|
|
50
52
|
azdo get-item 12345 --resize-images 1024 --images-path ./img # cap width at 1024px, save as PNG
|
|
53
|
+
|
|
54
|
+
# List work items (--state, --tag, --assigned-to [@me], --title-contains, --top, --json)
|
|
55
|
+
azdo list-items --state Active --tag ready --json
|
|
51
56
|
azdo get-md-field 12345 System.Description --download-images # same flags on get-md-field
|
|
52
57
|
|
|
53
58
|
# Update state
|
|
@@ -67,9 +72,11 @@ azdo delete-attachment 12345 screenshot.png --yes # skip the prompt (scr
|
|
|
67
72
|
azdo delete-attachment 12345 screenshot.png --id <guid> # disambiguate when the name is shared
|
|
68
73
|
|
|
69
74
|
# Find a pull request — one API call, any branch
|
|
70
|
-
azdo pr list # active PRs in the repository
|
|
71
|
-
azdo pr list --branch feature/x --json # id, title, source/target, author, url, description
|
|
75
|
+
azdo pr list # active PRs in the repository ([active, draft] marks a draft)
|
|
76
|
+
azdo pr list --branch feature/x --json # id, title, source/target, author, url, description, isDraft,
|
|
77
|
+
# creationDate, closedDate, reviewers (uniqueName, vote), labels
|
|
72
78
|
azdo pr list --status all --top 50
|
|
79
|
+
azdo pr list --work-items --json # + workItemIds per PR: the whole PR ↔ work item map in one call
|
|
73
80
|
|
|
74
81
|
# PR comment threads — list, filter, target by number, resolve or reopen
|
|
75
82
|
azdo pr comments # active-branch PR; code-anchored threads show file:line
|
|
@@ -80,13 +87,16 @@ azdo pr comments --exclude-system --max-chars 500 # human comments only, trun
|
|
|
80
87
|
azdo pr comments --thread 148 # a single thread, by id (selector: exit 1 if absent)
|
|
81
88
|
azdo pr comments --contains '"kind":"review-plan"' # threads holding a literal substring
|
|
82
89
|
azdo pr status # PR checks (status + branch policies + pipeline builds) + code-comment counts
|
|
90
|
+
azdo pr status --branch feature/x --json # same view for another branch, nothing checked out
|
|
91
|
+
azdo pr status --pr-number 64 # same view for one PR by number, any status
|
|
83
92
|
azdo pr comment-resolve 17 --pr-number 64 # idempotent: exit 0 even when already resolved
|
|
84
93
|
azdo pr comment-reopen 17 --pr-number 64
|
|
85
94
|
|
|
86
|
-
# Write to a PR — new thread, in-place edit, reply
|
|
95
|
+
# Write to a PR — new thread, in-place edit, delete, reply
|
|
87
96
|
azdo pr comments add --file plan.md --pr-number 64 --dry-run # preview, writes nothing
|
|
88
97
|
azdo pr comments add --file plan.md --pr-number 64 # NEW thread on the overview
|
|
89
98
|
azdo pr comments edit 148 --file plan.md --pr-number 64 # rewrite it in place
|
|
99
|
+
azdo pr comments delete 148 --comment-id 3 --pr-number 64 # delete a comment (irreversible; no prompt)
|
|
90
100
|
azdo pr comments reply 148 "Great suggestion, I'll address it." # human-readable output
|
|
91
101
|
azdo pr comments reply 148 "Done." --pr-number 64 --json # JSON: { pullRequestId, threadId, commentId, content }
|
|
92
102
|
azdo pr comment-reply 148 "Done." --pr-number 64 # flat alias, identical behaviour
|
|
@@ -96,6 +106,7 @@ git log -1 --format=%B | azdo pr comments add --file - --pr-number 64 # "-"
|
|
|
96
106
|
azdo pr open --title "Fix the thing" --description "Because X was broken"
|
|
97
107
|
azdo pr open --title "Fix the thing" # uses docs/pull_request_template[/branches/<branch>].md if present
|
|
98
108
|
azdo pr open --title "Fix the thing" --description-file body.md # or --description-file - to pipe it in
|
|
109
|
+
azdo pr open --title "Fix the thing" --target master --source feature/x --draft --work-item 1234 --label bug # --work-item/--label repeat; --json adds top-level id and url
|
|
99
110
|
# The description plus the template must stay within Azure DevOps' 4000-character cap; over it,
|
|
100
111
|
# the command says by how much and creates nothing. See docs/commands.md.
|
|
101
112
|
|
|
@@ -118,6 +129,8 @@ azdo pr work-items unlink 1234 --pr-number 64
|
|
|
118
129
|
azdo pr reviewers add jane@example.com --pr-number 64 # optional by default
|
|
119
130
|
azdo pr reviewers add jane@example.com --pr-number 64 --required # required (or promotes in place)
|
|
120
131
|
azdo pr reviewers remove jane@example.com --pr-number 64
|
|
132
|
+
azdo pr reviewers list --pr-number 64 # who must review, and how each voted
|
|
133
|
+
azdo pr reviewers list --pr-number 64 --json # { pullRequestId, reviewers: [{ id, uniqueName, isRequired, vote, voteState, ... }] }
|
|
121
134
|
|
|
122
135
|
# Any pr subcommand can target another repository
|
|
123
136
|
azdo pr comments --repo other-repo --pr-number 12
|
|
@@ -128,6 +141,9 @@ azdo pipeline get-runs 12 --branch develop --limit 1
|
|
|
128
141
|
azdo pipeline wait 3456 # blocks; exit 0 success / non-zero failure / 124 timeout
|
|
129
142
|
azdo pipeline get-run-detail 3456 # errors, failing tests, per-stage status
|
|
130
143
|
azdo pipeline start 12 --branch develop --parameter env=staging
|
|
144
|
+
azdo pipeline artifacts 3456 # list a run's build artifacts (name, type, size)
|
|
145
|
+
azdo pipeline artifact-download 3456 reports --path ./out # extract into ./out (--all for every artifact, --force to overwrite)
|
|
146
|
+
azdo pipeline logs 3456 --step "Trivy" --head 50 --no-progress # also --tail/--grep; --no-progress drops CR redraws
|
|
131
147
|
|
|
132
148
|
# Work item relations — types, add, remove, list
|
|
133
149
|
azdo relations types # list all relation types (Child, Parent, Related, ...)
|
|
@@ -49,45 +49,56 @@ function parseCredentialStore(value, platform = process.platform) {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
// src/services/config-store.ts
|
|
52
|
+
var CREDENTIAL_STORE_NOTES = {
|
|
53
|
+
keyring: "OS vault, default",
|
|
54
|
+
dpapi: "Windows only; DPAPI-encrypted files under ~/.azdo/credentials"
|
|
55
|
+
};
|
|
52
56
|
var SETTINGS = [
|
|
53
57
|
{
|
|
54
58
|
key: "org",
|
|
55
59
|
description: "Azure DevOps organization name",
|
|
56
60
|
type: "string",
|
|
57
61
|
example: "mycompany",
|
|
58
|
-
required: true
|
|
62
|
+
required: true,
|
|
63
|
+
scoped: false
|
|
59
64
|
},
|
|
60
65
|
{
|
|
61
66
|
key: "project",
|
|
62
67
|
description: "Azure DevOps project name",
|
|
63
68
|
type: "string",
|
|
64
69
|
example: "MyProject",
|
|
65
|
-
required: true
|
|
70
|
+
required: true,
|
|
71
|
+
scoped: true
|
|
66
72
|
},
|
|
67
73
|
{
|
|
68
74
|
key: "fields",
|
|
69
75
|
description: "Extra work item fields to include (comma-separated reference names)",
|
|
70
76
|
type: "string[]",
|
|
71
77
|
example: "System.Tags,Custom.Priority",
|
|
72
|
-
required: false
|
|
78
|
+
required: false,
|
|
79
|
+
scoped: true
|
|
73
80
|
},
|
|
74
81
|
{
|
|
75
82
|
key: "markdown",
|
|
76
83
|
description: "Convert rich text fields to markdown on display",
|
|
77
84
|
type: "boolean",
|
|
78
85
|
example: "true",
|
|
79
|
-
required: false
|
|
86
|
+
required: false,
|
|
87
|
+
scoped: true
|
|
80
88
|
},
|
|
81
89
|
{
|
|
82
90
|
key: "credentialStore",
|
|
83
|
-
description:
|
|
91
|
+
description: "Where credentials are stored (keyring or dpapi)",
|
|
84
92
|
type: "string",
|
|
85
93
|
example: "dpapi",
|
|
86
|
-
required: false
|
|
94
|
+
required: false,
|
|
95
|
+
scoped: false,
|
|
96
|
+
values: CREDENTIAL_STORES.map((value) => ({ value, note: CREDENTIAL_STORE_NOTES[value] })),
|
|
97
|
+
env: "AZDO_CREDENTIAL_STORE"
|
|
87
98
|
}
|
|
88
99
|
];
|
|
89
100
|
var VALID_KEYS = SETTINGS.map((s) => s.key);
|
|
90
|
-
var SCOPED_KEYS =
|
|
101
|
+
var SCOPED_KEYS = SETTINGS.filter((s) => s.scoped).map((s) => s.key);
|
|
91
102
|
function getConfigPath() {
|
|
92
103
|
return path.join(os.homedir(), ".azdo", "config.json");
|
|
93
104
|
}
|
|
@@ -1178,7 +1189,7 @@ async function deletePat(org) {
|
|
|
1178
1189
|
}
|
|
1179
1190
|
try {
|
|
1180
1191
|
const { unlinkSync: unlinkSync2 } = await import("fs");
|
|
1181
|
-
const { lockPath: lockPath2 } = await import("./oauth-token-refresh-
|
|
1192
|
+
const { lockPath: lockPath2 } = await import("./oauth-token-refresh-QPPOTES2.js");
|
|
1182
1193
|
unlinkSync2(lockPath2(org));
|
|
1183
1194
|
} catch {
|
|
1184
1195
|
}
|