Skip to content

Commit 6a63f35

Browse files
committed
docs: enrich --help and skills for LLM consumption
* 27 command modules: enriched every doc: string with: - Valid values for enum options (states, types, visibility) - Default behaviors (page sizes, sort orders, output format) - Output format descriptions (table columns, JSON shape) - Argument format hints (GUID vs numeric ID vs name) - Practical usage notes (case sensitivity, required permissions) * 3 skills rewritten for LLM agent optimization: - ado-cli: structured command ref, decision tree, pitfalls, non-obvious behaviors (multi-word flags, MSA orgs, exit codes) - ado-auth: decision tree for auth method selection, troubleshooting table with version-specific fixes, CI/headless patterns - ado-ci: binary download matrix (5 platforms), PAT scope table, GitHub/GitLab CI examples, common CI pitfalls - All bumped to v0.4.3 with updated command lists * 337 tests pass, credo clean, all 8 CI stages green. * 30 files changed, +1620/-676 lines.
1 parent 3e47310 commit 6a63f35

30 files changed

Lines changed: 1620 additions & 676 deletions

lib/ado_cli/cli/agent_pools.ex

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,35 @@ defmodule AdoCli.CLI.AgentPools do
1616
def command do
1717
[
1818
name: "ado agent-pools",
19-
doc: "Manage Azure DevOps agent pools and queues.",
19+
doc:
20+
"Manage Azure DevOps agent pools and queues. Pools host agents; queues are project-scoped views into pools used for pipeline runs.",
2021
subcommands: [
2122
list: [
2223
name: "ado agent-pools list",
23-
doc: "List agent pools in the organization.",
24+
doc:
25+
"List every agent pool in the organization. Output is a table by default (ID, Name, Auto-provision, Type); pass --json for a machine-readable array. Use this to discover pool IDs for use with `pipelines-builds queue --pool` or for agent management.",
2426
execute: &list_pools/1
2527
],
2628
show: [
2729
name: "ado agent-pools show",
28-
doc: "Show details of an agent pool, including agents.",
29-
arguments: [pool_id: [type: :integer, doc: "Agent pool ID"]],
30+
doc:
31+
"Show details of an agent pool, including its agents and their status. The pool ID is an integer (not a name); use `ado agent-pools list` to look it up.",
32+
arguments: [pool_id: [type: :integer, doc: "Numeric agent pool ID"]],
3033
execute: &show_pool/1
3134
],
3235
queues: [
3336
name: "ado agent-pools queues",
34-
doc: "Manage agent queues.",
37+
doc:
38+
"Manage agent queues. A queue is a project-scoped alias for a pool — pipelines run on a queue, not a pool directly.",
3539
subcommands: [
3640
list: [
3741
name: "ado agent-pools queues list",
38-
doc: "List agent queues.",
42+
doc:
43+
"List agent queues in a project. Output is a table (ID, Name, Pool); pass --json for raw data. Use --pool to filter by a specific pool's queues.",
3944
arguments: [project: [type: :string, doc: "Project name or ID"]],
40-
options: [pool: [type: :integer, doc: "Filter by pool ID", doc_arg: "POOL_ID"]],
45+
options: [
46+
pool: [type: :integer, doc: "Filter by numeric agent pool ID", doc_arg: "POOL_ID"]
47+
],
4148
execute: &list_queues/1
4249
]
4350
]

lib/ado_cli/cli/areas.ex

Lines changed: 46 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,50 +11,83 @@ defmodule AdoCli.CLI.Areas do
1111
def command do
1212
[
1313
name: "ado areas",
14-
doc: "Manage Azure DevOps area paths (classification nodes).",
14+
doc:
15+
"Manage Azure DevOps area paths (classification nodes). Areas organize work items into a hierarchy (e.g. 'Project\\Team\\Feature') for filtering and reporting.",
1516
subcommands: [
1617
list: [
1718
name: "ado areas list",
18-
doc: "List area paths in a project.",
19+
doc:
20+
"List area paths in a project as a tree (default: only top-level; use --depth for children). Output is a hierarchical tree by default; pass --json for the raw root node with nested children.",
1921
arguments: [project: [type: :string, doc: "Project name or ID"]],
20-
options: [depth: [type: :integer, doc: "Depth of children to retrieve", doc_arg: "N"]],
22+
options: [
23+
depth: [
24+
type: :integer,
25+
doc: "Depth of children to retrieve (1 = top-level only, 2 = includes sub-areas)",
26+
doc_arg: "N"
27+
]
28+
],
2129
execute: &list_areas/1
2230
],
2331
show: [
2432
name: "ado areas show",
25-
doc: "Show details of an area path.",
33+
doc:
34+
"Show details of a single area path (ID, name, full path, structure type). Returns 404 if the path does not exist.",
2635
arguments: [
2736
project: [type: :string, doc: "Project name or ID"],
28-
area_path: [type: :string, doc: "Area path (e.g. ProjectName\Area\SubArea)"]
37+
area_path: [
38+
type: :string,
39+
doc:
40+
"Area path using backslashes (e.g. MyProject\\Area\\SubArea). Escape the backslash in shells or wrap in single quotes."
41+
]
2942
],
3043
execute: &show_area/1
3144
],
3245
create: [
3346
name: "ado areas create",
34-
doc: "Create an area path.",
47+
doc:
48+
"Create a new area path. Omit --parent to create at the project root, or pass --parent to nest under an existing area.",
3549
arguments: [project: [type: :string, doc: "Project name or ID"]],
3650
options: [
37-
name: [type: :string, required: true, doc: "Area name", doc_arg: "NAME"],
38-
parent: [type: :string, doc: "Parent area path", doc_arg: "PATH"]
51+
name: [
52+
type: :string,
53+
required: true,
54+
doc: "Name for the new area path (no backslashes)",
55+
doc_arg: "NAME"
56+
],
57+
parent: [
58+
type: :string,
59+
doc:
60+
"Parent area path to nest under (e.g. MyProject\\Team). Omit to create at the root.",
61+
doc_arg: "PATH"
62+
]
3963
],
4064
execute: &create_area/1
4165
],
4266
update: [
4367
name: "ado areas update",
44-
doc: "Rename an area path.",
68+
doc:
69+
"Rename an existing area path. Only the leaf name is changed; the path prefix is preserved.",
4570
arguments: [
4671
project: [type: :string, doc: "Project name or ID"],
47-
area_path: [type: :string, doc: "Current area path"]
72+
area_path: [type: :string, doc: "Current area path (e.g. MyProject\\OldName)"]
73+
],
74+
options: [
75+
name: [
76+
type: :string,
77+
required: true,
78+
doc: "New name (no backslashes)",
79+
doc_arg: "NAME"
80+
]
4881
],
49-
options: [name: [type: :string, required: true, doc: "New name", doc_arg: "NAME"]],
5082
execute: &update_area/1
5183
],
5284
delete: [
5385
name: "ado areas delete",
54-
doc: "Delete an area path.",
86+
doc:
87+
"Delete an area path. Fails if the area has child areas or work items still assigned to it; reassign or remove those first.",
5588
arguments: [
5689
project: [type: :string, doc: "Project name or ID"],
57-
area_path: [type: :string, doc: "Area path to delete"]
90+
area_path: [type: :string, doc: "Area path to delete (e.g. MyProject\\OldArea)"]
5891
],
5992
execute: &delete_area/1
6093
]

lib/ado_cli/cli/auth_commands.ex

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,31 @@ defmodule AdoCli.CLI.AuthCommands do
2020
def command do
2121
[
2222
name: "ado login",
23-
doc: "Authenticate with Azure DevOps.",
23+
doc:
24+
"Authenticate with Azure DevOps. Default (no --method) opens your browser for interactive OAuth sign-in. For CI or headless environments, use --method pat with a Personal Access Token. Use --method device to print a code+URL for signing in on any device. After login, credentials are stored in ~/.ado_cli/config.json with 0600 permissions.",
2425
options: [
2526
method: [
2627
type: :string,
27-
doc: "Auth method: browser (default), pat, device",
28+
doc:
29+
"Auth method. Valid: browser (default — interactive OAuth, supports AAD and MSA orgs), pat (Personal Access Token; required for CI), device (device code flow; visit URL on any device).",
2830
doc_arg: "METHOD"
2931
],
3032
org: [
3133
type: :string,
32-
doc: "Azure DevOps organization / collection name",
34+
doc:
35+
"Azure DevOps organization name. Optional for browser/device login (the org is auto-detected from the token). Required for PAT login. Can also be set via ADO_ORG env var.",
3336
doc_arg: "ORG"
3437
],
3538
server: [
3639
type: :string,
37-
doc: "Server URL for self-hosted Azure DevOps Server",
40+
doc:
41+
"Server URL for self-hosted Azure DevOps Server (e.g. https://ado.example.com). Cloud users can omit this. Can also be set via ADO_SERVER env var.",
3842
doc_arg: "URL"
3943
],
4044
pat: [
4145
type: :string,
42-
doc: "Personal Access Token (for method=pat)",
46+
doc:
47+
"Personal Access Token. Only used with --method pat. Generate at https://dev.azure.com/{org}/_usersSettings/tokens. Required scopes depend on usage: vso.work (work items), vso.code (repos, PRs), vso.project (projects/teams), vso.build (pipelines), vso.release (releases). Use 'Full access' for broadest coverage.",
4348
doc_arg: "TOKEN"
4449
]
4550
],

lib/ado_cli/cli/banners.ex

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,46 @@ defmodule AdoCli.CLI.Banners do
1111
def command do
1212
[
1313
name: "ado banners",
14-
doc: "Manage organization-wide notification banners.",
14+
doc:
15+
"Manage the organization-wide notification banner that appears at the top of the Azure DevOps web UI for every user. Useful for maintenance windows or org-wide announcements.",
1516
subcommands: [
1617
show: [
1718
name: "ado banners show",
18-
doc: "Show the current organization banner.",
19+
doc:
20+
"Show the current organization banner. Prints 'No banner configured.' if no banner is set, or the message, type, and audience level otherwise. Pass --json for raw output.",
1921
execute: &show_banner/1
2022
],
2123
set: [
2224
name: "ado banners set",
23-
doc: "Set or update the organization banner.",
25+
doc:
26+
"Set or update the organization banner. The banner appears immediately for all users in the org (or for the chosen audience level). Replaces any existing banner.",
2427
options: [
25-
message: [type: :string, required: true, doc: "Banner text", doc_arg: "MSG"],
28+
message: [
29+
type: :string,
30+
required: true,
31+
doc:
32+
"Banner text shown to users. Markdown is not supported; the text is rendered as plain text. Multi-word values do not need quoting (joined until next flag). Use @<file> or - to read from a file/stdin.",
33+
doc_arg: "MSG"
34+
],
2635
type: [
2736
type: :string,
28-
doc: "Banner type: info|warning|error (default: info)",
37+
doc:
38+
"Visual style. Valid: info (default — blue), warning (yellow), error (red). Controls the icon and color in the web UI.",
2939
doc_arg: "TYPE"
3040
],
3141
level: [
3242
type: :string,
33-
doc: "Audience level (default: projectCollection)",
43+
doc:
44+
"Audience level. Valid: projectCollection (default — whole org), project (specific project — requires the project context).",
3445
doc_arg: "LEVEL"
3546
]
3647
],
3748
execute: &set_banner/1
3849
],
3950
delete: [
4051
name: "ado banners delete",
41-
doc: "Remove the organization banner.",
52+
doc:
53+
"Remove the organization banner. Errors if no banner is set; otherwise the banner disappears immediately for all users.",
4254
execute: &delete_banner/1
4355
]
4456
]

lib/ado_cli/cli/branch_policies.ex

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,42 @@ defmodule AdoCli.CLI.BranchPolicies do
1212
def command do
1313
[
1414
name: "ado repos policies",
15-
doc: "Manage branch policies (pull request, build, status, etc.).",
15+
doc:
16+
"Manage branch policies that gate pull requests (build validation, required reviewers, status checks, etc.). A policy is a configuration object scoped to a specific branch and repository.",
1617
subcommands: [
1718
list: [
1819
name: "ado repos policies list",
19-
doc: "List branch policies in a repository.",
20+
doc:
21+
"List branch policies in a repository as a table (ID, Type, Branch, Blocking, Enabled). Use --branch to filter to a single branch (e.g. main). Pass --json for the raw array.",
2022
arguments: [
2123
project: [type: :string, doc: "Project name or ID"],
2224
repo_id: [type: :string, doc: "Repository name or ID"]
2325
],
24-
options: [branch: [type: :string, doc: "Filter by branch name", doc_arg: "BRANCH"]],
26+
options: [
27+
branch: [
28+
type: :string,
29+
doc:
30+
"Filter by branch name. Pass the full ref like 'refs/heads/main', or just 'main' (substring match)",
31+
doc_arg: "BRANCH"
32+
]
33+
],
2534
execute: &list_policies/1
2635
],
2736
show: [
2837
name: "ado repos policies show",
29-
doc: "Show details of a policy.",
38+
doc:
39+
"Show details of a single policy (ID, type, branch, repo, blocking, enabled, created date). Use `list` first to discover the policy ID.",
3040
arguments: [
3141
project: [type: :string, doc: "Project name or ID"],
3242
repo_id: [type: :string, doc: "Repository name or ID"],
33-
policy_id: [type: :integer, doc: "Policy configuration ID"]
43+
policy_id: [type: :integer, doc: "Numeric policy configuration ID (from `list`)"]
3444
],
3545
execute: &show_policy/1
3646
],
3747
create: [
3848
name: "ado repos policies create",
39-
doc: "Create a branch policy.",
49+
doc:
50+
"Create a new branch policy. The policy type is identified by a UUID; common ones are: fa4e907d-c16b-4a4c-9dfa-4906e5d171dd (Build validation), fd2167ab-9d2a-4d8b-b2c9-1cdfbb6d4c34 (Required reviewers), 0609b952-1397-4640-95ec-e121a052fb4b (Status check).",
4051
arguments: [
4152
project: [type: :string, doc: "Project name or ID"],
4253
repo_id: [type: :string, doc: "Repository name or ID"]
@@ -45,40 +56,55 @@ defmodule AdoCli.CLI.BranchPolicies do
4556
type: [
4657
type: :string,
4758
required: true,
48-
doc: "Policy type id (UUID)",
59+
doc:
60+
"Policy type UUID. Find these in the Azure DevOps UI under Project Settings > Repos > Policies > any policy > URL contains 'policyType='.",
4961
doc_arg: "TYPE_ID"
5062
],
5163
branch: [
5264
type: :string,
5365
required: true,
54-
doc: "Target branch (e.g. refs/heads/main)",
66+
doc:
67+
"Target branch as a ref (e.g. 'refs/heads/main', 'refs/heads/feature/*' for wildcards)",
5568
doc_arg: "BRANCH"
5669
],
57-
blocking: [type: :boolean, default: true, doc: "Block pull request on policy failure"]
70+
blocking: [
71+
type: :boolean,
72+
default: true,
73+
doc:
74+
"When true (default), PRs cannot be completed until the policy passes. When false, the policy is informational only."
75+
]
5876
],
5977
execute: &create_policy/1
6078
],
6179
update: [
6280
name: "ado repos policies update",
63-
doc: "Update a branch policy.",
81+
doc:
82+
"Modify an existing policy's blocking flag or enabled state. The policy type and scope are preserved from the existing policy.",
6483
arguments: [
6584
project: [type: :string, doc: "Project name or ID"],
6685
repo_id: [type: :string, doc: "Repository name or ID"],
67-
policy_id: [type: :integer, doc: "Policy configuration ID"]
86+
policy_id: [type: :integer, doc: "Numeric policy configuration ID"]
6887
],
6988
options: [
70-
blocking: [type: :boolean, doc: "Block pull request on policy failure"],
71-
enabled: [type: :boolean, doc: "Enable or disable the policy"]
89+
blocking: [
90+
type: :boolean,
91+
doc: "Set whether the policy blocks PR completion. Omit to keep current value."
92+
],
93+
enabled: [
94+
type: :boolean,
95+
doc: "Set whether the policy is active. Omit to keep current value."
96+
]
7297
],
7398
execute: &update_policy/1
7499
],
75100
delete: [
76101
name: "ado repos policies delete",
77-
doc: "Delete a branch policy.",
102+
doc:
103+
"Permanently remove a branch policy. The policy is removed from all branches it was scoped to (usually just one).",
78104
arguments: [
79105
project: [type: :string, doc: "Project name or ID"],
80106
repo_id: [type: :string, doc: "Repository name or ID"],
81-
policy_id: [type: :integer, doc: "Policy configuration ID"]
107+
policy_id: [type: :integer, doc: "Numeric policy configuration ID"]
82108
],
83109
execute: &delete_policy/1
84110
]

0 commit comments

Comments
 (0)