pax8-cta 0.1.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 (224) hide show
  1. package/LICENSE +200 -0
  2. package/README.md +659 -0
  3. package/demo-data/solutions/ProductQADemo_1_0_0_2_managed.zip +0 -0
  4. package/dist/commands/analyze.d.ts +28 -0
  5. package/dist/commands/analyze.d.ts.map +1 -0
  6. package/dist/commands/analyze.js +571 -0
  7. package/dist/commands/analyze.js.map +1 -0
  8. package/dist/commands/auth.d.ts +18 -0
  9. package/dist/commands/auth.d.ts.map +1 -0
  10. package/dist/commands/auth.js +171 -0
  11. package/dist/commands/auth.js.map +1 -0
  12. package/dist/commands/config.d.ts +34 -0
  13. package/dist/commands/config.d.ts.map +1 -0
  14. package/dist/commands/config.js +299 -0
  15. package/dist/commands/config.js.map +1 -0
  16. package/dist/commands/demo.d.ts +33 -0
  17. package/dist/commands/demo.d.ts.map +1 -0
  18. package/dist/commands/demo.js +362 -0
  19. package/dist/commands/demo.js.map +1 -0
  20. package/dist/commands/deploy.d.ts +18 -0
  21. package/dist/commands/deploy.d.ts.map +1 -0
  22. package/dist/commands/deploy.js +1186 -0
  23. package/dist/commands/deploy.js.map +1 -0
  24. package/dist/commands/deployments/helpers.d.ts +68 -0
  25. package/dist/commands/deployments/helpers.d.ts.map +1 -0
  26. package/dist/commands/deployments/helpers.js +414 -0
  27. package/dist/commands/deployments/helpers.js.map +1 -0
  28. package/dist/commands/deployments/index.d.ts +24 -0
  29. package/dist/commands/deployments/index.d.ts.map +1 -0
  30. package/dist/commands/deployments/index.js +47 -0
  31. package/dist/commands/deployments/index.js.map +1 -0
  32. package/dist/commands/deployments/list.d.ts +18 -0
  33. package/dist/commands/deployments/list.d.ts.map +1 -0
  34. package/dist/commands/deployments/list.js +97 -0
  35. package/dist/commands/deployments/list.js.map +1 -0
  36. package/dist/commands/deployments/show.d.ts +18 -0
  37. package/dist/commands/deployments/show.d.ts.map +1 -0
  38. package/dist/commands/deployments/show.js +81 -0
  39. package/dist/commands/deployments/show.js.map +1 -0
  40. package/dist/commands/deployments/undo.d.ts +18 -0
  41. package/dist/commands/deployments/undo.d.ts.map +1 -0
  42. package/dist/commands/deployments/undo.js +295 -0
  43. package/dist/commands/deployments/undo.js.map +1 -0
  44. package/dist/commands/export.d.ts +18 -0
  45. package/dist/commands/export.d.ts.map +1 -0
  46. package/dist/commands/export.js +133 -0
  47. package/dist/commands/export.js.map +1 -0
  48. package/dist/commands/import.d.ts +18 -0
  49. package/dist/commands/import.d.ts.map +1 -0
  50. package/dist/commands/import.js +129 -0
  51. package/dist/commands/import.js.map +1 -0
  52. package/dist/commands/init-config.d.ts +26 -0
  53. package/dist/commands/init-config.d.ts.map +1 -0
  54. package/dist/commands/init-config.js +123 -0
  55. package/dist/commands/init-config.js.map +1 -0
  56. package/dist/commands/init-validation.d.ts +47 -0
  57. package/dist/commands/init-validation.d.ts.map +1 -0
  58. package/dist/commands/init-validation.js +339 -0
  59. package/dist/commands/init-validation.js.map +1 -0
  60. package/dist/commands/init-wizard.d.ts +25 -0
  61. package/dist/commands/init-wizard.d.ts.map +1 -0
  62. package/dist/commands/init-wizard.js +433 -0
  63. package/dist/commands/init-wizard.js.map +1 -0
  64. package/dist/commands/init.d.ts +18 -0
  65. package/dist/commands/init.d.ts.map +1 -0
  66. package/dist/commands/init.js +46 -0
  67. package/dist/commands/init.js.map +1 -0
  68. package/dist/commands/resolve-url.d.ts +18 -0
  69. package/dist/commands/resolve-url.d.ts.map +1 -0
  70. package/dist/commands/resolve-url.js +126 -0
  71. package/dist/commands/resolve-url.js.map +1 -0
  72. package/dist/commands/setup.d.ts +18 -0
  73. package/dist/commands/setup.d.ts.map +1 -0
  74. package/dist/commands/setup.js +239 -0
  75. package/dist/commands/setup.js.map +1 -0
  76. package/dist/commands/solutions/drift-analysis.d.ts +73 -0
  77. package/dist/commands/solutions/drift-analysis.d.ts.map +1 -0
  78. package/dist/commands/solutions/drift-analysis.js +416 -0
  79. package/dist/commands/solutions/drift-analysis.js.map +1 -0
  80. package/dist/commands/solutions/drift.d.ts +32 -0
  81. package/dist/commands/solutions/drift.d.ts.map +1 -0
  82. package/dist/commands/solutions/drift.js +641 -0
  83. package/dist/commands/solutions/drift.js.map +1 -0
  84. package/dist/commands/solutions/fix-planner.d.ts +48 -0
  85. package/dist/commands/solutions/fix-planner.d.ts.map +1 -0
  86. package/dist/commands/solutions/fix-planner.js +43 -0
  87. package/dist/commands/solutions/fix-planner.js.map +1 -0
  88. package/dist/commands/solutions/helpers.d.ts +35 -0
  89. package/dist/commands/solutions/helpers.d.ts.map +1 -0
  90. package/dist/commands/solutions/helpers.js +54 -0
  91. package/dist/commands/solutions/helpers.js.map +1 -0
  92. package/dist/commands/solutions/index.d.ts +18 -0
  93. package/dist/commands/solutions/index.d.ts.map +1 -0
  94. package/dist/commands/solutions/index.js +30 -0
  95. package/dist/commands/solutions/index.js.map +1 -0
  96. package/dist/commands/solutions/list.d.ts +18 -0
  97. package/dist/commands/solutions/list.d.ts.map +1 -0
  98. package/dist/commands/solutions/list.js +174 -0
  99. package/dist/commands/solutions/list.js.map +1 -0
  100. package/dist/commands/solutions/remove.d.ts +18 -0
  101. package/dist/commands/solutions/remove.d.ts.map +1 -0
  102. package/dist/commands/solutions/remove.js +137 -0
  103. package/dist/commands/solutions/remove.js.map +1 -0
  104. package/dist/commands/solutions/risk-calculator.d.ts +33 -0
  105. package/dist/commands/solutions/risk-calculator.d.ts.map +1 -0
  106. package/dist/commands/solutions/risk-calculator.js +79 -0
  107. package/dist/commands/solutions/risk-calculator.js.map +1 -0
  108. package/dist/commands/solutions/show.d.ts +18 -0
  109. package/dist/commands/solutions/show.d.ts.map +1 -0
  110. package/dist/commands/solutions/show.js +165 -0
  111. package/dist/commands/solutions/show.js.map +1 -0
  112. package/dist/commands/status.d.ts +18 -0
  113. package/dist/commands/status.d.ts.map +1 -0
  114. package/dist/commands/status.js +573 -0
  115. package/dist/commands/status.js.map +1 -0
  116. package/dist/commands/telemetry.d.ts +18 -0
  117. package/dist/commands/telemetry.d.ts.map +1 -0
  118. package/dist/commands/telemetry.js +85 -0
  119. package/dist/commands/telemetry.js.map +1 -0
  120. package/dist/commands/tenants/health.d.ts +18 -0
  121. package/dist/commands/tenants/health.d.ts.map +1 -0
  122. package/dist/commands/tenants/health.js +172 -0
  123. package/dist/commands/tenants/health.js.map +1 -0
  124. package/dist/commands/tenants/helpers.d.ts +44 -0
  125. package/dist/commands/tenants/helpers.d.ts.map +1 -0
  126. package/dist/commands/tenants/helpers.js +72 -0
  127. package/dist/commands/tenants/helpers.js.map +1 -0
  128. package/dist/commands/tenants/index.d.ts +19 -0
  129. package/dist/commands/tenants/index.d.ts.map +1 -0
  130. package/dist/commands/tenants/index.js +39 -0
  131. package/dist/commands/tenants/index.js.map +1 -0
  132. package/dist/commands/tenants/inspect.d.ts +18 -0
  133. package/dist/commands/tenants/inspect.d.ts.map +1 -0
  134. package/dist/commands/tenants/inspect.js +176 -0
  135. package/dist/commands/tenants/inspect.js.map +1 -0
  136. package/dist/commands/tenants/list.d.ts +18 -0
  137. package/dist/commands/tenants/list.d.ts.map +1 -0
  138. package/dist/commands/tenants/list.js +144 -0
  139. package/dist/commands/tenants/list.js.map +1 -0
  140. package/dist/commands/tenants/manage.d.ts +20 -0
  141. package/dist/commands/tenants/manage.d.ts.map +1 -0
  142. package/dist/commands/tenants/manage.js +206 -0
  143. package/dist/commands/tenants/manage.js.map +1 -0
  144. package/dist/commands/tenants/show.d.ts +18 -0
  145. package/dist/commands/tenants/show.d.ts.map +1 -0
  146. package/dist/commands/tenants/show.js +191 -0
  147. package/dist/commands/tenants/show.js.map +1 -0
  148. package/dist/commands/validate.d.ts +18 -0
  149. package/dist/commands/validate.d.ts.map +1 -0
  150. package/dist/commands/validate.js +536 -0
  151. package/dist/commands/validate.js.map +1 -0
  152. package/dist/index.d.ts +19 -0
  153. package/dist/index.d.ts.map +1 -0
  154. package/dist/index.js +258 -0
  155. package/dist/index.js.map +1 -0
  156. package/dist/lib/auth.d.ts +51 -0
  157. package/dist/lib/auth.d.ts.map +1 -0
  158. package/dist/lib/auth.js +153 -0
  159. package/dist/lib/auth.js.map +1 -0
  160. package/dist/lib/banner.d.ts +19 -0
  161. package/dist/lib/banner.d.ts.map +1 -0
  162. package/dist/lib/banner.js +78 -0
  163. package/dist/lib/banner.js.map +1 -0
  164. package/dist/lib/command-wrapper.d.ts +56 -0
  165. package/dist/lib/command-wrapper.d.ts.map +1 -0
  166. package/dist/lib/command-wrapper.js +71 -0
  167. package/dist/lib/command-wrapper.js.map +1 -0
  168. package/dist/lib/credentials.d.ts +56 -0
  169. package/dist/lib/credentials.d.ts.map +1 -0
  170. package/dist/lib/credentials.js +146 -0
  171. package/dist/lib/credentials.js.map +1 -0
  172. package/dist/lib/demo-banner.d.ts +15 -0
  173. package/dist/lib/demo-banner.d.ts.map +1 -0
  174. package/dist/lib/demo-banner.js +33 -0
  175. package/dist/lib/demo-banner.js.map +1 -0
  176. package/dist/lib/error-handler.d.ts +51 -0
  177. package/dist/lib/error-handler.d.ts.map +1 -0
  178. package/dist/lib/error-handler.js +458 -0
  179. package/dist/lib/error-handler.js.map +1 -0
  180. package/dist/lib/errors.d.ts +61 -0
  181. package/dist/lib/errors.d.ts.map +1 -0
  182. package/dist/lib/errors.js +168 -0
  183. package/dist/lib/errors.js.map +1 -0
  184. package/dist/lib/formatters.d.ts +55 -0
  185. package/dist/lib/formatters.d.ts.map +1 -0
  186. package/dist/lib/formatters.js +163 -0
  187. package/dist/lib/formatters.js.map +1 -0
  188. package/dist/lib/graph-client.d.ts +74 -0
  189. package/dist/lib/graph-client.d.ts.map +1 -0
  190. package/dist/lib/graph-client.js +231 -0
  191. package/dist/lib/graph-client.js.map +1 -0
  192. package/dist/lib/input.d.ts +22 -0
  193. package/dist/lib/input.d.ts.map +1 -0
  194. package/dist/lib/input.js +120 -0
  195. package/dist/lib/input.js.map +1 -0
  196. package/dist/lib/interactive-wizard.d.ts +26 -0
  197. package/dist/lib/interactive-wizard.d.ts.map +1 -0
  198. package/dist/lib/interactive-wizard.js +550 -0
  199. package/dist/lib/interactive-wizard.js.map +1 -0
  200. package/dist/lib/oss-surface.d.ts +21 -0
  201. package/dist/lib/oss-surface.d.ts.map +1 -0
  202. package/dist/lib/oss-surface.js +29 -0
  203. package/dist/lib/oss-surface.js.map +1 -0
  204. package/dist/lib/output.d.ts +74 -0
  205. package/dist/lib/output.d.ts.map +1 -0
  206. package/dist/lib/output.js +156 -0
  207. package/dist/lib/output.js.map +1 -0
  208. package/dist/lib/picker.d.ts +75 -0
  209. package/dist/lib/picker.d.ts.map +1 -0
  210. package/dist/lib/picker.js +115 -0
  211. package/dist/lib/picker.js.map +1 -0
  212. package/dist/lib/repl.d.ts +19 -0
  213. package/dist/lib/repl.d.ts.map +1 -0
  214. package/dist/lib/repl.js +158 -0
  215. package/dist/lib/repl.js.map +1 -0
  216. package/dist/lib/spinner.d.ts +41 -0
  217. package/dist/lib/spinner.d.ts.map +1 -0
  218. package/dist/lib/spinner.js +126 -0
  219. package/dist/lib/spinner.js.map +1 -0
  220. package/dist/lib/telemetry.d.ts +96 -0
  221. package/dist/lib/telemetry.d.ts.map +1 -0
  222. package/dist/lib/telemetry.js +367 -0
  223. package/dist/lib/telemetry.js.map +1 -0
  224. package/package.json +68 -0
package/README.md ADDED
@@ -0,0 +1,659 @@
1
+ # Pax8 CTA CLI
2
+
3
+ Sync your Copilot Studio agents to all your tenants from the command line.
4
+
5
+ ## Try it in 30 seconds (no install)
6
+
7
+ ```bash
8
+ npx -y pax8-cta demo on && npx -y pax8-cta tenants list
9
+ ```
10
+
11
+ Mock-data mode, no credentials, no Azure setup. Then run `npx -y pax8-cta --help` to explore every command.
12
+
13
+ ## Quick Start
14
+
15
+ ```bash
16
+ # Try demo mode first (no credentials needed)
17
+ pax8-cta init --demo
18
+ pax8-cta tenants list
19
+
20
+ # When ready for production
21
+ pax8-cta demo off
22
+ pax8-cta init
23
+ ```
24
+
25
+ ## Interactive Shell Mode
26
+
27
+ Run `pax8-cta` without arguments to enter interactive mode where you can run commands without typing "pax8-cta" each time:
28
+
29
+ ```bash
30
+ $ pax8-cta
31
+
32
+ ___ _ ____
33
+ / | ____ ____ ____(_) / __/_ ______ _____
34
+ / /| | / __ / _ \/ __ / / /_/ / / / __ \/ ___/
35
+ / ___ |/ /_/ / __/ / / / /__/ /_/ / / / / /__
36
+ /_/ |_|\__, /\___/_/ /_/\___/\__, /_/ /_/\___/
37
+ /____/ /____/
38
+
39
+ Sync your agents to all your tenants | v0.1.0
40
+
41
+ Interactive mode - Type 'help' for commands or 'exit' to quit
42
+
43
+ Pax8 CTA> tenants list
44
+ (displays tenants)
45
+
46
+ Pax8 CTA> demo status
47
+ Demo mode: ENABLED
48
+
49
+ Pax8 CTA> exit
50
+ Goodbye!
51
+ $
52
+ ```
53
+
54
+ ## Installation
55
+
56
+ ### Quick Install (macOS/Linux)
57
+
58
+ ```bash
59
+ curl -fsSL https://raw.githubusercontent.com/pax8labs/pax8-cta/main/install.sh | bash
60
+ ```
61
+
62
+ ### Homebrew (coming soon)
63
+
64
+ ```bash
65
+ # Homebrew tap is not published yet.
66
+ # Use install.sh or binary downloads from GitHub Releases.
67
+ ```
68
+
69
+ ### Download Binary
70
+
71
+ Download the appropriate binary for your platform from the [latest release](https://github.com/pax8labs/pax8-cta/releases/latest):
72
+
73
+ #### macOS
74
+
75
+ ```bash
76
+ # Apple Silicon (M1/M2/M3)
77
+ curl -fsSL https://github.com/pax8labs/pax8-cta/releases/latest/download/pax8-cta-macos-arm64 -o pax8-cta
78
+ chmod +x pax8-cta
79
+ sudo mv pax8-cta /usr/local/bin/
80
+
81
+ # Intel
82
+ curl -fsSL https://github.com/pax8labs/pax8-cta/releases/latest/download/pax8-cta-macos-x64 -o pax8-cta
83
+ chmod +x pax8-cta
84
+ sudo mv pax8-cta /usr/local/bin/
85
+ ```
86
+
87
+ #### Linux
88
+
89
+ ```bash
90
+ # x64
91
+ curl -fsSL https://github.com/pax8labs/pax8-cta/releases/latest/download/pax8-cta-linux-x64 -o pax8-cta
92
+ chmod +x pax8-cta
93
+ sudo mv pax8-cta /usr/local/bin/
94
+
95
+ # ARM64
96
+ curl -fsSL https://github.com/pax8labs/pax8-cta/releases/latest/download/pax8-cta-linux-arm64 -o pax8-cta
97
+ chmod +x pax8-cta
98
+ sudo mv pax8-cta /usr/local/bin/
99
+ ```
100
+
101
+ #### Windows
102
+
103
+ 1. Download [pax8-cta-windows-x64.exe](https://github.com/pax8labs/pax8-cta/releases/latest/download/pax8-cta-windows-x64.exe)
104
+ 2. Rename to `pax8-cta.exe`
105
+ 3. Add to your PATH or move to a directory in your PATH
106
+
107
+ ### npm/npx (Alternative)
108
+
109
+ If you have Node.js installed:
110
+
111
+ ```bash
112
+ # Global install
113
+ npm install -g pax8-cta
114
+
115
+ # Or run with npx (no install needed)
116
+ npx pax8-cta --help
117
+ ```
118
+
119
+ ### Verify Installation
120
+
121
+ ```bash
122
+ pax8-cta --version
123
+ pax8-cta --help
124
+ ```
125
+
126
+ ## Quick Start
127
+
128
+ ### 1. Deploy an Agent to All Tenants
129
+
130
+ ```bash
131
+ pax8-cta deploy --all --solution ./myagent.zip
132
+ ```
133
+
134
+ ### 2. Deploy to Specific Tenants (by tag)
135
+
136
+ ```bash
137
+ pax8-cta deploy --tag production --solution ./myagent.zip
138
+ ```
139
+
140
+ ### 3. View Deployment History
141
+
142
+ ```bash
143
+ # List recent deployments
144
+ pax8-cta deployments list
145
+
146
+ # Show a specific deployment history entry
147
+ pax8-cta deployments show dep-abc123
148
+
149
+ # Check setup/readiness status
150
+ pax8-cta status --setup
151
+ ```
152
+
153
+ ### 4. List Your Tenants
154
+
155
+ ```bash
156
+ pax8-cta tenants list
157
+ ```
158
+
159
+ ### 5. Validate Tenant Access
160
+
161
+ ```bash
162
+ pax8-cta tenants inspect
163
+ ```
164
+
165
+ ## Commands
166
+
167
+ ### Init (Setup)
168
+
169
+ Initialize Pax8 CTA with guided setup.
170
+
171
+ ```bash
172
+ # Quick demo setup (no credentials needed)
173
+ pax8-cta init --demo
174
+
175
+ # Full production setup (interactive wizard)
176
+ pax8-cta init
177
+
178
+ # Custom config location
179
+ pax8-cta init --config ./custom/config.yaml
180
+ ```
181
+
182
+ The setup wizard will prompt for:
183
+
184
+ - Partner Tenant ID (from Partner Center)
185
+ - App Registration Client ID (Azure AD)
186
+ - Environment variable instructions for client secret
187
+ - Optional sample tenant configuration
188
+
189
+ **Options**:
190
+
191
+ - `-c, --config <path>` - Path to create config file (default: `./config/tenants.yaml`)
192
+ - `--demo` - Set up in demo mode (skip credential prompts)
193
+
194
+ ### Demo (Toggle Demo Mode)
195
+
196
+ Toggle demo mode for testing without credentials.
197
+
198
+ ```bash
199
+ # Enable demo mode
200
+ pax8-cta demo on
201
+
202
+ # Disable demo mode
203
+ pax8-cta demo off
204
+
205
+ # Toggle (switch between on/off)
206
+ pax8-cta demo
207
+
208
+ # Check current status
209
+ pax8-cta demo status
210
+ ```
211
+
212
+ Demo mode persists across sessions and allows you to explore all CLI features with mock data.
213
+
214
+ **Why use demo mode?**
215
+
216
+ - Test workflows without setting up credentials
217
+ - Demo the tool to prospects or team members
218
+ - Learn commands before production use
219
+ - Develop and test integrations
220
+
221
+ ### Analyze (Risk Analysis)
222
+
223
+ Analyze deployment risk before deploying to identify potential issues.
224
+
225
+ ```bash
226
+ # Analyze risk for all enabled tenants
227
+ pax8-cta analyze --all --solution ./agent.zip
228
+
229
+ # Analyze risk for tenants with specific tags
230
+ pax8-cta analyze --tag production --solution ./agent.zip
231
+
232
+ # Output results as JSON (for scripting)
233
+ pax8-cta analyze --all --solution ./agent.zip --json
234
+
235
+ # Use custom config file
236
+ pax8-cta analyze --all --solution ./agent.zip --config ./my-config.yaml
237
+ ```
238
+
239
+ The risk analyzer checks for:
240
+
241
+ - **GDAP Permissions**: Missing Power Platform Admin role
242
+ - **Connection Issues**: Expired connection references
243
+ - **Tenant Health**: Recurring deployment failures (2+ times in 24h)
244
+ - **Historical Success**: Low success rates (requires 20+ deployments for statistical confidence)
245
+
246
+ **Risk Levels**:
247
+
248
+ - 🟢 **Low**: All checks passed, ready to deploy
249
+ - 🟡 **Medium**: Some warnings, proceed with caution
250
+ - 🟠 **High**: Multiple issues detected, review carefully
251
+ - 🔴 **Critical**: Blockers present, cannot deploy until fixed
252
+
253
+ **Output includes**:
254
+
255
+ - Risk score and confidence level
256
+ - Success probability percentage
257
+ - Estimated deployment duration
258
+ - Detailed list of issues with resolutions
259
+ - Actionable recommendations
260
+
261
+ **Why use analyze?**
262
+
263
+ - Catch permission issues before deployment
264
+ - Avoid repeating known failures
265
+ - Estimate deployment time for planning
266
+ - Get confidence in deployment success
267
+
268
+ **Options**:
269
+
270
+ - `-s, --solution <path>` - Path to agent solution ZIP file (required)
271
+ - `--all` - Analyze all enabled tenants
272
+ - `-t, --tag <tags...>` - Analyze only tenants with these tags
273
+ - `-c, --config <path>` - Path to config file (default: `./config/tenants.yaml`)
274
+ - `--json` - Output results as JSON
275
+
276
+ ### Deploy
277
+
278
+ Deploy agents to your tenants. (Alias: `ship`)
279
+
280
+ ```bash
281
+ # Deploy to all enabled tenants
282
+ pax8-cta deploy --all --solution ./agent.zip
283
+
284
+ # Deploy to tenants with specific tags
285
+ pax8-cta deploy --tag production --tag eu --solution ./agent.zip
286
+
287
+ # Dry run (preview without deploying)
288
+ pax8-cta deploy --all --solution ./agent.zip --dry-run
289
+
290
+ # Use custom config file
291
+ pax8-cta deploy --all --solution ./agent.zip --config ./my-config.yaml
292
+ ```
293
+
294
+ **Aliases**: `deploy`
295
+
296
+ **Options**:
297
+
298
+ - `-s, --solution <path>` - Path to agent solution ZIP file (required)
299
+ - `--all` - Deploy to all enabled tenants
300
+ - `-t, --tag <tags...>` - Deploy only to tenants with these tags
301
+ - `--dry-run` - Preview deployment without executing
302
+ - `-c, --config <path>` - Path to config file (default: `./config/tenants.yaml`)
303
+
304
+ ### Status
305
+
306
+ Check deployment history in demo mode and setup readiness in real mode. (Alias: `track`)
307
+
308
+ ```bash
309
+ # List recent demo shipments
310
+ pax8-cta status --list
311
+
312
+ # Show setup/readiness status
313
+ pax8-cta status --setup
314
+ ```
315
+
316
+ **Aliases**: `status`
317
+
318
+ **Options**:
319
+
320
+ - `-l, --list` - List recent shipments (demo mode)
321
+ - `--setup` - Show setup/readiness status
322
+
323
+ ### Tenants
324
+
325
+ Manage your tenants. (Alias: `fleet`)
326
+
327
+ ```bash
328
+ # List all tenants
329
+ pax8-cta tenants list
330
+
331
+ # List with filters
332
+ pax8-cta tenants list --tag production
333
+ pax8-cta tenants list --enabled
334
+ pax8-cta tenants list --disabled
335
+
336
+ # Validate tenant access (GDAP permissions)
337
+ pax8-cta tenants inspect
338
+ pax8-cta tenants inspect --tag production
339
+ ```
340
+
341
+ **Aliases**: `tenants`
342
+
343
+ **Commands**:
344
+
345
+ - `list` - List all tenants
346
+ - `inspect` - Validate tenant access and GDAP permissions
347
+
348
+ ### Export
349
+
350
+ (Alias: `pack`)
351
+
352
+ Export a Copilot Studio agent to a solution ZIP file.
353
+
354
+ ```bash
355
+ # Export from source environment
356
+ pax8-cta export --solution MyAgent --output ./myagent.zip
357
+
358
+ # Export specific version
359
+ pax8-cta export --solution MyAgent --version 1.0.0.0 --output ./myagent.zip
360
+
361
+ # Include dependencies
362
+ pax8-cta export --solution MyAgent --output ./myagent.zip --managed
363
+ ```
364
+
365
+ **Aliases**: `export`
366
+
367
+ **Options**:
368
+
369
+ - `-s, --solution <name>` - Solution unique name (required)
370
+ - `-o, --output <path>` - Output file path (required)
371
+ - `-v, --version <version>` - Specific version to export
372
+ - `--managed` - Export as managed solution
373
+ - `-c, --config <path>` - Path to config file
374
+
375
+ ### Import
376
+
377
+ (Alias: `deliver`)
378
+
379
+ Deploy an agent to a single tenant (for testing).
380
+
381
+ ```bash
382
+ # Deploy to specific tenant
383
+ pax8-cta import --tenant <tenant-id> --solution ./agent.zip
384
+
385
+ # Don't overwrite customizations
386
+ pax8-cta import --tenant <tenant-id> --solution ./agent.zip --no-overwrite
387
+
388
+ # Don't publish workflows
389
+ pax8-cta import --tenant <tenant-id> --solution ./agent.zip --no-publish
390
+ ```
391
+
392
+ **Aliases**: `import`
393
+
394
+ **Options**:
395
+
396
+ - `-t, --tenant <id>` - Target tenant ID (required)
397
+ - `-s, --solution <path>` - Path to solution ZIP (required)
398
+ - `--no-overwrite` - Don't overwrite existing customizations
399
+ - `--no-publish` - Don't activate workflows after import
400
+ - `-c, --config <path>` - Path to config file
401
+
402
+ ### Resolve URL
403
+
404
+ Resolve an M365 agent URL and export the containing solution.
405
+
406
+ ```bash
407
+ # Resolve and export
408
+ pax8-cta resolve-url --url "https://..." --output ./agent.zip
409
+ ```
410
+
411
+ **Options**:
412
+
413
+ - `-u, --url <url>` - M365 agent URL (required)
414
+ - `-o, --output <path>` - Output file path (required)
415
+ - `-c, --config <path>` - Path to config file
416
+
417
+ ## Configuration
418
+
419
+ Pax8 CTA uses a YAML configuration file to define your tenants and partner credentials.
420
+
421
+ **Default location**: `./config/tenants.yaml`
422
+
423
+ ### Example Configuration
424
+
425
+ ```yaml
426
+ # Partner/MSP Credentials
427
+ partner:
428
+ tenantId: "your-partner-tenant-id"
429
+ clientId: "your-app-client-id"
430
+ # Client secret should be in PAX8_CTA_CLIENT_SECRET env var
431
+
432
+ # Settings
433
+ settings:
434
+ approval:
435
+ required: true
436
+ minApprovals: 2
437
+ timeout: "24h"
438
+ approvers:
439
+ - admin@partner.com
440
+ - manager@partner.com
441
+
442
+ # Tenants
443
+ tenants:
444
+ - tenantId: "customer-tenant-1"
445
+ name: "Contoso Corporation"
446
+ environmentUrl: "https://contoso.crm.dynamics.com"
447
+ enabled: true
448
+ tags:
449
+ - production
450
+ - us-west
451
+ - premium
452
+
453
+ - tenantId: "customer-tenant-2"
454
+ name: "Fabrikam Inc"
455
+ environmentUrl: "https://fabrikam.crm.dynamics.com"
456
+ enabled: true
457
+ tags:
458
+ - production
459
+ - eu
460
+ - standard
461
+
462
+ - tenantId: "customer-tenant-3"
463
+ name: "Staging Environment"
464
+ environmentUrl: "https://staging.crm.dynamics.com"
465
+ enabled: false
466
+ tags:
467
+ - staging
468
+ - test
469
+ ```
470
+
471
+ ## Environment Variables
472
+
473
+ - `PAX8_CTA_CLIENT_SECRET` - Azure AD app client secret (required)
474
+ - `PAX8_CTA_INSTALL_DIR` - Custom installation directory (default: `/usr/local/bin`)
475
+ - `CONFIG_PATH` - Custom config file path (default: `./config/tenants.yaml`)
476
+
477
+ ## Authentication
478
+
479
+ Pax8 CTA uses Azure AD with GDAP (Granular Delegated Admin Privileges) for secure multi-tenant access.
480
+
481
+ ### Setup
482
+
483
+ 1. **Create Azure AD App Registration**
484
+ - Go to Azure Portal > Azure Active Directory > App Registrations
485
+ - Create new registration
486
+ - Note the Application (client) ID and Directory (tenant) ID
487
+
488
+ 2. **Grant API Permissions**
489
+ - Microsoft Graph API: `User.Read.All`
490
+ - Dynamics CRM: `user_impersonation`
491
+
492
+ 3. **Create Client Secret**
493
+ - In app registration, go to Certificates & secrets
494
+ - Create new client secret
495
+ - Copy the secret value
496
+
497
+ 4. **Configure GDAP for Customer Tenants**
498
+ - Set up GDAP relationships in Partner Center
499
+ - Assign appropriate roles (e.g., Dynamics 365 Administrator)
500
+
501
+ 5. **Set Environment Variable**
502
+
503
+ ```bash
504
+ export PAX8_CTA_CLIENT_SECRET="your-client-secret"
505
+ ```
506
+
507
+ 6. **Update Configuration**
508
+ - Add partner credentials to `config/tenants.yaml`
509
+ - Add customer tenant details
510
+
511
+ ## Demo Mode
512
+
513
+ For testing without Azure AD credentials:
514
+
515
+ ```bash
516
+ # Set in .env file
517
+ DEMO_MODE=true
518
+
519
+ # Then use the CLI normally
520
+ pax8-cta deploy --all --solution ./demo-agent.zip
521
+ ```
522
+
523
+ Demo mode uses in-memory tenants and simulates deployments.
524
+
525
+ ## Troubleshooting
526
+
527
+ ### Command Not Found
528
+
529
+ If `pax8-cta` is not found after installation:
530
+
531
+ ```bash
532
+ # Add to PATH (add to ~/.bashrc or ~/.zshrc for persistence)
533
+ export PATH="/usr/local/bin:$PATH"
534
+
535
+ # Or install to a directory already in PATH
536
+ curl -fsSL https://github.com/pax8labs/pax8-cta/releases/latest/download/pax8-cta-macos-arm64 -o ~/bin/pax8-cta
537
+ chmod +x ~/bin/pax8-cta
538
+ ```
539
+
540
+ ### Authentication Errors
541
+
542
+ ```bash
543
+ # Verify client secret is set
544
+ echo $PARTNER_CLIENT_SECRET
545
+
546
+ # Verify tenant IDs are correct
547
+ pax8-cta tenants list
548
+
549
+ # Validate GDAP access
550
+ pax8-cta tenants inspect
551
+ ```
552
+
553
+ ### Connection Errors
554
+
555
+ ```bash
556
+ # Run direct deployment mode
557
+ pax8-cta deploy --all --direct --solution ./agent.zip
558
+
559
+ # Verify tenant environment URLs
560
+ pax8-cta tenants list
561
+ ```
562
+
563
+ ### Deployment Failures
564
+
565
+ Pax8 CTA CLI deployments run directly now, so there is no worker process to start.
566
+ If a deployment fails, inspect the tenant details and retry the command:
567
+
568
+ ```bash
569
+ pax8-cta deployments list
570
+ pax8-cta deployments show <deployment-id>
571
+ pax8-cta deploy --all --direct --solution ./agent.zip
572
+ ```
573
+
574
+ ## Development
575
+
576
+ ### Build from Source
577
+
578
+ ```bash
579
+ # Clone repository
580
+ git clone https://github.com/pax8labs/pax8-cta.git
581
+ cd pax8-cta
582
+
583
+ # Install dependencies
584
+ pnpm install
585
+
586
+ # Build CLI
587
+ cd packages/cli
588
+ pnpm build
589
+
590
+ # Run locally
591
+ node dist/index.js --help
592
+ ```
593
+
594
+ ### Build Binaries
595
+
596
+ ```bash
597
+ # Install Bun (required for binary compilation)
598
+ curl -fsSL https://bun.sh/install | bash
599
+
600
+ # Build for current platform
601
+ pnpm build:binary
602
+
603
+ # Build for all platforms
604
+ pnpm build:all
605
+
606
+ # Binaries will be in dist/binaries/
607
+ ```
608
+
609
+ ### Run Tests
610
+
611
+ ```bash
612
+ pnpm test
613
+ ```
614
+
615
+ ## Binary Sizes
616
+
617
+ - macOS ARM64: ~59 MB
618
+ - macOS x64: ~64 MB
619
+ - Linux x64: ~99 MB
620
+ - Linux ARM64: ~94 MB
621
+ - Windows x64: ~111 MB
622
+
623
+ Binaries are standalone and include the Bun runtime and all dependencies.
624
+
625
+ ## Telemetry
626
+
627
+ Pax8 CTA CLI collects anonymous usage analytics to help improve the tool. No personally identifiable information is collected.
628
+
629
+ **What's collected:** command names, flags used, success/failure, duration, CLI version, OS type.
630
+
631
+ **What's NOT collected:** tenant IDs, file paths, environment URLs, error details, IP addresses.
632
+
633
+ **Opt out:**
634
+
635
+ ```bash
636
+ pax8-cta telemetry off
637
+ # or
638
+ export PAX8_CTA_TELEMETRY_DISABLED=1
639
+ ```
640
+
641
+ **Check status:**
642
+
643
+ ```bash
644
+ pax8-cta telemetry status
645
+ ```
646
+
647
+ ## License
648
+
649
+ Apache 2.0
650
+
651
+ ## Support
652
+
653
+ - **Documentation**: https://github.com/pax8labs/pax8-cta
654
+ - **Issues**: https://github.com/pax8labs/pax8-cta/issues
655
+ - **Discussions**: https://github.com/pax8labs/pax8-cta/discussions
656
+
657
+ ## Related Projects
658
+
659
+ - **Pax8 CTA Core**: Core library for Dataverse/Dynamics 365 operations
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Copyright 2024 Pax8, Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { Command } from "commander";
17
+ import { type PreconditionFailure } from "@pax8-cta/core";
18
+ export declare const analyzeCommand: Command;
19
+ /**
20
+ * After-action picker for preflight failures. TTY-only (matches the
21
+ * drift-after-action UX from #404). Renders a numbered list of failures
22
+ * and dispatches based on remediation kind:
23
+ * - `link` → print URL, optionally `open` it.
24
+ * - `command` → print the command and spawn it.
25
+ * - `manual` → print the substituted steps.
26
+ */
27
+ export declare function maybePromptPreconditionFix(failures: PreconditionFailure[], jsonOutput: boolean): Promise<void>;
28
+ //# sourceMappingURL=analyze.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyze.d.ts","sourceRoot":"","sources":["../../src/commands/analyze.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,OAAO,EASL,KAAK,mBAAmB,EAEzB,MAAM,gBAAgB,CAAC;AAsBxB,eAAO,MAAM,cAAc,SAsNvB,CAAC;AAwVL;;;;;;;GAOG;AACH,wBAAsB,0BAA0B,CAC9C,QAAQ,EAAE,mBAAmB,EAAE,EAC/B,UAAU,EAAE,OAAO,GAClB,OAAO,CAAC,IAAI,CAAC,CAef"}