@knowttl/ado-axi 0.0.0-stage → 0.5.0

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.
Files changed (169) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +261 -2
  3. package/SKILL.md +334 -0
  4. package/assets/ado-axi-header.png +0 -0
  5. package/dist/bin/ado-axi.d.ts +3 -0
  6. package/dist/bin/ado-axi.d.ts.map +1 -0
  7. package/dist/bin/ado-axi.js +192 -0
  8. package/dist/bin/ado-axi.js.map +1 -0
  9. package/dist/commands/agent.d.ts +3 -0
  10. package/dist/commands/agent.d.ts.map +1 -0
  11. package/dist/commands/agent.js +26 -0
  12. package/dist/commands/agent.js.map +1 -0
  13. package/dist/commands/api.d.ts +2 -0
  14. package/dist/commands/api.d.ts.map +1 -0
  15. package/dist/commands/api.js +161 -0
  16. package/dist/commands/api.js.map +1 -0
  17. package/dist/commands/classification.d.ts +2 -0
  18. package/dist/commands/classification.d.ts.map +1 -0
  19. package/dist/commands/classification.js +54 -0
  20. package/dist/commands/classification.js.map +1 -0
  21. package/dist/commands/config.d.ts +2 -0
  22. package/dist/commands/config.d.ts.map +1 -0
  23. package/dist/commands/config.js +109 -0
  24. package/dist/commands/config.js.map +1 -0
  25. package/dist/commands/doctor.d.ts +2 -0
  26. package/dist/commands/doctor.d.ts.map +1 -0
  27. package/dist/commands/doctor.js +67 -0
  28. package/dist/commands/doctor.js.map +1 -0
  29. package/dist/commands/home.d.ts +2 -0
  30. package/dist/commands/home.d.ts.map +1 -0
  31. package/dist/commands/home.js +132 -0
  32. package/dist/commands/home.js.map +1 -0
  33. package/dist/commands/pipeline.d.ts +2 -0
  34. package/dist/commands/pipeline.d.ts.map +1 -0
  35. package/dist/commands/pipeline.js +572 -0
  36. package/dist/commands/pipeline.js.map +1 -0
  37. package/dist/commands/pipelineAdmin.d.ts +3 -0
  38. package/dist/commands/pipelineAdmin.d.ts.map +1 -0
  39. package/dist/commands/pipelineAdmin.js +152 -0
  40. package/dist/commands/pipelineAdmin.js.map +1 -0
  41. package/dist/commands/pipelineArtifact.d.ts +3 -0
  42. package/dist/commands/pipelineArtifact.d.ts.map +1 -0
  43. package/dist/commands/pipelineArtifact.js +68 -0
  44. package/dist/commands/pipelineArtifact.js.map +1 -0
  45. package/dist/commands/policy.d.ts +3 -0
  46. package/dist/commands/policy.d.ts.map +1 -0
  47. package/dist/commands/policy.js +31 -0
  48. package/dist/commands/policy.js.map +1 -0
  49. package/dist/commands/pool.d.ts +3 -0
  50. package/dist/commands/pool.d.ts.map +1 -0
  51. package/dist/commands/pool.js +19 -0
  52. package/dist/commands/pool.js.map +1 -0
  53. package/dist/commands/pr.d.ts +9 -0
  54. package/dist/commands/pr.d.ts.map +1 -0
  55. package/dist/commands/pr.js +1028 -0
  56. package/dist/commands/pr.js.map +1 -0
  57. package/dist/commands/query.d.ts +2 -0
  58. package/dist/commands/query.d.ts.map +1 -0
  59. package/dist/commands/query.js +29 -0
  60. package/dist/commands/query.js.map +1 -0
  61. package/dist/commands/queue.d.ts +3 -0
  62. package/dist/commands/queue.d.ts.map +1 -0
  63. package/dist/commands/queue.js +21 -0
  64. package/dist/commands/queue.js.map +1 -0
  65. package/dist/commands/ref.d.ts +3 -0
  66. package/dist/commands/ref.d.ts.map +1 -0
  67. package/dist/commands/ref.js +204 -0
  68. package/dist/commands/ref.js.map +1 -0
  69. package/dist/commands/release.d.ts +3 -0
  70. package/dist/commands/release.d.ts.map +1 -0
  71. package/dist/commands/release.js +91 -0
  72. package/dist/commands/release.js.map +1 -0
  73. package/dist/commands/repo.d.ts +3 -0
  74. package/dist/commands/repo.d.ts.map +1 -0
  75. package/dist/commands/repo.js +261 -0
  76. package/dist/commands/repo.js.map +1 -0
  77. package/dist/commands/repoAdmin.d.ts +3 -0
  78. package/dist/commands/repoAdmin.d.ts.map +1 -0
  79. package/dist/commands/repoAdmin.js +195 -0
  80. package/dist/commands/repoAdmin.js.map +1 -0
  81. package/dist/commands/security.d.ts +3 -0
  82. package/dist/commands/security.d.ts.map +1 -0
  83. package/dist/commands/security.js +57 -0
  84. package/dist/commands/security.js.map +1 -0
  85. package/dist/commands/serviceEndpoint.d.ts +3 -0
  86. package/dist/commands/serviceEndpoint.d.ts.map +1 -0
  87. package/dist/commands/serviceEndpoint.js +29 -0
  88. package/dist/commands/serviceEndpoint.js.map +1 -0
  89. package/dist/commands/team.d.ts +3 -0
  90. package/dist/commands/team.d.ts.map +1 -0
  91. package/dist/commands/team.js +33 -0
  92. package/dist/commands/team.js.map +1 -0
  93. package/dist/commands/test.d.ts +2 -0
  94. package/dist/commands/test.d.ts.map +1 -0
  95. package/dist/commands/test.js +183 -0
  96. package/dist/commands/test.js.map +1 -0
  97. package/dist/commands/user.d.ts +3 -0
  98. package/dist/commands/user.d.ts.map +1 -0
  99. package/dist/commands/user.js +20 -0
  100. package/dist/commands/user.js.map +1 -0
  101. package/dist/commands/variableGroup.d.ts +3 -0
  102. package/dist/commands/variableGroup.d.ts.map +1 -0
  103. package/dist/commands/variableGroup.js +23 -0
  104. package/dist/commands/variableGroup.js.map +1 -0
  105. package/dist/commands/workItem.d.ts +12 -0
  106. package/dist/commands/workItem.d.ts.map +1 -0
  107. package/dist/commands/workItem.js +940 -0
  108. package/dist/commands/workItem.js.map +1 -0
  109. package/dist/commands/workItemAttachment.d.ts +3 -0
  110. package/dist/commands/workItemAttachment.d.ts.map +1 -0
  111. package/dist/commands/workItemAttachment.js +136 -0
  112. package/dist/commands/workItemAttachment.js.map +1 -0
  113. package/dist/help.d.ts +4 -0
  114. package/dist/help.d.ts.map +1 -0
  115. package/dist/help.js +383 -0
  116. package/dist/help.js.map +1 -0
  117. package/dist/lib/adoUrl.d.ts +19 -0
  118. package/dist/lib/adoUrl.d.ts.map +1 -0
  119. package/dist/lib/adoUrl.js +104 -0
  120. package/dist/lib/adoUrl.js.map +1 -0
  121. package/dist/lib/args.d.ts +14 -0
  122. package/dist/lib/args.d.ts.map +1 -0
  123. package/dist/lib/args.js +94 -0
  124. package/dist/lib/args.js.map +1 -0
  125. package/dist/lib/argv.d.ts +8 -0
  126. package/dist/lib/argv.d.ts.map +1 -0
  127. package/dist/lib/argv.js +35 -0
  128. package/dist/lib/argv.js.map +1 -0
  129. package/dist/lib/audit.d.ts +21 -0
  130. package/dist/lib/audit.d.ts.map +1 -0
  131. package/dist/lib/audit.js +128 -0
  132. package/dist/lib/audit.js.map +1 -0
  133. package/dist/lib/auth.d.ts +8 -0
  134. package/dist/lib/auth.d.ts.map +1 -0
  135. package/dist/lib/auth.js +127 -0
  136. package/dist/lib/auth.js.map +1 -0
  137. package/dist/lib/client.d.ts +32 -0
  138. package/dist/lib/client.d.ts.map +1 -0
  139. package/dist/lib/client.js +181 -0
  140. package/dist/lib/client.js.map +1 -0
  141. package/dist/lib/config.d.ts +39 -0
  142. package/dist/lib/config.d.ts.map +1 -0
  143. package/dist/lib/config.js +150 -0
  144. package/dist/lib/config.js.map +1 -0
  145. package/dist/lib/context.d.ts +5 -0
  146. package/dist/lib/context.d.ts.map +1 -0
  147. package/dist/lib/context.js +20 -0
  148. package/dist/lib/context.js.map +1 -0
  149. package/dist/lib/format.d.ts +17 -0
  150. package/dist/lib/format.d.ts.map +1 -0
  151. package/dist/lib/format.js +65 -0
  152. package/dist/lib/format.js.map +1 -0
  153. package/dist/lib/paths.d.ts +3 -0
  154. package/dist/lib/paths.d.ts.map +1 -0
  155. package/dist/lib/paths.js +13 -0
  156. package/dist/lib/paths.js.map +1 -0
  157. package/dist/lib/repositoryPath.d.ts +2 -0
  158. package/dist/lib/repositoryPath.d.ts.map +1 -0
  159. package/dist/lib/repositoryPath.js +26 -0
  160. package/dist/lib/repositoryPath.js.map +1 -0
  161. package/dist/lib/stdin.d.ts +2 -0
  162. package/dist/lib/stdin.d.ts.map +1 -0
  163. package/dist/lib/stdin.js +11 -0
  164. package/dist/lib/stdin.js.map +1 -0
  165. package/dist/lib/writes.d.ts +3 -0
  166. package/dist/lib/writes.d.ts.map +1 -0
  167. package/dist/lib/writes.js +37 -0
  168. package/dist/lib/writes.js.map +1 -0
  169. package/package.json +65 -4
package/dist/help.js ADDED
@@ -0,0 +1,383 @@
1
+ export const DESCRIPTION = "Work with Azure DevOps work items, pull requests, and pipelines from the current profile";
2
+ const AUDIT_HELP = {
3
+ repo: [
4
+ "ado-axi repo policy list --repo <id> [--branch <branch>] [--limit 100] [--full]",
5
+ "ado-axi repo policy show <id> [--limit 100] [--full]",
6
+ "ado-axi repo show <name|id> [--limit 100] [--full]",
7
+ ],
8
+ security: [
9
+ "ado-axi security group list [--scope <descriptor>] [--limit 100] [--full]",
10
+ "ado-axi security group show <descriptor> [--full]",
11
+ "ado-axi security membership list <descriptor> [--direction up|down] [--limit 100] [--full]",
12
+ "ado-axi security permission list --namespace <id> [--token <token>] [--subject <descriptor>] [--limit 100] [--full]",
13
+ "ado-axi security permission show --namespace <id> --token <token> [--subject <descriptor>] [--limit 100] [--full]",
14
+ "Aliases: security group membership list = security membership list.",
15
+ ],
16
+ "service-endpoint": [
17
+ "ado-axi service-endpoint list [--limit 100] [--full]",
18
+ "ado-axi service-endpoint show <id> [--full]",
19
+ ],
20
+ "variable-group": [
21
+ "ado-axi variable-group list [--limit 100] [--full]",
22
+ "ado-axi variable-group show <id> [--limit 100] [--full]",
23
+ "Alias: pipeline variable-group list|show.",
24
+ ],
25
+ pipeline: [
26
+ "ado-axi pipeline variable-group list [--limit 100] [--full]",
27
+ "ado-axi pipeline variable-group show <id> [--limit 100] [--full]",
28
+ "ado-axi pipeline variable list --pipeline <id> [--limit 100] [--full]",
29
+ "ado-axi pipeline show <id> [--limit 100] [--full]",
30
+ "ado-axi pipeline agent list --pool <id> [--limit 100] [--full]",
31
+ "ado-axi pipeline agent show <id> --pool <id> [--full]",
32
+ "ado-axi pipeline pool list [--limit 100] [--full]",
33
+ "ado-axi pipeline pool show <id> [--full]",
34
+ "ado-axi pipeline queue list [--limit 100] [--full]",
35
+ "ado-axi pipeline queue show <id> [--full]",
36
+ ],
37
+ agent: [
38
+ "ado-axi agent list --pool <id> [--limit 100] [--full]",
39
+ "ado-axi agent show <id> --pool <id> [--full]",
40
+ ],
41
+ pool: [
42
+ "ado-axi pool list [--limit 100] [--full]",
43
+ "ado-axi pool show <id> [--full]",
44
+ ],
45
+ queue: [
46
+ "ado-axi queue list [--limit 100] [--full]",
47
+ "ado-axi queue show <id> [--full]",
48
+ ],
49
+ user: [
50
+ "ado-axi user list [--limit 100] [--full]",
51
+ "ado-axi user show <entitlement-id> [--full]",
52
+ ],
53
+ team: [
54
+ "ado-axi team list [--limit 100] [--full]",
55
+ "ado-axi team member list --team <name|id> [--limit 100] [--full]",
56
+ "Alias: team list-member = team member list.",
57
+ ],
58
+ project: ["ado-axi project show [<name|id>] [--limit 100] [--full]"],
59
+ };
60
+ export const TOP_LEVEL_HELP = [
61
+ "Writes default off: set ADO_AXI_WRITES=1 to enable mutations (including config init|add and raw API non-GET/HEAD/OPTIONS). Reads and help remain available.",
62
+ "ado-axi # dashboard: your work items, project-active PRs, recent runs",
63
+ "ado-axi work-item list # open work items (WIQL under the hood)",
64
+ "ado-axi work-item get <id> # detail view [--comments] [--full]",
65
+ 'ado-axi work-item create --type Task --title "..."',
66
+ "ado-axi work-item update <id> --state <state>",
67
+ "ado-axi work-item delete <id> --if-rev <n> # recycle bin; [--destroy --confirm-destroy] is permanent",
68
+ 'ado-axi work-item comment <id> --body "..." [--format markdown|html]',
69
+ "ado-axi work-item link list|add|remove <id> # parent/child/related, pull request, commit, branch",
70
+ "ado-axi work-item link types # available relation types [--limit 50] [--full]",
71
+ "ado-axi work-item attach <id> --file <path> [--comment ...] [--if-rev <n>]",
72
+ "ado-axi work-item attachment get <id> --name <file> [--out <path>] [--force]",
73
+ "ado-axi query run <id|path> # saved query results [--limit 30] [--fields a,b]",
74
+ "ado-axi area list # area paths [--depth 10] [--limit 50] [--full]",
75
+ "ado-axi iteration list # iteration paths and dates [--depth 10] [--limit 50] [--full]",
76
+ "ado-axi pr list # active pull requests [--repo <r>] [--status <s>]",
77
+ "ado-axi pr get <id> # detail + reviewers [--threads] [--full]",
78
+ 'ado-axi pr create --repo <r> --source <branch> --title "..."',
79
+ 'ado-axi pr update <id> --title "..." # draft/auto-complete/description updates',
80
+ "ado-axi pr complete <id> [--squash] # guarded merge; never bypasses policy",
81
+ "ado-axi pr checks <id> | diff <id> # bounded readiness/change summaries",
82
+ "ado-axi pr reviewer list|add|remove <id>",
83
+ "ado-axi pr approve <id> # [--vote approve|reject|wait-for-author|reset]",
84
+ 'ado-axi pr comment <id> --body "..." # [--file <path> --line <n>] [--thread <id>]',
85
+ "ado-axi pr thread list|resolve|reply <id> # close out review comment threads",
86
+ "ado-axi pipeline list # pipeline definitions",
87
+ "ado-axi pipeline runs [--pipeline <id>] # recent runs [--result failed]",
88
+ "ado-axi pipeline run --pipeline <id> --branch <branch>",
89
+ "ado-axi pipeline create|update|delete # definition administration (writes default off)",
90
+ "ado-axi pipeline build tag|cancel # runs tag is an alias for build tag",
91
+ "ado-axi pipeline folder list|create|delete",
92
+ "ado-axi pipeline runs artifact list|download <run-id>",
93
+ "ado-axi pipeline release list|show|create # Classic releases; create requires writes enabled",
94
+ "ado-axi pipeline logs <run-id> # [--log <id>] [--tail N] [--full] [--failed-only]",
95
+ "ado-axi pipeline timeline <run-id> # stages/jobs + failing steps with log ids",
96
+ "ado-axi pipeline watch <run-id> # [--interval 10] [--timeout 1800]",
97
+ "ado-axi test results <run-id> # failed tests of a pipeline run [--outcome all]",
98
+ "ado-axi repo list # repositories [--name <filter>]",
99
+ "ado-axi repo create|update|delete|import # all mutations require ADO_AXI_WRITES=1",
100
+ "ado-axi repo policy create|update|delete # configurations; revision prechecks and confirmed deletion",
101
+ "ado-axi repo branches --repo <name>",
102
+ "ado-axi repo file <path> --repo <name> # file content at a branch or commit [--ref] [--commit]",
103
+ "ado-axi ref list|create|delete --repo <name>",
104
+ "ado-axi project list # projects, 30 most recently updated",
105
+ ...Object.values(AUDIT_HELP).flat(),
106
+ "ado-axi api <path|url> # raw REST escape hatch for everything else",
107
+ "ado-axi doctor # authentication check for every profile",
108
+ "ado-axi config list | init | path # profiles in ~/.ado-axi/config.json",
109
+ "",
110
+ "Profiles: --profile <name> selects a configured org/project/auth pair (also allowed before the command).",
111
+ "Overrides: --org <org> --project <project> (or $ADO_AXI_ORG / $ADO_AXI_PROJECT).",
112
+ "--org accepts a name or organization-root URL; project context must be supplied separately.",
113
+ "Auth per profile: az CLI login, or a PAT read from an env var.",
114
+ "Output: TOON on stdout. --full expands detail output (see command help for limits), --fields a,b limits list columns.",
115
+ ].join("\n");
116
+ export const COMMAND_HELP = {
117
+ "work-item": [
118
+ "ado-axi work-item <list|get|create|update|delete|comment|link>",
119
+ "",
120
+ "list [--state open|all|<State>] [--type <type>] [--assigned-to @me|<name>]",
121
+ " [--iteration @current|<path>] [--area <path>] [--tag <tag>] [--search <text>]",
122
+ ' [--query "<raw WIQL>"] [--limit 30] [--fields id,title,state]',
123
+ " --limit bounds displayed items; count reports only the number shown, not an exhaustive total.",
124
+ " --fields accepts id,type,title,state,assignee,created,changed or any field reference name.",
125
+ " Example: --fields System.AssignedTo,System.CreatedDate,Custom.EventSeverity",
126
+ "get <id> [--comments] [--relations] [--full] # includes rev for --if-rev updates",
127
+ " --full includes the complete description and every non-System field by reference name (1200 chars per extra text field).",
128
+ 'create --type <type> --title "..." [--description "..."] [--description-format markdown|html] [--assigned-to <user>]',
129
+ " # when --description is omitted, piped stdin is used",
130
+ ' [--area <path>] [--iteration <path>] [--parent <id>] [--tags "a; b"] [--set \'{"Field.Ref": value}\']',
131
+ 'update <id> [--state <state>] [--title "..."] [--assigned-to <user>] [--area <path>]',
132
+ ' [--iteration <path>] [--description "..."] [--description-format markdown|html] [--tags "a; b"] [--reason <reason>] [--set \'{...}\']',
133
+ " # when --description is omitted, piped stdin is used",
134
+ " [--add-tags a,b] [--remove-tags c] # automatically revision-guarded tag changes",
135
+ " [--if-rev <n>] # compare-and-swap: fails if the item changed",
136
+ "delete <id> --if-rev <n> [--destroy --confirm-destroy] # recycle bin by default; destroy is permanent",
137
+ " Reads and compares rev immediately before DELETE; not atomic: another writer can change the item in that gap.",
138
+ 'comment <id> [--body "..."] [--format markdown|html]',
139
+ " # pipe stdin when --body is omitted; required for Markdown/multiline with `, $, !, or quotes",
140
+ " # Markdown by default; use --format html only for raw HTML",
141
+ "link list <id> [--limit 50] # every relation, resolved to ids/artifacts",
142
+ "link types [--limit 50] [--full] [--fields reference,name,usage,enabled]",
143
+ "link add <id> (--parent <id> | --child <id> | --related <id> | --pr <id>",
144
+ " | --commit <40-hex> --repo <name> | --branch <name> --repo <name>)",
145
+ ' [--comment "..."] [--if-rev <n>] # duplicate links are reported as no-ops',
146
+ "link remove <id> --index <n> --if-rev <n> # index and rev from link list; atomic revision guard",
147
+ 'attach <id> --file <path> [--comment "..."] [--if-rev <n>] # upload then add a revision-guarded AttachedFile relation',
148
+ "attachment get <id> --name <file> [--out <path>] [--force] # default ./<name>; refuses ambiguous names",
149
+ " Attachments: 25 MiB maximum in either direction; downloads never overwrite without --force and report SHA-256.",
150
+ "Writes: create, update, delete (including --destroy), comment, link add, link remove, attach. Default off; set ADO_AXI_WRITES=1 to enable.",
151
+ "",
152
+ "Examples:",
153
+ " ado-axi work-item list --assigned-to @me --state open",
154
+ " ado-axi work-item get 4211 --comments",
155
+ ' ado-axi work-item update 4211 --state "In Progress"',
156
+ ' ado-axi work-item create --type Task --title "Documentation" --description "# Goal" --description-format markdown',
157
+ " ado-axi work-item update 4211 --assigned-to me@corp.com --add-tags agent-claimed --if-rev 7",
158
+ " ado-axi work-item link add 4211 --pr 812",
159
+ " ado-axi work-item link list 4211",
160
+ ' ado-axi work-item attach 4211 --file ./evidence.png --comment "Test evidence" --if-rev 7',
161
+ " ado-axi work-item attachment get 4211 --name evidence.png --out ./download.png",
162
+ " ado-axi work-item link remove 4211 --index 0 --if-rev 7",
163
+ " ado-axi work-item delete 4211 --if-rev 7",
164
+ " ado-axi work-item delete 4211 --if-rev 7 --destroy --confirm-destroy",
165
+ " ado-axi work-item comment 4211 --body \"**Ready**\"",
166
+ " # comments use Markdown by default; pass --format html only for raw HTML",
167
+ ].join("\n"),
168
+ query: [
169
+ "ado-axi query run <id|path> [--limit 30] [--fields id,type,title,state,assignee,changed]",
170
+ "Runs a saved query by GUID or project-relative path using GET requests only.",
171
+ "Field aliases and reference names match work-item list; the server-side limit stays in effect with --full.",
172
+ "Count reports items shown, not an exhaustive total. Linked queries show distinct source/target work items.",
173
+ "Examples:",
174
+ ' ado-axi query run "Shared Queries/Open bugs" --limit 10',
175
+ " ado-axi query run 11111111-1111-4111-8111-111111111111 --fields id,title,Custom.Priority",
176
+ ].join("\n"),
177
+ area: [
178
+ "ado-axi area list [--depth 10] [--limit 50] [--full] [--fields id,path]",
179
+ "Shows area paths within the requested depth (0 includes only the project root).",
180
+ "--full removes the display limit; depth still applies. left-out counts fetched paths omitted from output.",
181
+ "Examples:",
182
+ " ado-axi area list --depth 2",
183
+ " ado-axi area list --depth 3 --full",
184
+ ].join("\n"),
185
+ iteration: [
186
+ "ado-axi iteration list [--depth 10] [--limit 50] [--full] [--fields id,path,start,finish]",
187
+ "Shows iteration paths with start/finish dates within the requested depth (0 includes only the root).",
188
+ "--full removes the display limit; depth still applies. left-out counts fetched paths omitted from output.",
189
+ "Examples:",
190
+ " ado-axi iteration list --depth 2",
191
+ " ado-axi iteration list --limit 100 --full",
192
+ ].join("\n"),
193
+ pr: [
194
+ "ado-axi pr <list|get|comments|create|update|complete|abandon|checks|diff|reviewer|approve|comment|thread>",
195
+ "",
196
+ "list [--repo <repo>] [--status active|draft|completed|abandoned|all] [--creator @me|<name>]",
197
+ " [--reviewer @me|<name>] [--target <branch>] [--source <branch>] [--limit 30]",
198
+ "get <id> [--repo <repo>] [--threads] [--full]",
199
+ "comments <id> [--repo <repo>] [--full] # alias for `get <id> --threads`",
200
+ 'create --repo <repo> --source <branch> [--target main] --title "..." [--description "..."]',
201
+ " # when --description is omitted, piped stdin is used",
202
+ " [--reviewers a,b] [--draft] [--work-items 1,2]",
203
+ 'update <id> [--title "..."] [--description "..."] [--draft true|false] [--auto-complete true|false]',
204
+ " # when --description is omitted, piped stdin is used as the description",
205
+ "complete <id> [--squash true|false] [--delete-source-branch true|false] [--repo <repo>]",
206
+ "abandon <id> [--repo <repo>]",
207
+ "checks <id> [--limit 10] [--full] [--repo <repo>]",
208
+ "diff <id> [--limit 20] [--full] [--repo <repo>]",
209
+ "reviewer list <id> [--repo <repo>]",
210
+ "reviewer add|remove <id> --reviewer <identity> [--required] [--repo <repo>]",
211
+ "approve <id> [--vote approve|approve-with-suggestions|wait-for-author|reject|reset] [--repo <repo>]",
212
+ 'comment <id> [--body "..."] [--file <path> --line <n>] [--thread <id>] [--repo <repo>]',
213
+ " # pipe stdin when --body is omitted; required for Markdown/multiline with `, $, !, or quotes",
214
+ "thread list <id> [--limit 20] [--full] # non-system threads, status, file, last comment",
215
+ 'thread reply <id> --thread <n> [--body "..."] [--resolve] [--status <status>]',
216
+ " # pipe stdin when --body is omitted; required for Markdown/multiline with `, $, !, or quotes",
217
+ "thread resolve|reopen <id> --thread <n> [--status active|fixed|wont-fix|closed|by-design|pending]",
218
+ "",
219
+ "Examples:",
220
+ " ado-axi pr list --reviewer @me",
221
+ " ado-axi pr get 812 --threads --full",
222
+ " ado-axi pr checks 812",
223
+ " ado-axi pr diff 812 --limit 50",
224
+ " ado-axi pr complete 812 --squash --delete-source-branch",
225
+ " ado-axi pr abandon 812",
226
+ " ado-axi pr approve 812",
227
+ " ado-axi pr thread list 812",
228
+ ' ado-axi pr thread reply 812 --thread 5 --body "Fixed in 3f2a1c9" --resolve',
229
+ " MSYS_NO_PATHCONV=1 ado-axi pr comment 812 --file /src/File.cs --line 10 --body \"...\" # Git Bash",
230
+ ].join("\n"),
231
+ pipeline: [
232
+ "ado-axi pipeline <list|show|create|update|delete|runs|run|build|folder|release|logs|timeline|watch>",
233
+ "",
234
+ "list [--name <filter>] [--limit 100]",
235
+ "create --definition '<BuildDefinition JSON object>' # include name, repository, process, queue",
236
+ "update <id> --definition '<changed fields JSON object>' [--if-rev <n>] # merges into fetched definition; revision CAS",
237
+ "delete <id> --if-rev <n> --confirm-delete # revision precheck; DELETE is not atomic",
238
+ "build tag add|remove <run-id> --tag <tag> # alias: runs tag",
239
+ "build cancel <run-id> # completed/cancelling builds are a no-op",
240
+ "folder list [--path <folder>] [--limit 100] [--full] # full expands fields, not the limit",
241
+ "folder create --path <absolute-folder> # e.g. '\\Team'",
242
+ "folder delete --path <absolute-folder> --confirm-delete # existence precheck; no atomic guard",
243
+ "runs artifact list <run-id> [--limit 100] [--full] # id, name, type, byte size; signed URLs withheld",
244
+ "runs artifact download <run-id> --name <name> --out <path> [--force] # ZIP; 100 MiB cap, bytes reported; read-only remotely",
245
+ "release list [--definition <id>] [--limit 100] [--full] # Classic releases, newest first",
246
+ "release show <id> [--limit 100] [--full] # bounded collections; secret variables and URLs masked",
247
+ "release create --definition <id> [--description <text>] [--draft true|false] [--artifacts '<JSON array>']",
248
+ " artifacts: [{\"alias\":\"_CI\",\"instanceReference\":{\"id\":\"42\"}}]; omit to use definition defaults",
249
+ " release create requires ADO_AXI_WRITES=1; non-draft releases may trigger deployments",
250
+ " Artifact upload is not exposed: the Build Artifacts create API registers resources, not local file bytes.",
251
+ "runs [--pipeline <id>] [--branch <branch>] [--status <status>] [--result failed] [--limit 20]",
252
+ "run --pipeline <id> [--branch <branch>] [--variables '{\"k\":\"v\"}'] [--parameters '{\"k\":\"v\"}']",
253
+ "logs <run-id> [--log <log-id>] [--tail 120] [--full] [--failed-only]",
254
+ "timeline <run-id> [--limit 20] [--full] # stage/job outline + failed steps, issues, log ids",
255
+ "watch <run-id> [--interval 10] [--timeout 1800] # seconds; deadline includes auth/HTTP; failures exit 1",
256
+ "",
257
+ "Examples:",
258
+ " ado-axi pipeline runs --result failed --limit 5",
259
+ " ado-axi pipeline update 42 --definition '{\"name\":\"CI\"}' --if-rev 7",
260
+ " ado-axi pipeline build tag add 42 --tag verified",
261
+ " ado-axi pipeline folder list --limit 20",
262
+ " ado-axi pipeline runs artifact list 42 --limit 10",
263
+ " ado-axi pipeline runs artifact download 42 --name drop --out ./drop.zip",
264
+ " ado-axi pipeline release create --definition 4 --draft true",
265
+ " ado-axi pipeline timeline 98231",
266
+ " ado-axi pipeline logs 98231 --failed-only --tail 200",
267
+ " ado-axi pipeline watch 98231 --interval 10 --timeout 1800",
268
+ ].join("\n"),
269
+ test: [
270
+ "ado-axi test results <run-id>",
271
+ "",
272
+ "results <run-id> [--outcome failed|passed|aborted|not-executed|all] [--limit 20] [--full]",
273
+ " [--run <test-run-id>] # read one published test run instead of a pipeline run",
274
+ "",
275
+ "<run-id> is the pipeline run id from `pipeline runs`. Totals are aggregated across every",
276
+ "test run published by that pipeline run; all pages are read, including run details.",
277
+ "--limit bounds displayed results, not totals; --full expands error messages, not the result limit.",
278
+ "",
279
+ "Examples:",
280
+ " ado-axi test results 98231",
281
+ " ado-axi test results 98231 --full",
282
+ " ado-axi test results 98231 --outcome all --limit 50",
283
+ ].join("\n"),
284
+ repo: [
285
+ "ado-axi repo <list|show|branches|file|create|update|delete|import|policy>",
286
+ "",
287
+ "list [--name <filter>] [--limit 200]",
288
+ "create --name <name> # create in selected project",
289
+ "update --repo <id|name> [--name <name>] [--default-branch <branch>] [--disabled true|false]",
290
+ "delete --repo <id|name> --confirm-delete # existence precheck, then delete by resolved id",
291
+ "import --repo <id|name> --source-url <https-git-url> [--service-endpoint <id>] # queues an import into an existing empty repository",
292
+ " Source URLs must not include credentials, queries, or fragments; use a service endpoint for authentication.",
293
+ "policy create --policy-json '<JSON object>' # type.id GUID, settings object, isEnabled/isBlocking booleans",
294
+ "policy update <id> --policy-json '<changed fields JSON object>' [--if-rev <n>] # sends fetched revision",
295
+ "policy delete <id> --if-rev <n> --confirm-delete # revision precheck; DELETE has no atomic guard",
296
+ " --config <path> selects the profile file; --profile <name> selects a saved profile.",
297
+ " Policy JSON accepts type, settings, isEnabled, isBlocking; omit id/revision. Nested settings are replaced as a whole.",
298
+ " Repository PATCH/DELETE and policy DELETE have no documented atomic revision predicate; prechecks have a race window.",
299
+ "branches --repo <name> [--name <filter>] [--limit 50]",
300
+ "file <path> --repo <name> [--ref <branch> | --commit <40-hex>] [--limit <lines>] [--full]",
301
+ "",
302
+ "`file` returns a single file's content at a branch tip (default branch when --ref is omitted)",
303
+ "or an exact commit. Content is truncated with a --full escape hatch; binaries are not returned.",
304
+ "",
305
+ "Examples:",
306
+ " ado-axi repo file /src/Program.cs --repo Web",
307
+ " ado-axi repo create --name SyntheticRepo",
308
+ " ado-axi repo update --repo SyntheticRepo --default-branch main",
309
+ " ado-axi repo policy update 7 --policy-json '{\"isEnabled\":false}' --if-rev 3",
310
+ " ado-axi repo file /src/Program.cs --repo Web --ref feature/x --limit 80",
311
+ ].join("\n"),
312
+ ref: [
313
+ "ado-axi ref <list|create|delete>",
314
+ "",
315
+ "list --repo <repo> [--name <prefix>] [--limit 50] [--full]",
316
+ "create --repo <repo> --name <branch> (--source <branch> | --source-object-id <40-hex>)",
317
+ "delete --repo <repo> --name <branch> [--old-object-id <40-hex>]",
318
+ "",
319
+ "Create never overwrites an existing ref. Delete reads the current object id and uses it as",
320
+ "Azure DevOps' concurrency guard; --old-object-id adds an explicit caller-side guard.",
321
+ ].join("\n"),
322
+ project: ["ado-axi project list [--name <filter>] [--limit 30]"].join("\n"),
323
+ api: [
324
+ "ado-axi api [GET|POST|PATCH|PUT|DELETE] <path|url> [--body '<json>'] [--query 'k=v&k2=v2']",
325
+ " [--api-version 7.1] [--host dev|vsrm|vssps|almsearch|vsaex] [--no-project] [--raw] [--full]",
326
+ " [--content-type json|json-patch|merge-patch|text|<media type>]",
327
+ "",
328
+ "Raw Azure DevOps REST escape hatch. Paths are relative to",
329
+ "https://dev.azure.com/<org>/<project>/ — pass --no-project for organization-level paths.",
330
+ "Full HTTPS REST URLs on dev.azure.com, vsrm.dev.azure.com, vssps.dev.azure.com, and",
331
+ "almsearch.dev.azure.com, and vsaex.dev.azure.com select org/project/host/query without inheriting default project context.",
332
+ "Conflicting flags or a --profile from another org are rejected before authentication.",
333
+ "URLs with credentials, custom ports, fragments, dot segments, or duplicate query keys are rejected.",
334
+ "Work item writes require --content-type json-patch.",
335
+ "Use --raw for endpoints that return plain text, such as build logs.",
336
+ "When --body is omitted and stdin is piped, stdin is sent as the raw request body (use --content-type as needed).",
337
+ "",
338
+ "Examples:",
339
+ " ado-axi api _apis/wiki/wikis",
340
+ " ado-axi api 'https://vsrm.dev.azure.com/acme/Platform/_apis/release/releases?api-version=7.1'",
341
+ " ado-axi api _apis/testplan/plans --query 'filterActivePlans=true'",
342
+ " ado-axi api POST _apis/search/codesearchresults --host almsearch --body '{\"searchText\":\"TODO\"}'",
343
+ " ado-axi api PATCH _apis/wit/workitems/4211 --content-type json-patch \\",
344
+ " --body '[{\"op\":\"test\",\"path\":\"/rev\",\"value\":7},{\"op\":\"add\",\"path\":\"/fields/System.State\",\"value\":\"Active\"}]'",
345
+ ].join("\n"),
346
+ doctor: [
347
+ "ado-axi doctor [--config <path>]",
348
+ "",
349
+ "Verifies authentication for every configured profile and reports the identity",
350
+ "each one resolves to. Exit code 0 even when a profile fails — read `status`.",
351
+ ].join("\n"),
352
+ config: [
353
+ "ado-axi config <list|init|path>",
354
+ "",
355
+ "list [--config <path>]",
356
+ "init --org <org> [--project <project>] [--name <profile>] [--auth az|pat] [--pat-env <VAR>] [--default]",
357
+ "path prints the resolved config file location",
358
+ "--org also accepts https://dev.azure.com/<org> or https://<org>.visualstudio.com; no project/API path.",
359
+ "",
360
+ "Config lives in ~/.ado-axi/config.json (or ./ado-axi.config.json, or $ADO_AXI_CONFIG):",
361
+ ' { "defaultProfile": "acme", "profiles": {',
362
+ ' "acme": { "org": "acme", "project": "Platform", "auth": "az" },',
363
+ ' "contoso": { "org": "contoso", "project": "Web", "auth": "pat", "patEnv": "ADO_CONTOSO_PAT" } } }',
364
+ ].join("\n"),
365
+ };
366
+ for (const [command, lines] of Object.entries(AUDIT_HELP)) {
367
+ COMMAND_HELP[command] = [
368
+ COMMAND_HELP[command] ?? `ado-axi ${command}`,
369
+ "",
370
+ "Read-only audit commands (TD-064):",
371
+ ...lines,
372
+ "Lists default to --limit 100 and report omitted records; --full expands details without lifting limits.",
373
+ "All audit commands accept --limit (also for nested detail collections) and --fields a,b on lists.",
374
+ "Detail identifiers also accept --id <id>; membership --direction defaults to up.",
375
+ "Secret variables are masked; endpoint authorization, data, URLs, and agent capabilities are withheld, including --full.",
376
+ "API error details are withheld to protect credentials. Empty lists report 0 of 0 and omitted: 0.",
377
+ ].join("\n");
378
+ }
379
+ for (const command of ["pr", "pipeline", "repo", "ref", "config", "api"]) {
380
+ COMMAND_HELP[command] += "\nWrites default off: set ADO_AXI_WRITES=1 to enable mutations. Reads and help remain available.";
381
+ }
382
+ COMMAND_HELP.api += "\nRaw API methods other than GET, HEAD, and OPTIONS require enablement, including implicit POST from a body or piped stdin.";
383
+ //# sourceMappingURL=help.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"help.js","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GACtB,0FAA0F,CAAC;AAE7F,MAAM,UAAU,GAA6B;IAC3C,IAAI,EAAE;QACJ,iFAAiF;QACjF,sDAAsD;QACtD,oDAAoD;KACrD;IACD,QAAQ,EAAE;QACR,2EAA2E;QAC3E,mDAAmD;QACnD,4FAA4F;QAC5F,qHAAqH;QACrH,mHAAmH;QACnH,qEAAqE;KACtE;IACD,kBAAkB,EAAE;QAClB,sDAAsD;QACtD,6CAA6C;KAC9C;IACD,gBAAgB,EAAE;QAChB,oDAAoD;QACpD,yDAAyD;QACzD,2CAA2C;KAC5C;IACD,QAAQ,EAAE;QACR,6DAA6D;QAC7D,kEAAkE;QAClE,uEAAuE;QACvE,mDAAmD;QACnD,gEAAgE;QAChE,uDAAuD;QACvD,mDAAmD;QACnD,0CAA0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AC,IAAI,CAAC,IAAI,CAAC;IACZ,MAAM,EAAE;QACN,kCAAkC;QAClC,EAAE;QACF,+EAA+E;QAC/E,8EAA8E;KAC/E,CAAC,IAAI,CAAC,IAAI,CAAC;IACZ,MAAM,EAAE;QACN,iCAAiC;QACjC,EAAE;QACF,yBAAyB;QACzB,0GAA0G;QAC1G,gDAAgD;QAChD,wGAAwG;QACxG,EAAE;QACF,wFAAwF;QACxF,6CAA6C;QAC7C,uEAAuE;QACvE,yGAAyG;KAC1G,CAAC,IAAI,CAAC,IAAI,CAAC;CACb,CAAC;AAEF,KAAK,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;IAC1D,YAAY,CAAC,OAAO,CAAC,GAAG;QACtB,YAAY,CAAC,OAAO,CAAC,IAAI,WAAW,OAAO,EAAE;QAC7C,EAAE;QACF,oCAAoC;QACpC,GAAG,KAAK;QACR,yGAAyG;QACzG,mGAAmG;QACnG,kFAAkF;QAClF,yHAAyH;QACzH,kGAAkG;KACnG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,KAAK,MAAM,OAAO,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC;IACzE,YAAY,CAAC,OAAO,CAAC,IAAI,kGAAkG,CAAC;AAC9H,CAAC;AACD,YAAY,CAAC,GAAG,IAAI,6HAA6H,CAAC"}
@@ -0,0 +1,19 @@
1
+ export declare const ADO_HOSTS: {
2
+ readonly dev: "dev.azure.com";
3
+ readonly vsrm: "vsrm.dev.azure.com";
4
+ readonly vssps: "vssps.dev.azure.com";
5
+ readonly almsearch: "almsearch.dev.azure.com";
6
+ readonly vsaex: "vsaex.dev.azure.com";
7
+ };
8
+ export type AdoHost = keyof typeof ADO_HOSTS;
9
+ export declare function normalizeOrg(input: string): string;
10
+ export declare function assertRelativeApiPath(path: string): void;
11
+ export interface AdoApiUrl {
12
+ org: string;
13
+ project?: string;
14
+ host: AdoHost;
15
+ path: string;
16
+ query: Record<string, string>;
17
+ }
18
+ export declare function parseAdoApiUrl(input: string): AdoApiUrl | undefined;
19
+ //# sourceMappingURL=adoUrl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adoUrl.d.ts","sourceRoot":"","sources":["../../src/lib/adoUrl.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;CAMZ,CAAC;AAEX,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,SAAS,CAAC;AA2B7C,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAiBlD;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAgBxD;AAED,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CA6BnE"}
@@ -0,0 +1,104 @@
1
+ import { AxiError } from "axi-sdk-js";
2
+ export const ADO_HOSTS = {
3
+ dev: "dev.azure.com",
4
+ vsrm: "vsrm.dev.azure.com",
5
+ vssps: "vssps.dev.azure.com",
6
+ almsearch: "almsearch.dev.azure.com",
7
+ vsaex: "vsaex.dev.azure.com",
8
+ };
9
+ function urlError(message) {
10
+ throw new AxiError(message, "VALIDATION_ERROR", [
11
+ "Use an HTTPS Azure DevOps REST URL on dev.azure.com, vsrm.dev.azure.com, vssps.dev.azure.com, almsearch.dev.azure.com, or vsaex.dev.azure.com",
12
+ "Or pass a relative API path with --org <org> [--project <project>] [--host <host>]",
13
+ ]);
14
+ }
15
+ function parseUrl(input) {
16
+ if (!/^https:\/\/[^/?#]+/i.test(input) || input !== input.trim() || /[\\\u0000-\u001f\u007f]/.test(input)) {
17
+ urlError("invalid Azure DevOps URL");
18
+ }
19
+ let url;
20
+ try {
21
+ url = new URL(input);
22
+ }
23
+ catch {
24
+ return urlError("invalid Azure DevOps URL");
25
+ }
26
+ if (url.protocol !== "https:" || url.username || url.password || url.port || input.includes("#")) {
27
+ urlError("Azure DevOps URLs require HTTPS without credentials, custom ports, or fragments");
28
+ }
29
+ const rawPath = input.match(/^https:\/\/[^/?#]+([^?#]*)/i)?.[1] ?? "";
30
+ assertRelativeApiPath(rawPath);
31
+ return url;
32
+ }
33
+ export function normalizeOrg(input) {
34
+ if (/^[a-z0-9][a-z0-9-]*$/i.test(input))
35
+ return input;
36
+ if (/^https:\/\//i.test(input)) {
37
+ const url = parseUrl(input);
38
+ let org;
39
+ if (url.hostname === ADO_HOSTS.dev) {
40
+ org = /^\/([a-z0-9][a-z0-9-]*)\/?$/i.exec(url.pathname)?.[1];
41
+ }
42
+ else {
43
+ org = /^([a-z0-9][a-z0-9-]*)\.visualstudio\.com$/i.exec(url.hostname)?.[1];
44
+ if (url.pathname !== "/")
45
+ org = undefined;
46
+ }
47
+ if (org && !url.search)
48
+ return org;
49
+ }
50
+ throw new AxiError("organization must be a name or an Azure DevOps organization-root URL", "VALIDATION_ERROR", [
51
+ "Use --org acme, --org https://dev.azure.com/acme, or --org https://acme.visualstudio.com",
52
+ "Pass the project separately with --project <project>; do not include project or API paths in --org",
53
+ ]);
54
+ }
55
+ export function assertRelativeApiPath(path) {
56
+ if (/^[a-z][a-z0-9+.-]*:/i.test(path) || path.startsWith("//") || /[\\\u0000-\u001f\u007f]/.test(path)) {
57
+ urlError("expected a relative API path, not a URL or Windows path");
58
+ }
59
+ let decoded;
60
+ try {
61
+ decoded = decodeURIComponent(path.split(/[?#]/, 1)[0] ?? "");
62
+ }
63
+ catch {
64
+ return urlError("API path contains invalid percent encoding");
65
+ }
66
+ // Build folder identifiers are absolute backslash paths in an encoded route value.
67
+ const buildFolder = /^_apis\/build\/folders\/%5c/i.test(path);
68
+ if ((decoded.includes("\\") && !buildFolder)
69
+ || decoded.replaceAll("\\", "/").split("/").some((part) => part === "." || part === "..")) {
70
+ urlError("API paths must not contain backslashes or dot segments");
71
+ }
72
+ }
73
+ export function parseAdoApiUrl(input) {
74
+ if (!/^[a-z][a-z0-9+.-]*:/i.test(input)) {
75
+ assertRelativeApiPath(input);
76
+ return undefined;
77
+ }
78
+ const url = parseUrl(input);
79
+ const host = Object.keys(ADO_HOSTS).find((key) => ADO_HOSTS[key] === url.hostname);
80
+ if (!host)
81
+ urlError("unsupported Azure DevOps API URL host");
82
+ const segments = url.pathname.slice(1).split("/");
83
+ const apiIndex = segments.indexOf("_apis");
84
+ if (apiIndex < 1 || !segments[apiIndex + 1]) {
85
+ urlError("expected an Azure DevOps REST URL containing /_apis/<resource>");
86
+ }
87
+ const org = normalizeOrg(segments[0] ?? "");
88
+ const project = apiIndex > 1 ? decodeURIComponent(segments[1] ?? "") : undefined;
89
+ if (project !== undefined && (!project || /[/\\]/.test(project))) {
90
+ urlError("invalid project segment in Azure DevOps API URL");
91
+ }
92
+ const query = Object.fromEntries(url.searchParams);
93
+ if (Object.keys(query).length !== url.searchParams.size) {
94
+ urlError("duplicate query parameters in the API URL are not supported");
95
+ }
96
+ return {
97
+ org,
98
+ project,
99
+ host,
100
+ path: segments.slice(project === undefined ? 1 : 2).join("/"),
101
+ query,
102
+ };
103
+ }
104
+ //# sourceMappingURL=adoUrl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adoUrl.js","sourceRoot":"","sources":["../../src/lib/adoUrl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,GAAG,EAAE,eAAe;IACpB,IAAI,EAAE,oBAAoB;IAC1B,KAAK,EAAE,qBAAqB;I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AQ,GAAG,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACjF,IAAI,OAAO,KAAK,SAAS,IAAI,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;QACjE,QAAQ,CAAC,iDAAiD,CAAC,CAAC;IAC9D,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IACnD,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;QACxD,QAAQ,CAAC,6DAA6D,CAAC,CAAC;IAC1E,CAAC;IACD,OAAO;QACL,GAAG;QACH,OAAO;QACP,IAAI;QACJ,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAC7D,KAAK;KACN,CAAC;AACJ,CAAC"}
@@ -0,0 +1,14 @@
1
+ export interface ParsedArgs {
2
+ flags: Record<string, string | boolean>;
3
+ positionals: string[];
4
+ }
5
+ export declare function argsToArgv(args: ParsedArgs): string[];
6
+ export declare function parseArgs(argv: readonly string[]): ParsedArgs;
7
+ export declare function flagString(args: ParsedArgs, name: string): string | undefined;
8
+ export declare function flagBool(args: ParsedArgs, name: string): boolean;
9
+ export declare function flagNumber(args: ParsedArgs, name: string): number | undefined;
10
+ export declare function flagList(args: ParsedArgs, name: string): string[] | undefined;
11
+ /** Flags accepted by every command, never reported as unknown. */
12
+ export declare const GLOBAL_FLAGS: readonly ["profile", "org", "project", "help", "full", "fields"];
13
+ export declare function assertKnownFlags(args: ParsedArgs, known: readonly string[], commandName: string, helpText?: string): void;
14
+ //# sourceMappingURL=args.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/lib/args.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC;IACxC,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,EAAE,CAGrD;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,UAAU,CA6B7D;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAQ7E;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAEhE;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAU7E;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAO7E;AAED,kEAAkE;AAClE,eAAO,MAAM,YAAY,kEAAmE,CAAC;AAU7F,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,WAAW,EAAE,MAAM,EACnB,QAAQ,CAAC,EAAE,MAAM,GAChB,IAAI,CAWN"}