@sembix/cli 1.2.1 → 1.4.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 (205) hide show
  1. package/COMMANDS.md +1522 -0
  2. package/QUICKSTART.md +829 -0
  3. package/README.md +1976 -309
  4. package/USAGE-EXAMPLES.md +872 -0
  5. package/config.example.yaml +3 -0
  6. package/dist/commands/configure.d.ts.map +1 -1
  7. package/dist/commands/configure.js +172 -2
  8. package/dist/commands/configure.js.map +1 -1
  9. package/dist/commands/index.d.ts +10 -0
  10. package/dist/commands/index.d.ts.map +1 -0
  11. package/dist/commands/index.js +11 -0
  12. package/dist/commands/index.js.map +1 -0
  13. package/dist/commands/login.d.ts +19 -0
  14. package/dist/commands/login.d.ts.map +1 -0
  15. package/dist/commands/login.js +118 -0
  16. package/dist/commands/login.js.map +1 -0
  17. package/dist/commands/logout.d.ts +21 -0
  18. package/dist/commands/logout.d.ts.map +1 -0
  19. package/dist/commands/logout.js +66 -0
  20. package/dist/commands/logout.js.map +1 -0
  21. package/dist/commands/profile-project.d.ts +14 -0
  22. package/dist/commands/profile-project.d.ts.map +1 -0
  23. package/dist/commands/profile-project.js +123 -0
  24. package/dist/commands/profile-project.js.map +1 -0
  25. package/dist/commands/profile.d.ts +26 -0
  26. package/dist/commands/profile.d.ts.map +1 -0
  27. package/dist/commands/profile.js +177 -0
  28. package/dist/commands/profile.js.map +1 -0
  29. package/dist/commands/project.d.ts +16 -0
  30. package/dist/commands/project.d.ts.map +1 -0
  31. package/dist/commands/project.js +153 -0
  32. package/dist/commands/project.js.map +1 -0
  33. package/dist/commands/setup.js +3 -0
  34. package/dist/commands/setup.js.map +1 -1
  35. package/dist/commands/workflow.d.ts +91 -0
  36. package/dist/commands/workflow.d.ts.map +1 -0
  37. package/dist/commands/workflow.js +1201 -0
  38. package/dist/commands/workflow.js.map +1 -0
  39. package/dist/config-schema.d.ts +26 -0
  40. package/dist/config-schema.d.ts.map +1 -1
  41. package/dist/config-schema.js +24 -1
  42. package/dist/config-schema.js.map +1 -1
  43. package/dist/config.d.ts +4 -0
  44. package/dist/config.d.ts.map +1 -1
  45. package/dist/config.js +23 -2
  46. package/dist/config.js.map +1 -1
  47. package/dist/index.js +324 -1
  48. package/dist/index.js.map +1 -1
  49. package/dist/prompts/environment-setup.d.ts.map +1 -1
  50. package/dist/prompts/environment-setup.js +12 -0
  51. package/dist/prompts/environment-setup.js.map +1 -1
  52. package/dist/prompts/project-selection.d.ts +8 -0
  53. package/dist/prompts/project-selection.d.ts.map +1 -0
  54. package/dist/prompts/project-selection.js +132 -0
  55. package/dist/prompts/project-selection.js.map +1 -0
  56. package/dist/prompts/workflow-inputs.d.ts +10 -0
  57. package/dist/prompts/workflow-inputs.d.ts.map +1 -0
  58. package/dist/prompts/workflow-inputs.js +71 -0
  59. package/dist/prompts/workflow-inputs.js.map +1 -0
  60. package/dist/prompts/workflow-selection.d.ts +8 -0
  61. package/dist/prompts/workflow-selection.d.ts.map +1 -0
  62. package/dist/prompts/workflow-selection.js +147 -0
  63. package/dist/prompts/workflow-selection.js.map +1 -0
  64. package/dist/sembix-cli-1.4.0.tgz +0 -0
  65. package/dist/services/cognito-auth.d.ts +92 -0
  66. package/dist/services/cognito-auth.d.ts.map +1 -0
  67. package/dist/services/cognito-auth.js +319 -0
  68. package/dist/services/cognito-auth.js.map +1 -0
  69. package/dist/services/studio-api-client.d.ts +127 -0
  70. package/dist/services/studio-api-client.d.ts.map +1 -0
  71. package/dist/services/studio-api-client.js +291 -0
  72. package/dist/services/studio-api-client.js.map +1 -0
  73. package/dist/types/studio.d.ts +82 -0
  74. package/dist/types/studio.d.ts.map +1 -0
  75. package/dist/types/studio.js +7 -0
  76. package/dist/types/studio.js.map +1 -0
  77. package/dist/types.d.ts +286 -0
  78. package/dist/types.d.ts.map +1 -1
  79. package/dist/types.js +5 -0
  80. package/dist/types.js.map +1 -1
  81. package/dist/utils/browser-auth.d.ts +45 -0
  82. package/dist/utils/browser-auth.d.ts.map +1 -0
  83. package/dist/utils/browser-auth.js +168 -0
  84. package/dist/utils/browser-auth.js.map +1 -0
  85. package/dist/utils/cognito-auth.d.ts +3 -0
  86. package/dist/utils/cognito-auth.d.ts.map +1 -0
  87. package/dist/utils/cognito-auth.js +3 -0
  88. package/dist/utils/cognito-auth.js.map +1 -0
  89. package/dist/utils/config-file.d.ts +40 -0
  90. package/dist/utils/config-file.d.ts.map +1 -1
  91. package/dist/utils/config-file.js +158 -4
  92. package/dist/utils/config-file.js.map +1 -1
  93. package/dist/utils/config-loader.d.ts.map +1 -1
  94. package/dist/utils/config-loader.js +15 -2
  95. package/dist/utils/config-loader.js.map +1 -1
  96. package/dist/utils/environment.d.ts +22 -0
  97. package/dist/utils/environment.d.ts.map +1 -0
  98. package/dist/utils/environment.js +39 -0
  99. package/dist/utils/environment.js.map +1 -0
  100. package/dist/utils/error-handler.d.ts +53 -0
  101. package/dist/utils/error-handler.d.ts.map +1 -0
  102. package/dist/utils/error-handler.js +174 -0
  103. package/dist/utils/error-handler.js.map +1 -0
  104. package/dist/utils/fuzzy-match.d.ts +31 -0
  105. package/dist/utils/fuzzy-match.d.ts.map +1 -0
  106. package/dist/utils/fuzzy-match.js +138 -0
  107. package/dist/utils/fuzzy-match.js.map +1 -0
  108. package/dist/utils/input-parser.d.ts +14 -0
  109. package/dist/utils/input-parser.d.ts.map +1 -0
  110. package/dist/utils/input-parser.js +34 -0
  111. package/dist/utils/input-parser.js.map +1 -0
  112. package/dist/utils/output.d.ts +55 -0
  113. package/dist/utils/output.d.ts.map +1 -0
  114. package/dist/utils/output.js +80 -0
  115. package/dist/utils/output.js.map +1 -0
  116. package/dist/utils/recent-workflows.d.ts +37 -0
  117. package/dist/utils/recent-workflows.d.ts.map +1 -0
  118. package/dist/utils/recent-workflows.js +172 -0
  119. package/dist/utils/recent-workflows.js.map +1 -0
  120. package/dist/utils/studio-api-client.d.ts +3 -0
  121. package/dist/utils/studio-api-client.d.ts.map +1 -0
  122. package/dist/utils/studio-api-client.js +3 -0
  123. package/dist/utils/studio-api-client.js.map +1 -0
  124. package/dist/utils/studio-api.d.ts +53 -0
  125. package/dist/utils/studio-api.d.ts.map +1 -0
  126. package/dist/utils/studio-api.js +102 -0
  127. package/dist/utils/studio-api.js.map +1 -0
  128. package/dist/utils/studio-config.d.ts +74 -0
  129. package/dist/utils/studio-config.d.ts.map +1 -0
  130. package/dist/utils/studio-config.js +213 -0
  131. package/dist/utils/studio-config.js.map +1 -0
  132. package/dist/utils/token-manager.d.ts +4 -0
  133. package/dist/utils/token-manager.d.ts.map +1 -0
  134. package/dist/utils/token-manager.js +3 -0
  135. package/dist/utils/token-manager.js.map +1 -0
  136. package/dist/utils/ui.d.ts +55 -1
  137. package/dist/utils/ui.d.ts.map +1 -1
  138. package/dist/utils/ui.js +151 -2
  139. package/dist/utils/ui.js.map +1 -1
  140. package/package.json +4 -1
  141. package/dist/__tests__/config-schema.test.d.ts +0 -2
  142. package/dist/__tests__/config-schema.test.d.ts.map +0 -1
  143. package/dist/__tests__/config-schema.test.js +0 -471
  144. package/dist/__tests__/config-schema.test.js.map +0 -1
  145. package/dist/__tests__/config.test.d.ts +0 -2
  146. package/dist/__tests__/config.test.d.ts.map +0 -1
  147. package/dist/__tests__/config.test.js +0 -75
  148. package/dist/__tests__/config.test.js.map +0 -1
  149. package/dist/__tests__/integration/configure.test.d.ts +0 -2
  150. package/dist/__tests__/integration/configure.test.d.ts.map +0 -1
  151. package/dist/__tests__/integration/configure.test.js +0 -247
  152. package/dist/__tests__/integration/configure.test.js.map +0 -1
  153. package/dist/__tests__/integration/fixtures/configs.d.ts +0 -477
  154. package/dist/__tests__/integration/fixtures/configs.d.ts.map +0 -1
  155. package/dist/__tests__/integration/fixtures/configs.js +0 -175
  156. package/dist/__tests__/integration/fixtures/configs.js.map +0 -1
  157. package/dist/__tests__/integration/helpers/cli-runner.d.ts +0 -63
  158. package/dist/__tests__/integration/helpers/cli-runner.d.ts.map +0 -1
  159. package/dist/__tests__/integration/helpers/cli-runner.js +0 -152
  160. package/dist/__tests__/integration/helpers/cli-runner.js.map +0 -1
  161. package/dist/__tests__/integration/helpers/command-runner.d.ts +0 -53
  162. package/dist/__tests__/integration/helpers/command-runner.d.ts.map +0 -1
  163. package/dist/__tests__/integration/helpers/command-runner.js +0 -117
  164. package/dist/__tests__/integration/helpers/command-runner.js.map +0 -1
  165. package/dist/__tests__/integration/studio-create.test.d.ts +0 -2
  166. package/dist/__tests__/integration/studio-create.test.d.ts.map +0 -1
  167. package/dist/__tests__/integration/studio-create.test.js +0 -209
  168. package/dist/__tests__/integration/studio-create.test.js.map +0 -1
  169. package/dist/__tests__/integration/studio-update.test.d.ts +0 -2
  170. package/dist/__tests__/integration/studio-update.test.d.ts.map +0 -1
  171. package/dist/__tests__/integration/studio-update.test.js +0 -166
  172. package/dist/__tests__/integration/studio-update.test.js.map +0 -1
  173. package/dist/commands/__tests__/configure.test.d.ts +0 -2
  174. package/dist/commands/__tests__/configure.test.d.ts.map +0 -1
  175. package/dist/commands/__tests__/configure.test.js +0 -229
  176. package/dist/commands/__tests__/configure.test.js.map +0 -1
  177. package/dist/prompts/__tests__/environment-setup.test.d.ts +0 -2
  178. package/dist/prompts/__tests__/environment-setup.test.d.ts.map +0 -1
  179. package/dist/prompts/__tests__/environment-setup.test.js +0 -206
  180. package/dist/prompts/__tests__/environment-setup.test.js.map +0 -1
  181. package/dist/prompts/__tests__/hub-integration.test.d.ts +0 -2
  182. package/dist/prompts/__tests__/hub-integration.test.d.ts.map +0 -1
  183. package/dist/prompts/__tests__/hub-integration.test.js +0 -126
  184. package/dist/prompts/__tests__/hub-integration.test.js.map +0 -1
  185. package/dist/prompts/__tests__/prompt-helpers.test.d.ts +0 -2
  186. package/dist/prompts/__tests__/prompt-helpers.test.d.ts.map +0 -1
  187. package/dist/prompts/__tests__/prompt-helpers.test.js +0 -235
  188. package/dist/prompts/__tests__/prompt-helpers.test.js.map +0 -1
  189. package/dist/sembix-cli-1.2.1.tgz +0 -0
  190. package/dist/utils/__tests__/config-file.test.d.ts +0 -2
  191. package/dist/utils/__tests__/config-file.test.d.ts.map +0 -1
  192. package/dist/utils/__tests__/config-file.test.js +0 -218
  193. package/dist/utils/__tests__/config-file.test.js.map +0 -1
  194. package/dist/utils/__tests__/config-loader.test.d.ts +0 -2
  195. package/dist/utils/__tests__/config-loader.test.d.ts.map +0 -1
  196. package/dist/utils/__tests__/config-loader.test.js +0 -325
  197. package/dist/utils/__tests__/config-loader.test.js.map +0 -1
  198. package/dist/utils/__tests__/github.test.d.ts +0 -2
  199. package/dist/utils/__tests__/github.test.d.ts.map +0 -1
  200. package/dist/utils/__tests__/github.test.js +0 -282
  201. package/dist/utils/__tests__/github.test.js.map +0 -1
  202. package/dist/utils/__tests__/ui.test.d.ts +0 -2
  203. package/dist/utils/__tests__/ui.test.d.ts.map +0 -1
  204. package/dist/utils/__tests__/ui.test.js +0 -256
  205. package/dist/utils/__tests__/ui.test.js.map +0 -1
package/COMMANDS.md ADDED
@@ -0,0 +1,1522 @@
1
+ # Sembix CLI - Command Reference
2
+
3
+ Complete reference for all Sembix CLI commands.
4
+
5
+ ## Command Structure
6
+
7
+ ```
8
+ sembix <product> <action> [options] [arguments]
9
+ ```
10
+
11
+ - **product**: The Sembix product (e.g., `studio`)
12
+ - **action**: What you want to do (e.g., `create`, `list`, `add-hub`)
13
+ - **options**: Flags like `--token` or `--repo`
14
+ - **arguments**: Required or optional values (e.g., environment name)
15
+
16
+ ---
17
+
18
+ ## Global Commands
19
+
20
+ ### `sembix configure`
21
+
22
+ Configure Sembix CLI credentials and settings interactively.
23
+
24
+ **Usage:**
25
+
26
+ ```bash
27
+ sembix configure
28
+ ```
29
+
30
+ **What it does:**
31
+
32
+ 1. Prompts for your GitHub Personal Access Token
33
+ 2. Prompts for your default GitHub organization (optional)
34
+ 3. Optionally prompts to configure a Sembix Studio profile for API access:
35
+ - Studio API URL
36
+ - Cognito User Pool ID, Client ID, Region, and Domain
37
+ 4. Saves configuration to `~/.sembix/config` with secure permissions (0600)
38
+
39
+ **When to use:**
40
+
41
+ - First time setup (recommended)
42
+ - Updating your GitHub token
43
+ - Changing your default organization
44
+ - Adding or updating Studio profiles for API access
45
+
46
+ **Output:**
47
+
48
+ ```
49
+ Configuration saved to ~/.sembix/config
50
+ ```
51
+
52
+ After running this command, you won't need to specify `--token` or set `GITHUB_TOKEN` for future commands. If you configured a Studio profile, you can run `sembix login` to authenticate.
53
+
54
+ ---
55
+
56
+ ## Studio Commands
57
+
58
+ All commands for managing Sembix Studio deployments.
59
+
60
+ ---
61
+
62
+ ## Studio CLI Commands
63
+
64
+ Commands for authenticating with and managing Sembix Studio via API.
65
+
66
+ ### `sembix login [profile]`
67
+
68
+ Authenticate with Sembix Studio via Cognito OAuth.
69
+
70
+ **Usage:**
71
+
72
+ ```bash
73
+ # Login with default profile
74
+ sembix login
75
+
76
+ # Login with specific profile
77
+ sembix login production
78
+
79
+ # Using --profile flag
80
+ sembix login --profile staging
81
+ ```
82
+
83
+ **Options:**
84
+
85
+ - `[profile]` - Profile name to use (default: "default")
86
+ - `-p, --profile <name>` - Alternative way to specify profile
87
+
88
+ **What it does:**
89
+
90
+ 1. Loads the specified profile configuration
91
+ 2. Opens your browser for Cognito authentication
92
+ 3. Starts a local callback server to receive the OAuth code
93
+ 4. Exchanges the code for access tokens
94
+ 5. Stores tokens securely in `~/.sembix/tokens/<profile>.json`
95
+
96
+ **When to use:**
97
+
98
+ - After configuring a Studio profile with `sembix configure`
99
+ - When tokens have expired
100
+ - Before running workflow commands
101
+
102
+ **Output:**
103
+
104
+ ```bash
105
+ $ sembix login production
106
+ ━━━ Sembix Studio Authentication ━━━
107
+ Authenticating with profile: production
108
+ Starting authentication flow...
109
+ A browser window will open for you to sign in.
110
+
111
+ ✓ Authentication successful!
112
+ Token expires: 12/15/2024, 3:45:00 PM
113
+ ```
114
+
115
+ ---
116
+
117
+ ### `sembix logout [profile]`
118
+
119
+ Log out from Sembix Studio by removing stored tokens.
120
+
121
+ **Usage:**
122
+
123
+ ```bash
124
+ # Logout from default profile
125
+ sembix logout
126
+
127
+ # Logout from specific profile
128
+ sembix logout production
129
+
130
+ # Logout from all profiles
131
+ sembix logout --all
132
+ ```
133
+
134
+ **Options:**
135
+
136
+ - `[profile]` - Profile name to logout from (default: "default")
137
+ - `-p, --profile <name>` - Alternative way to specify profile
138
+ - `--all` - Remove tokens for all profiles
139
+
140
+ **What it does:**
141
+
142
+ 1. Removes stored authentication tokens for the specified profile
143
+ 2. Requires re-authentication with `sembix login` for future API calls
144
+
145
+ **Examples:**
146
+
147
+ ```bash
148
+ $ sembix logout production
149
+ ✓ Logged out from profile: production
150
+
151
+ $ sembix logout --all
152
+ ✓ Logged out from all profiles
153
+ ```
154
+
155
+ ---
156
+
157
+ ### `sembix profile list`
158
+
159
+ List all configured Studio profiles.
160
+
161
+ **Usage:**
162
+
163
+ ```bash
164
+ sembix profile list
165
+ ```
166
+
167
+ **What it does:**
168
+
169
+ - Displays all configured profiles
170
+ - Shows API URL for each profile
171
+ - Indicates which profile is the default (marked with `*`)
172
+ - Shows authentication status (whether tokens exist)
173
+
174
+ **Output:**
175
+
176
+ ```bash
177
+ $ sembix profile list
178
+ ━━━ Configured Profiles ━━━
179
+
180
+ * default
181
+ API URL: https://studio.example.com
182
+ Authenticated: Yes
183
+
184
+ production
185
+ API URL: https://prod.studio.example.com
186
+ Authenticated: Yes
187
+
188
+ staging
189
+ API URL: https://staging.studio.example.com
190
+ Authenticated: No
191
+ ```
192
+
193
+ ---
194
+
195
+ ### `sembix profile show <name>`
196
+
197
+ Show detailed information for a specific profile.
198
+
199
+ **Usage:**
200
+
201
+ ```bash
202
+ sembix profile show production
203
+ ```
204
+
205
+ **What it does:**
206
+
207
+ - Displays full configuration for the specified profile
208
+ - Shows API URL, Cognito configuration
209
+ - Does not display sensitive token values
210
+
211
+ **Output:**
212
+
213
+ ```bash
214
+ $ sembix profile show production
215
+ ━━━ Profile: production ━━━
216
+
217
+ API URL: https://prod.studio.example.com
218
+ Cognito User Pool ID: us-east-1_ABC123
219
+ Cognito Client ID: abc123def456
220
+ Cognito Region: us-east-1
221
+ Cognito Domain: https://auth.example.com
222
+ Authenticated: Yes
223
+ Token Expires: 12/15/2024, 3:45:00 PM
224
+ ```
225
+
226
+ ---
227
+
228
+ ### `sembix profile delete <name>`
229
+
230
+ Delete a profile and its stored tokens.
231
+
232
+ **Usage:**
233
+
234
+ ```bash
235
+ sembix profile delete staging
236
+ ```
237
+
238
+ **What it does:**
239
+
240
+ 1. Prompts for confirmation
241
+ 2. Removes profile configuration from `~/.sembix/config`
242
+ 3. Removes stored tokens from `~/.sembix/tokens/<profile>.json`
243
+
244
+ **Output:**
245
+
246
+ ```bash
247
+ $ sembix profile delete staging
248
+ ? Are you sure you want to delete profile 'staging'? Yes
249
+ ✓ Profile 'staging' deleted successfully
250
+ ```
251
+
252
+ ---
253
+
254
+ ### `sembix profile set-default <name>`
255
+
256
+ Set a profile as the default.
257
+
258
+ **Usage:**
259
+
260
+ ```bash
261
+ sembix profile set-default production
262
+ ```
263
+
264
+ **What it does:**
265
+
266
+ - Sets the specified profile as the default
267
+ - Default profile is used when no `--profile` flag is provided
268
+
269
+ **Output:**
270
+
271
+ ```bash
272
+ $ sembix profile set-default production
273
+ ✓ Default profile set to: production
274
+ ```
275
+
276
+ ---
277
+
278
+ ### `sembix profile set-default-project <profile> <project-id>`
279
+
280
+ Set a default project for a profile.
281
+
282
+ **Usage:**
283
+
284
+ ```bash
285
+ sembix profile set-default-project production proj_abc123
286
+ ```
287
+
288
+ **What it does:**
289
+
290
+ - Associates a default project ID with the specified profile
291
+ - Allows omitting `--project-id` in workflow commands
292
+ - Stored in profile configuration
293
+
294
+ **Output:**
295
+
296
+ ```bash
297
+ $ sembix profile set-default-project production proj_abc123
298
+ ✓ Default project set for profile 'production': proj_abc123
299
+ ```
300
+
301
+ ---
302
+
303
+ ### `sembix profile get-default-project <profile>`
304
+
305
+ Get the default project for a profile.
306
+
307
+ **Usage:**
308
+
309
+ ```bash
310
+ sembix profile get-default-project production
311
+ ```
312
+
313
+ **Output:**
314
+
315
+ ```bash
316
+ $ sembix profile get-default-project production
317
+ proj_abc123
318
+ ```
319
+
320
+ ---
321
+
322
+ ### `sembix profile clear-default-project <profile>`
323
+
324
+ Clear the default project for a profile.
325
+
326
+ **Usage:**
327
+
328
+ ```bash
329
+ sembix profile clear-default-project production
330
+ ```
331
+
332
+ **Output:**
333
+
334
+ ```bash
335
+ $ sembix profile clear-default-project production
336
+ ✓ Default project cleared for profile 'production'
337
+ ```
338
+
339
+ ---
340
+
341
+ ## Project Commands
342
+
343
+ Commands for managing Studio projects.
344
+
345
+ ---
346
+
347
+ ### `sembix project list`
348
+
349
+ List and search projects in your Studio instance.
350
+
351
+ **Usage:**
352
+
353
+ ```bash
354
+ # List all projects
355
+ sembix project list
356
+
357
+ # Filter by name
358
+ sembix project list --name "My Project"
359
+
360
+ # Filter by IDs
361
+ sembix project list --ids "proj_123,proj_456"
362
+
363
+ # With specific profile
364
+ sembix project list --profile production
365
+
366
+ # With output formatting
367
+ sembix project list --output pretty
368
+ ```
369
+
370
+ **Options:**
371
+
372
+ - `-p, --profile <name>` - Studio profile to use
373
+ - `--name <name>` - Filter by project name (partial match)
374
+ - `--ids <ids>` - Filter by comma-separated project IDs
375
+ - `--output <format>` - Output format: json, pretty, or text
376
+ - `--pretty` - Pretty-print JSON output
377
+
378
+ **What it does:**
379
+
380
+ 1. Authenticates with Studio API
381
+ 2. Queries projects with specified filters
382
+ 3. Returns list of matching projects
383
+
384
+ **Output (JSON):**
385
+
386
+ ```json
387
+ {
388
+ "message": "Projects retrieved successfully",
389
+ "items": [
390
+ {
391
+ "projectId": "proj_abc123",
392
+ "name": "My Project",
393
+ "description": "Project description",
394
+ "state": "ACTIVE",
395
+ "createdAt": "2024-01-15T10:00:00Z",
396
+ "workflowPackConfigured": true
397
+ }
398
+ ]
399
+ }
400
+ ```
401
+
402
+ **Output (Pretty):**
403
+
404
+ ```
405
+ Projects:
406
+ 1. My Project (proj_abc123)
407
+ State: ACTIVE
408
+ Created: 2024-01-15T10:00:00Z
409
+ Workflow Pack: Configured
410
+ ```
411
+
412
+ ---
413
+
414
+ ### `sembix project show`
415
+
416
+ Show details for a specific project.
417
+
418
+ **Usage:**
419
+
420
+ ```bash
421
+ sembix project show --project-id proj_abc123
422
+
423
+ # With specific profile
424
+ sembix project show --project-id proj_abc123 --profile production
425
+ ```
426
+
427
+ **Options:**
428
+
429
+ - `--project-id <id>` - **Required** - Project ID
430
+ - `-p, --profile <name>` - Studio profile to use
431
+ - `--output <format>` - Output format: json, pretty, or text
432
+ - `--pretty` - Pretty-print JSON output
433
+
434
+ **What it does:**
435
+
436
+ 1. Authenticates with Studio API
437
+ 2. Fetches detailed project information
438
+ 3. Returns project details
439
+
440
+ **Output:**
441
+
442
+ ```json
443
+ {
444
+ "projectId": "proj_abc123",
445
+ "name": "My Project",
446
+ "description": "Detailed project description",
447
+ "state": "ACTIVE",
448
+ "createdAt": "2024-01-15T10:00:00Z",
449
+ "updatedAt": "2024-01-20T15:30:00Z",
450
+ "createdBy": "user_123",
451
+ "updatedBy": "user_456",
452
+ "workflowPackConfigured": true,
453
+ "providerConfiguration": {...},
454
+ "issueTrackerIntegration": {...}
455
+ }
456
+ ```
457
+
458
+ ---
459
+
460
+ ## Workflow Commands
461
+
462
+ Commands for managing workflow instances (definitions) and workflow runs (executions).
463
+
464
+ ---
465
+
466
+ ### `sembix workflow list`
467
+
468
+ List workflow instances (definitions) in your Studio instance.
469
+
470
+ **Usage:**
471
+
472
+ ```bash
473
+ # List all workflows
474
+ sembix workflow list
475
+
476
+ # Filter by project
477
+ sembix workflow list --project-id proj_123
478
+
479
+ # Filter by template IDs
480
+ sembix workflow list --workflow-template-ids "tmpl_1,tmpl_2"
481
+
482
+ # Filter by parent workflow
483
+ sembix workflow list --parent-workflow-id wf_parent
484
+
485
+ # With specific profile
486
+ sembix workflow list --profile production
487
+ ```
488
+
489
+ **Options:**
490
+
491
+ - `-p, --profile <name>` - Profile to use
492
+ - `--project-id <id>` - Filter by project ID
493
+ - `--workflow-template-ids <ids>` - Filter by comma-separated template IDs
494
+ - `--parent-workflow-id <id>` - Filter by parent workflow ID
495
+ - `--output <format>` - Output format: json, pretty, or text
496
+ - `--pretty` - Pretty-print JSON output
497
+
498
+ **Output:**
499
+
500
+ ```json
501
+ {
502
+ "workflows": [
503
+ {
504
+ "workflowId": "wf_abc123",
505
+ "projectId": "proj_123",
506
+ "name": "Deploy to Production",
507
+ "state": "ACTIVE",
508
+ "workflowTemplateId": "tmpl_deploy",
509
+ "createdAt": "2024-01-15T10:00:00Z"
510
+ }
511
+ ]
512
+ }
513
+ ```
514
+
515
+ ---
516
+
517
+ ### `sembix workflow show`
518
+
519
+ Show details for a specific workflow instance.
520
+
521
+ **Usage:**
522
+
523
+ ```bash
524
+ sembix workflow show --project-id proj_123 --workflow-id wf_456
525
+ ```
526
+
527
+ **Options:**
528
+
529
+ - `-p, --profile <name>` - Profile to use
530
+ - `--project-id <id>` - **Required** - Project ID
531
+ - `--workflow-id <id>` - **Required** - Workflow ID
532
+ - `--output <format>` - Output format: json, pretty, or text
533
+ - `--pretty` - Pretty-print JSON output
534
+
535
+ ---
536
+
537
+ ### `sembix workflow start`
538
+
539
+ Start a workflow instance (creates a new run).
540
+
541
+ **Usage:**
542
+
543
+ ```bash
544
+ # Interactive mode (prompts for project, workflow, and inputs)
545
+ sembix workflow start
546
+
547
+ # With project ID and workflow ID
548
+ sembix workflow start --project-id proj_123 --workflow-id wf_456
549
+
550
+ # With workflow name instead of ID
551
+ sembix workflow start --project-id proj_123 --workflow-name "Deploy to Production"
552
+
553
+ # With inline JSON inputs
554
+ sembix workflow start --project-id proj_123 --workflow-id wf_456 --inputs '{"key":"value"}'
555
+
556
+ # With inputs from file
557
+ sembix workflow start --project-id proj_123 --workflow-id wf_456 --inputs @inputs.json
558
+
559
+ # Non-interactive mode (skip prompts)
560
+ sembix workflow start --project-id proj_123 --workflow-id wf_456 --no-interactive
561
+
562
+ # Using default project (set via profile set-default-project)
563
+ sembix workflow start --workflow-id wf_456 --inputs '{...}'
564
+ ```
565
+
566
+ **Options:**
567
+
568
+ - `-p, --profile <name>` - Profile to use
569
+ - `--project-id <id>` - Project ID (optional in interactive mode - uses default or prompts)
570
+ - `--workflow-id <id>` - Workflow ID (use this OR --workflow-name, optional in interactive mode)
571
+ - `--workflow-name <name>` - Workflow name (use this OR --workflow-id, optional in interactive mode)
572
+ - `--inputs <json>` - Input variables as JSON string or @file.json
573
+ - `--workspace-id <id>` - Workspace ID
574
+ - `--workspace-name <name>` - Workspace name
575
+ - `--issue-id <id>` - Issue ID
576
+ - `--issue-key <key>` - Issue key
577
+ - `--no-interactive` - Disable interactive prompts for inputs
578
+ - `--output <format>` - Output format: json, pretty, or text
579
+ - `--pretty` - Pretty-print JSON output
580
+
581
+ **Interactive Mode:**
582
+
583
+ When `--project-id` or `--workflow-id` are omitted, the CLI enters interactive mode:
584
+
585
+ 1. **Project Selection:**
586
+ - If no default project is set, prompts to select from available projects
587
+ - If default project is set, uses it automatically
588
+
589
+ 2. **Workflow Selection:**
590
+ - Prompts to select from workflows in the chosen project
591
+ - Can search by name
592
+
593
+ 3. **Input Configuration:**
594
+ - Prompts for each required input variable
595
+ - Shows data type and description for each input
596
+ - Validates input values
597
+
598
+ **What it does:**
599
+
600
+ 1. Validates authentication (refreshes tokens if needed)
601
+ 2. Parses input configuration from JSON string or file
602
+ 3. Calls Studio API to start workflow execution
603
+ 4. Returns run ID and task ARN
604
+
605
+ **Examples:**
606
+
607
+ ```bash
608
+ # Start workflow with inline JSON inputs
609
+ $ sembix workflow start --project-id proj_123 --workflow-id wf_456 --inputs '{"environment":"production","version":"1.2.3"}'
610
+ ━━━ Start Workflow Execution ━━━
611
+ ✓ Workflow started successfully!
612
+ Run ID: run_789abc
613
+ Task ARN: arn:aws:ecs:us-east-1:123456789012:task/cluster/abc123
614
+
615
+ # Start workflow with inputs from file
616
+ $ cat inputs.json
617
+ {
618
+ "environment": "staging",
619
+ "version": "1.2.3",
620
+ "config": {
621
+ "debug": true
622
+ }
623
+ }
624
+
625
+ $ sembix workflow start --project-id proj_123 --workflow-id wf_456 --inputs @inputs.json
626
+ ✓ Workflow started successfully!
627
+ Run ID: run_xyz789
628
+ ```
629
+
630
+ ---
631
+
632
+ ### `sembix workflow template show`
633
+
634
+ Show workflow template details.
635
+
636
+ **Usage:**
637
+
638
+ ```bash
639
+ # Using template ID
640
+ sembix workflow template show --project-id proj_123 --template-id tmpl_deploy
641
+
642
+ # Using workflow ID (fetches template from workflow)
643
+ sembix workflow template show --project-id proj_123 --workflow-id wf_456
644
+ ```
645
+
646
+ **Options:**
647
+
648
+ - `-p, --profile <name>` - Profile to use
649
+ - `--project-id <id>` - **Required** - Project ID
650
+ - `--template-id <id>` - Template ID (use this OR --workflow-id)
651
+ - `--workflow-id <id>` - Workflow ID (use this OR --template-id)
652
+ - `--output <format>` - Output format: json, pretty, or text
653
+ - `--pretty` - Pretty-print JSON output
654
+
655
+ ---
656
+
657
+ ## Workflow Run Commands
658
+
659
+ Commands for managing workflow runs (executions).
660
+
661
+ ---
662
+
663
+ ### `sembix workflow run list`
664
+
665
+ List workflow runs (excludes sub-workflow runs by default).
666
+
667
+ **Usage:**
668
+
669
+ ```bash
670
+ # List all runs
671
+ sembix workflow run list
672
+
673
+ # Filter by workflow
674
+ sembix workflow run list --workflow-id wf_456
675
+
676
+ # Filter by project
677
+ sembix workflow run list --project-id proj_123
678
+
679
+ # Filter by template
680
+ sembix workflow run list --workflow-template-id tmpl_deploy
681
+
682
+ # Filter by status
683
+ sembix workflow run list --status RUNNING
684
+
685
+ # Include sub-workflow runs
686
+ sembix workflow run list --include-subflows
687
+
688
+ # Filter to top-level runs only
689
+ sembix workflow run list --parent-id NULL
690
+
691
+ # Pagination
692
+ sembix workflow run list --limit 20 --offset 10
693
+
694
+ # Filter by workspace
695
+ sembix workflow run list --workspace-id ws_123
696
+
697
+ # Filter by issue
698
+ sembix workflow run list --issue-key PROJ-123
699
+ ```
700
+
701
+ **Options:**
702
+
703
+ - `-p, --profile <name>` - Profile to use
704
+ - `--workflow-id <id>` - Filter by workflow ID
705
+ - `--project-id <id>` - Filter by project ID
706
+ - `--workflow-template-id <id>` - Filter by workflow template ID
707
+ - `--parent-id <id>` - Filter by parent workflow run ID (use "NULL" for top-level runs only)
708
+ - `--include-subflows` - Include sub-workflow runs in results (default: excluded)
709
+ - `--status <status>` - Filter by status (PENDING, IN_PROGRESS, COMPLETED, FAILED, CANCELLED)
710
+ - `--limit <number>` - Number of results (default: 10)
711
+ - `--offset <number>` - Offset for pagination (default: 0)
712
+ - `--sort-by <field>` - Sort field
713
+ - `--sort-order <order>` - Sort order (ASC|DESC)
714
+ - `--current-user` - Filter to current user runs
715
+ - `--workspace-id <id>` - Filter by workspace ID
716
+ - `--workspace-name <name>` - Filter by workspace name
717
+ - `--issue-id <id>` - Filter by issue ID
718
+ - `--issue-key <key>` - Filter by issue key
719
+ - `--output <format>` - Output format: json, pretty, or text
720
+ - `--pretty` - Pretty-print JSON output
721
+
722
+ **Output:**
723
+
724
+ ```json
725
+ {
726
+ "items": [
727
+ {
728
+ "workflowId": "wf_456",
729
+ "projectId": "proj_123",
730
+ "workflowTemplateId": "tmpl_deploy",
731
+ "parentId": null,
732
+ "sortBy": "createdAt",
733
+ "sortOrder": "DESC",
734
+ "limit": 10,
735
+ "offset": 0,
736
+ "runs": [
737
+ {
738
+ "runId": "run_xyz789",
739
+ "workflowId": "wf_456",
740
+ "name": "Deploy to Production",
741
+ "status": "IN_PROGRESS",
742
+ "progress": 45,
743
+ "createdAt": "2024-01-15T14:30:00Z",
744
+ "creatorId": "user_123"
745
+ }
746
+ ],
747
+ "totalCount": 15
748
+ }
749
+ ]
750
+ }
751
+ ```
752
+
753
+ ---
754
+
755
+ ### `sembix workflow run show`
756
+
757
+ Show details of a specific workflow run.
758
+
759
+ **Usage:**
760
+
761
+ ```bash
762
+ # Show run details
763
+ sembix workflow run show --workflow-id wf_456 --run-id run_xyz789
764
+
765
+ # Watch run details until completion
766
+ sembix workflow run show --workflow-id wf_456 --run-id run_xyz789 --watch
767
+ ```
768
+
769
+ **Options:**
770
+
771
+ - `-p, --profile <name>` - Profile to use
772
+ - `--workflow-id <id>` - **Required** - Workflow ID
773
+ - `--run-id <id>` - **Required** - Run ID
774
+ - `-w, --watch` - Watch run details until completion
775
+ - `--output <format>` - Output format: json, pretty, or text
776
+ - `--pretty` - Pretty-print JSON output
777
+
778
+ **Output:**
779
+
780
+ ```json
781
+ {
782
+ "run": {
783
+ "runId": "run_xyz789",
784
+ "workflowId": "wf_456",
785
+ "projectId": "proj_123",
786
+ "name": "Deploy to Production",
787
+ "status": "IN_PROGRESS",
788
+ "progress": 45,
789
+ "createdAt": "2024-01-15T14:30:00Z",
790
+ "startedAt": "2024-01-15T14:30:05Z",
791
+ "creatorId": "user_123",
792
+ "steps": [
793
+ {
794
+ "stepId": "step_1",
795
+ "name": "Initialize",
796
+ "state": "Complete",
797
+ "events": [...]
798
+ },
799
+ {
800
+ "stepId": "step_2",
801
+ "name": "Deploy",
802
+ "state": "Pending",
803
+ "events": []
804
+ }
805
+ ],
806
+ "currentStepId": "step_2",
807
+ "events": [...]
808
+ }
809
+ }
810
+ ```
811
+
812
+ ---
813
+
814
+ ### `sembix workflow run status`
815
+
816
+ Get the status of a workflow run (simplified view).
817
+
818
+ **Usage:**
819
+
820
+ ```bash
821
+ # Get current status
822
+ sembix workflow run status --workflow-id wf_456 --run-id run_xyz789
823
+
824
+ # Watch status until completion
825
+ sembix workflow run status --workflow-id wf_456 --run-id run_xyz789 --watch
826
+ ```
827
+
828
+ **Options:**
829
+
830
+ - `-p, --profile <name>` - Profile to use
831
+ - `--workflow-id <id>` - Workflow ID (optional if run-id is unique)
832
+ - `--run-id <id>` - Run ID (optional if workflow-id is provided)
833
+ - `-w, --watch` - Watch status until completion
834
+ - `--output <format>` - Output format: json, pretty, or text
835
+ - `--pretty` - Pretty-print JSON output
836
+
837
+ **Note:** This command provides a simplified status view. Use `sembix workflow run show` for full run details.
838
+
839
+ ---
840
+
841
+ ### `sembix workflow run stop`
842
+
843
+ Stop a running workflow.
844
+
845
+ **Usage:**
846
+
847
+ ```bash
848
+ sembix workflow run stop --project-id proj_123 --workflow-id wf_456 --run-id run_xyz789
849
+ ```
850
+
851
+ **Options:**
852
+
853
+ - `-p, --profile <name>` - Profile to use
854
+ - `--project-id <id>` - Project ID (optional if workflow-id is unique)
855
+ - `--workflow-id <id>` - Workflow ID (optional if run-id is unique)
856
+ - `--run-id <id>` - Run ID (optional if workflow-id is provided)
857
+ - `--output <format>` - Output format: json, pretty, or text
858
+ - `--pretty` - Pretty-print JSON output
859
+
860
+ **Output:**
861
+
862
+ ```json
863
+ {
864
+ "message": "Workflow run stopped successfully",
865
+ "runId": "run_xyz789"
866
+ }
867
+ ```
868
+
869
+ ### `sembix studio create [name]`
870
+
871
+ Create a new Sembix Studio environment with full interactive configuration.
872
+
873
+ **Usage:**
874
+
875
+ ```bash
876
+ # Interactive mode (recommended for first-time users)
877
+ sembix studio create
878
+
879
+ # With environment name
880
+ sembix studio create acme-production
881
+
882
+ # With environment name and repository
883
+ sembix studio create acme-production --repo acme-corp/sembix-deployment
884
+
885
+ # With custom GitHub token
886
+ sembix studio create --token ghp_your_custom_token
887
+ ```
888
+
889
+ **Options:**
890
+
891
+ - `[name]` - Optional environment name (will prompt if not provided)
892
+ - `-r, --repo <repo>` - Target repository in `owner/repo` format
893
+ - `-t, --token <token>` - GitHub personal access token (overrides `.env`)
894
+
895
+ **What it does:**
896
+
897
+ 1. Guides you through 8 configuration steps:
898
+ - Repository selection
899
+ - Basic configuration (AWS, Terraform)
900
+ - Database settings
901
+ - Networking (VPC, subnets)
902
+ - Security (IAM roles, security groups, KMS)
903
+ - DNS & TLS (domains, certificates)
904
+ - Feature flags (Memory, Notifications, WAF)
905
+ - Frontend configuration (GitHub App, Jira)
906
+
907
+ 2. Creates GitHub Actions environment
908
+ 3. Sets environment variables (public values)
909
+ 4. Creates environment secrets (encrypted sensitive values)
910
+
911
+ **Output:**
912
+
913
+ - Links to GitHub Actions for deployment
914
+ - Instructions for next steps (run deployment, add Hub integration)
915
+
916
+ **Examples:**
917
+
918
+ ```bash
919
+ # Fully interactive
920
+ $ sembix studio create
921
+ ━━━ Step 1: Repository Selection ━━━
922
+ ? Select your deployment repository: acme-corp/sembix-deployment
923
+ ? Environment name: acme-production
924
+ ...
925
+
926
+ # Quick setup with name provided
927
+ $ sembix studio create staging-env
928
+ ━━━ Step 1: Repository Selection ━━━
929
+ ✓ Using environment name: staging-env
930
+ ? Select your deployment repository: ...
931
+
932
+ # Fully non-interactive (skip repo and name prompts)
933
+ $ sembix studio create prod --repo acme-corp/deployments
934
+ ✓ Using repository: acme-corp/deployments
935
+ ✓ Using environment name: prod
936
+ ━━━ Step 2: Basic Configuration ━━━
937
+ ...
938
+ ```
939
+
940
+ ---
941
+
942
+ ### `sembix studio add-hub [name]`
943
+
944
+ Add Sembix Hub cross-account roles and AppConfig integration to an existing environment.
945
+
946
+ **Usage:**
947
+
948
+ ```bash
949
+ # Interactive mode
950
+ sembix studio add-hub
951
+
952
+ # With environment name
953
+ sembix studio add-hub acme-production
954
+
955
+ # With environment name and repository
956
+ sembix studio add-hub acme-production --repo acme-corp/sembix-deployment
957
+
958
+ # With custom GitHub token
959
+ sembix studio add-hub --token ghp_your_custom_token
960
+ ```
961
+
962
+ **Options:**
963
+
964
+ - `[name]` - Optional environment name (will prompt if not provided)
965
+ - `-r, --repo <repo>` - Target repository in `owner/repo` format
966
+ - `-t, --token <token>` - GitHub personal access token (overrides `.env`)
967
+
968
+ **When to use:**
969
+
970
+ After you've:
971
+ 1. Created an environment with `sembix studio create`
972
+ 2. Run your first deployment via GitHub Actions
973
+ 3. Received Hub role ARNs from the deployment output
974
+
975
+ **What it does:**
976
+
977
+ 1. Selects repository and environment (or uses provided values)
978
+ 2. Prompts for Hub role ARNs:
979
+ - Hub Engine Execution Role ARN
980
+ - Hub Consumer Role ARN
981
+ - Hub Admin Role ARN
982
+ 3. Optionally prompts for AppConfig configuration:
983
+ - AppConfig Role ARN
984
+ - AppConfig Application ID
985
+ - AppConfig Environment ID
986
+ - AppConfig Profile ID
987
+ 4. Updates environment secrets with Hub configuration
988
+
989
+ **Output:**
990
+
991
+ - Confirmation that Hub integration was added
992
+ - Link to GitHub Actions for redeployment with Hub enabled
993
+
994
+ **Examples:**
995
+
996
+ ```bash
997
+ # Interactive - select everything
998
+ $ sembix studio add-hub
999
+ ━━━ Repository & Environment Selection ━━━
1000
+ ? Select deployment repository: acme-corp/sembix-deployment
1001
+ ? Select environment to update: acme-production
1002
+ ━━━ Sembix Hub Cross-Account Roles ━━━
1003
+ ? Hub Engine Execution Role ARN: arn:aws:iam::...
1004
+
1005
+ # Quick - provide environment name
1006
+ $ sembix studio add-hub acme-production
1007
+ ━━━ Repository & Environment Selection ━━━
1008
+ ✓ Using environment: acme-production
1009
+ ? Select deployment repository: ...
1010
+
1011
+ # Fully specified
1012
+ $ sembix studio add-hub prod --repo acme-corp/deployments
1013
+ ✓ Using repository: acme-corp/deployments
1014
+ ✓ Using environment: prod
1015
+ ━━━ Sembix Hub Cross-Account Roles ━━━
1016
+ ...
1017
+ ```
1018
+
1019
+ ---
1020
+
1021
+ ### `sembix studio list [repository]`
1022
+
1023
+ List all Studio environments in a repository, or list all your repositories.
1024
+
1025
+ **Usage:**
1026
+
1027
+ ```bash
1028
+ # List all your repositories
1029
+ sembix studio list
1030
+
1031
+ # List environments in a specific repository
1032
+ sembix studio list acme-corp/sembix-deployment
1033
+
1034
+ # With custom GitHub token
1035
+ sembix studio list --token ghp_your_custom_token
1036
+ ```
1037
+
1038
+ **Options:**
1039
+
1040
+ - `[repository]` - Optional repository in `owner/repo` format
1041
+ - `-t, --token <token>` - GitHub personal access token (overrides `.env`)
1042
+
1043
+ **What it does:**
1044
+
1045
+ **Without repository argument:**
1046
+ - Lists all repositories accessible with your GitHub token
1047
+ - Provides tip to specify a repository to see its environments
1048
+
1049
+ **With repository argument:**
1050
+ - Lists all GitHub Actions environments in the specified repository
1051
+ - Shows environment names and URLs
1052
+ - Provides helpful tips if no environments found
1053
+
1054
+ **Examples:**
1055
+
1056
+ ```bash
1057
+ # List all repositories
1058
+ $ sembix studio list
1059
+
1060
+ ┌─────────────────────────────────────────┐
1061
+ │ │
1062
+ │ Sembix CLI │
1063
+ │ │
1064
+ └─────────────────────────────────────────┘
1065
+
1066
+ Sembix Studio - Environments
1067
+
1068
+ 💡 Tip: Specify a repository to see its environments
1069
+ Example: sembix studio list owner/repo
1070
+
1071
+ ━━━ Your Repositories ━━━
1072
+
1073
+ 1. acme-corp/sembix-deployment
1074
+ 2. globex-inc/studio-deploy
1075
+ 3. sembix-partners/client-xyz
1076
+
1077
+ Run: sembix studio list <repository> to see environments
1078
+
1079
+ # List environments in a repository
1080
+ $ sembix studio list acme-corp/sembix-deployment
1081
+
1082
+ Environments in acme-corp/sembix-deployment
1083
+
1084
+ ━━━ Environments ━━━
1085
+
1086
+ 1. acme-production
1087
+ https://github.com/acme-corp/sembix-deployment/settings/environments/acme-production
1088
+
1089
+ 2. acme-staging
1090
+ https://github.com/acme-corp/sembix-deployment/settings/environments/acme-staging
1091
+
1092
+ # No environments found
1093
+ $ sembix studio list new-repo/empty
1094
+
1095
+ Environments in new-repo/empty
1096
+
1097
+ ⚠ No environments found in new-repo/empty
1098
+
1099
+ 💡 Create your first environment:
1100
+ sembix studio create
1101
+ ```
1102
+
1103
+ ---
1104
+
1105
+ ## Global Options
1106
+
1107
+ These options work with any command:
1108
+
1109
+ ### `--output <format>`
1110
+
1111
+ Set output format for command results.
1112
+
1113
+ **Values:**
1114
+ - `json` (default) - Machine-readable JSON
1115
+ - `pretty` - Pretty-printed JSON with colors
1116
+ - `text` - Human-readable text (where supported)
1117
+
1118
+ **Usage:**
1119
+ ```bash
1120
+ sembix project list --output pretty
1121
+ sembix workflow run list --output json
1122
+ ```
1123
+
1124
+ ### `--pretty`
1125
+
1126
+ Shorthand for `--output pretty`.
1127
+
1128
+ **Usage:**
1129
+ ```bash
1130
+ sembix project list --pretty
1131
+ ```
1132
+
1133
+ ---
1134
+
1135
+ ### `--help` or `-h`
1136
+
1137
+ Display help information for a command.
1138
+
1139
+ ```bash
1140
+ # Main help
1141
+ sembix --help
1142
+
1143
+ # Studio help
1144
+ sembix studio --help
1145
+
1146
+ # Specific command help
1147
+ sembix studio create --help
1148
+ sembix studio add-hub --help
1149
+ sembix studio list --help
1150
+ ```
1151
+
1152
+ ### `--version` or `-V`
1153
+
1154
+ Display the CLI version.
1155
+
1156
+ ```bash
1157
+ sembix --version
1158
+ # Output: 1.0.0
1159
+ ```
1160
+
1161
+ ### `--token <token>` or `-t <token>`
1162
+
1163
+ Override the GitHub token from all other sources (environment variables, `~/.sembix/config`, `.env` file).
1164
+
1165
+ ```bash
1166
+ sembix studio create --token ghp_custom_token_here
1167
+ ```
1168
+
1169
+ **Credential Priority:**
1170
+ 1. `--token` flag (highest)
1171
+ 2. `GITHUB_TOKEN` environment variable
1172
+ 3. `~/.sembix/config` (created by `sembix configure`)
1173
+ 4. `.env` file (lowest)
1174
+
1175
+ **When to use:**
1176
+ - Testing with different GitHub accounts
1177
+ - CI/CD pipelines with different tokens
1178
+ - Temporary token for specific operation
1179
+
1180
+ ### `--profile <name>` or `-p <name>`
1181
+
1182
+ Specify which Studio profile to use for API commands.
1183
+
1184
+ ```bash
1185
+ sembix workflow start --profile production --project-id proj_123 --workflow-id wf_456
1186
+ ```
1187
+
1188
+ **Profile Priority:**
1189
+ 1. `--profile` flag (highest)
1190
+ 2. Default profile set via `sembix profile set-default`
1191
+ 3. "default" profile (if exists)
1192
+
1193
+ **When to use:**
1194
+ - Working with multiple Studio instances
1195
+ - Switching between production and staging environments
1196
+ - Testing with different Studio configurations
1197
+
1198
+ ---
1199
+
1200
+ ## Environment Variables
1201
+
1202
+ Configure the CLI via `.env` file:
1203
+
1204
+ ```env
1205
+ # Required: GitHub Personal Access Token
1206
+ GITHUB_TOKEN=ghp_your_token_here
1207
+
1208
+ # Optional: Default GitHub organization
1209
+ DEFAULT_GITHUB_ORG=your-org
1210
+ ```
1211
+
1212
+ **GitHub Token Scopes Required:**
1213
+ - `repo` - Full control of private repositories
1214
+ - `workflow` - Update GitHub Actions workflows
1215
+
1216
+ ---
1217
+
1218
+ ## Exit Codes
1219
+
1220
+ The CLI uses standard exit codes:
1221
+
1222
+ - `0` - Success
1223
+ - `1` - Error (validation failure, API error, user cancellation)
1224
+
1225
+ **Error Examples:**
1226
+
1227
+ ```bash
1228
+ $ sembix studio create
1229
+ ✗ GITHUB_TOKEN environment variable is required
1230
+ # Exit code: 1
1231
+
1232
+ $ sembix studio create invalid_name
1233
+ ✗ Invalid environment name. Must be lowercase letters, numbers, and hyphens (min 3 chars).
1234
+ # Exit code: 1
1235
+
1236
+ $ sembix studio add-hub nonexistent --repo acme/repo
1237
+ ✗ Environment 'nonexistent' not found in acme/repo
1238
+ # Exit code: 1
1239
+ ```
1240
+
1241
+ ---
1242
+
1243
+ ## Tips & Best Practices
1244
+
1245
+ ### 1. **Use Command Arguments for Automation**
1246
+
1247
+ For scripts and CI/CD, provide arguments instead of relying on interactive prompts:
1248
+
1249
+ ```bash
1250
+ #!/bin/bash
1251
+ # Create environment non-interactively
1252
+ sembix studio create "${ENV_NAME}" --repo "${REPO}" --token "${GITHUB_TOKEN}"
1253
+
1254
+ # Start workflow non-interactively
1255
+ sembix workflow start --profile production --project-id "${PROJECT_ID}" --workflow-id "${WORKFLOW_ID}" --inputs @inputs.json
1256
+ ```
1257
+
1258
+ ### 2. **Start Interactive for First-Time Setup**
1259
+
1260
+ For your first environment, use fully interactive mode to learn about all options:
1261
+
1262
+ ```bash
1263
+ sembix studio create
1264
+ # Follow all prompts and learn what each field means
1265
+
1266
+ # For Studio API setup
1267
+ sembix configure
1268
+ # Configure GitHub credentials and Studio profile interactively
1269
+ ```
1270
+
1271
+ ### 3. **List Before Creating**
1272
+
1273
+ Check existing environments before creating new ones:
1274
+
1275
+ ```bash
1276
+ sembix studio list acme-corp/sembix-deployment
1277
+ # See what already exists, avoid duplicates
1278
+
1279
+ # List configured profiles
1280
+ sembix profile list
1281
+ # See what Studio profiles are configured
1282
+ ```
1283
+
1284
+ ### 4. **Validate Token Permissions**
1285
+
1286
+ If you encounter errors, verify your token has correct scopes:
1287
+
1288
+ ```bash
1289
+ # GitHub Settings → Developer settings → Personal access tokens
1290
+ # Required: repo, workflow
1291
+ ```
1292
+
1293
+ ### 5. **Use Profiles for Multiple Studio Instances**
1294
+
1295
+ Configure separate profiles for different Studio environments:
1296
+
1297
+ ```bash
1298
+ # Configure production profile (interactive)
1299
+ sembix configure
1300
+ # Choose to configure Studio profile, enter profile name: production
1301
+
1302
+ # Configure staging profile (interactive)
1303
+ sembix configure
1304
+ # Choose to configure Studio profile, enter profile name: staging
1305
+
1306
+ # Switch between profiles
1307
+ sembix workflow list --profile production
1308
+ sembix workflow list --profile staging
1309
+ ```
1310
+
1311
+ ### 6. **Use Watch Mode for Long-Running Workflows**
1312
+
1313
+ Monitor workflow execution in real-time:
1314
+
1315
+ ```bash
1316
+ # Start workflow and get run ID
1317
+ RUN_ID=$(sembix workflow start --project-id proj_123 --workflow-id wf_456 --inputs @inputs.json | grep "Run ID" | awk '{print $3}')
1318
+
1319
+ # Watch until completion
1320
+ sembix workflow status --workflow-id wf_456 --run-id "${RUN_ID}" --watch
1321
+ ```
1322
+
1323
+ ### 7. **Store Input Variables in Files**
1324
+
1325
+ For complex workflow inputs, use JSON files:
1326
+
1327
+ ```bash
1328
+ # Create inputs.json
1329
+ cat > inputs.json <<EOF
1330
+ {
1331
+ "environment": "production",
1332
+ "version": "1.2.3",
1333
+ "config": {
1334
+ "debug": false,
1335
+ "replicas": 3
1336
+ }
1337
+ }
1338
+ EOF
1339
+
1340
+ # Use file in workflow start
1341
+ sembix workflow start --project-id proj_123 --workflow-id wf_456 --inputs @inputs.json
1342
+ ```
1343
+
1344
+ ---
1345
+
1346
+ ## Workflow Examples
1347
+
1348
+ ### Complete Workflow Execution Flow
1349
+
1350
+ ```bash
1351
+ # 1. Configure Studio profile
1352
+ sembix configure
1353
+ # Choose to configure Studio profile with name: production
1354
+
1355
+ # 2. Authenticate
1356
+ sembix login production
1357
+
1358
+ # 3. Set default project (optional)
1359
+ sembix profile set-default-project production proj_123
1360
+
1361
+ # 4. Start workflow (interactive mode)
1362
+ sembix workflow start
1363
+
1364
+ # Or start with explicit parameters
1365
+ sembix workflow start \
1366
+ --profile production \
1367
+ --workflow-id wf_456 \
1368
+ --inputs '{"environment":"production","version":"1.2.3"}'
1369
+
1370
+ # Output: Run ID: run_789abc
1371
+
1372
+ # 5. Check status
1373
+ sembix workflow run status \
1374
+ --profile production \
1375
+ --workflow-id wf_456 \
1376
+ --run-id run_789abc
1377
+
1378
+ # 6. Watch until completion
1379
+ sembix workflow run status \
1380
+ --profile production \
1381
+ --workflow-id wf_456 \
1382
+ --run-id run_789abc \
1383
+ --watch
1384
+ ```
1385
+
1386
+ ### Managing Multiple Profiles
1387
+
1388
+ ```bash
1389
+ # Configure multiple profiles (interactive)
1390
+ sembix configure # Profile name: production
1391
+ sembix configure # Profile name: staging
1392
+ sembix configure # Profile name: dev
1393
+
1394
+ # Set default profile
1395
+ sembix profile set-default production
1396
+
1397
+ # Set default projects for each profile
1398
+ sembix profile set-default-project production proj_prod_123
1399
+ sembix profile set-default-project staging proj_stage_456
1400
+ sembix profile set-default-project dev proj_dev_789
1401
+
1402
+ # List all profiles
1403
+ sembix profile list
1404
+
1405
+ # Login to each profile
1406
+ sembix login production
1407
+ sembix login staging
1408
+ sembix login dev
1409
+
1410
+ # Use different profiles for different workflows
1411
+ sembix workflow start --profile production --workflow-id wf_456
1412
+ sembix workflow start --profile staging --workflow-id wf_789
1413
+ ```
1414
+
1415
+ ### Filtering and Searching Workflow Runs
1416
+
1417
+ ```bash
1418
+ # List all runs for a specific workflow
1419
+ sembix workflow run list --workflow-id wf_456
1420
+
1421
+ # List failed runs
1422
+ sembix workflow run list --status FAILED
1423
+
1424
+ # List runs for a project
1425
+ sembix workflow run list --project-id proj_123
1426
+
1427
+ # List top-level runs only (exclude subflows)
1428
+ sembix workflow run list --parent-id NULL
1429
+
1430
+ # Include sub-workflow runs
1431
+ sembix workflow run list --include-subflows
1432
+
1433
+ # Paginate through results
1434
+ sembix workflow run list --limit 20 --offset 0
1435
+ sembix workflow run list --limit 20 --offset 20
1436
+
1437
+ # Combine filters
1438
+ sembix workflow run list \
1439
+ --workflow-id wf_456 \
1440
+ --status COMPLETED \
1441
+ --limit 10
1442
+
1443
+ # Show full run details
1444
+ sembix workflow run show --workflow-id wf_456 --run-id run_789
1445
+ ```
1446
+
1447
+ ### Project Management Examples
1448
+
1449
+ ```bash
1450
+ # List all projects
1451
+ sembix project list
1452
+
1453
+ # Search projects by name
1454
+ sembix project list --name "Production"
1455
+
1456
+ # Show project details
1457
+ sembix project show --project-id proj_123
1458
+
1459
+ # With pretty output
1460
+ sembix project list --pretty
1461
+ ```
1462
+
1463
+ ### Output Formatting Examples
1464
+
1465
+ ```bash
1466
+ # JSON output (default) - for scripts/automation
1467
+ sembix project list --output json
1468
+
1469
+ # Pretty JSON - for human reading
1470
+ sembix project list --output pretty
1471
+ # or shorthand:
1472
+ sembix project list --pretty
1473
+
1474
+ # Text output - for terminal display
1475
+ sembix project list --output text
1476
+ ```
1477
+
1478
+ ---
1479
+
1480
+ ## Future Commands
1481
+
1482
+ Commands planned for future releases:
1483
+
1484
+ ```bash
1485
+ # Update existing environment
1486
+ sembix studio update <name>
1487
+
1488
+ # Delete environment
1489
+ sembix studio delete <name>
1490
+
1491
+ # Show environment details
1492
+ sembix studio info <name>
1493
+
1494
+ # Validate configuration
1495
+ sembix studio validate <name>
1496
+
1497
+ # Export configuration
1498
+ sembix studio export <name> > config.yaml
1499
+
1500
+ # Import configuration
1501
+ sembix studio import config.yaml
1502
+
1503
+ # Workflow templates
1504
+ sembix workflow template list
1505
+ sembix workflow template show <id>
1506
+
1507
+ # Workflow logs
1508
+ sembix workflow logs --run-id <id>
1509
+ ```
1510
+
1511
+ ---
1512
+
1513
+ ## Getting Help
1514
+
1515
+ - **CLI Help**: `sembix --help`, `sembix studio --help`
1516
+ - **Documentation**: See `README.md` for detailed setup instructions
1517
+ - **Issues**: Report issues at https://github.com/anthropics/claude-code/issues
1518
+
1519
+ ---
1520
+
1521
+ **Last Updated**: November 2024
1522
+ **CLI Version**: 1.0.0