@sembix/cli 1.3.0 → 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 (196) hide show
  1. package/COMMANDS.md +1522 -0
  2. package/QUICKSTART.md +829 -0
  3. package/README.md +1949 -285
  4. package/USAGE-EXAMPLES.md +872 -0
  5. package/dist/commands/configure.d.ts.map +1 -1
  6. package/dist/commands/configure.js +172 -2
  7. package/dist/commands/configure.js.map +1 -1
  8. package/dist/commands/index.d.ts +10 -0
  9. package/dist/commands/index.d.ts.map +1 -0
  10. package/dist/commands/index.js +11 -0
  11. package/dist/commands/index.js.map +1 -0
  12. package/dist/commands/login.d.ts +19 -0
  13. package/dist/commands/login.d.ts.map +1 -0
  14. package/dist/commands/login.js +118 -0
  15. package/dist/commands/login.js.map +1 -0
  16. package/dist/commands/logout.d.ts +21 -0
  17. package/dist/commands/logout.d.ts.map +1 -0
  18. package/dist/commands/logout.js +66 -0
  19. package/dist/commands/logout.js.map +1 -0
  20. package/dist/commands/profile-project.d.ts +14 -0
  21. package/dist/commands/profile-project.d.ts.map +1 -0
  22. package/dist/commands/profile-project.js +123 -0
  23. package/dist/commands/profile-project.js.map +1 -0
  24. package/dist/commands/profile.d.ts +26 -0
  25. package/dist/commands/profile.d.ts.map +1 -0
  26. package/dist/commands/profile.js +177 -0
  27. package/dist/commands/profile.js.map +1 -0
  28. package/dist/commands/project.d.ts +16 -0
  29. package/dist/commands/project.d.ts.map +1 -0
  30. package/dist/commands/project.js +153 -0
  31. package/dist/commands/project.js.map +1 -0
  32. package/dist/commands/workflow.d.ts +91 -0
  33. package/dist/commands/workflow.d.ts.map +1 -0
  34. package/dist/commands/workflow.js +1201 -0
  35. package/dist/commands/workflow.js.map +1 -0
  36. package/dist/config-schema.d.ts +23 -0
  37. package/dist/config-schema.d.ts.map +1 -1
  38. package/dist/config-schema.js +21 -1
  39. package/dist/config-schema.js.map +1 -1
  40. package/dist/config.d.ts +4 -0
  41. package/dist/config.d.ts.map +1 -1
  42. package/dist/config.js +23 -2
  43. package/dist/config.js.map +1 -1
  44. package/dist/index.js +318 -1
  45. package/dist/index.js.map +1 -1
  46. package/dist/prompts/project-selection.d.ts +8 -0
  47. package/dist/prompts/project-selection.d.ts.map +1 -0
  48. package/dist/prompts/project-selection.js +132 -0
  49. package/dist/prompts/project-selection.js.map +1 -0
  50. package/dist/prompts/workflow-inputs.d.ts +10 -0
  51. package/dist/prompts/workflow-inputs.d.ts.map +1 -0
  52. package/dist/prompts/workflow-inputs.js +71 -0
  53. package/dist/prompts/workflow-inputs.js.map +1 -0
  54. package/dist/prompts/workflow-selection.d.ts +8 -0
  55. package/dist/prompts/workflow-selection.d.ts.map +1 -0
  56. package/dist/prompts/workflow-selection.js +147 -0
  57. package/dist/prompts/workflow-selection.js.map +1 -0
  58. package/dist/sembix-cli-1.4.0.tgz +0 -0
  59. package/dist/services/cognito-auth.d.ts +92 -0
  60. package/dist/services/cognito-auth.d.ts.map +1 -0
  61. package/dist/services/cognito-auth.js +319 -0
  62. package/dist/services/cognito-auth.js.map +1 -0
  63. package/dist/services/studio-api-client.d.ts +127 -0
  64. package/dist/services/studio-api-client.d.ts.map +1 -0
  65. package/dist/services/studio-api-client.js +291 -0
  66. package/dist/services/studio-api-client.js.map +1 -0
  67. package/dist/types/studio.d.ts +82 -0
  68. package/dist/types/studio.d.ts.map +1 -0
  69. package/dist/types/studio.js +7 -0
  70. package/dist/types/studio.js.map +1 -0
  71. package/dist/types.d.ts +283 -0
  72. package/dist/types.d.ts.map +1 -1
  73. package/dist/types.js +5 -0
  74. package/dist/types.js.map +1 -1
  75. package/dist/utils/browser-auth.d.ts +45 -0
  76. package/dist/utils/browser-auth.d.ts.map +1 -0
  77. package/dist/utils/browser-auth.js +168 -0
  78. package/dist/utils/browser-auth.js.map +1 -0
  79. package/dist/utils/cognito-auth.d.ts +3 -0
  80. package/dist/utils/cognito-auth.d.ts.map +1 -0
  81. package/dist/utils/cognito-auth.js +3 -0
  82. package/dist/utils/cognito-auth.js.map +1 -0
  83. package/dist/utils/config-file.d.ts +40 -0
  84. package/dist/utils/config-file.d.ts.map +1 -1
  85. package/dist/utils/config-file.js +158 -4
  86. package/dist/utils/config-file.js.map +1 -1
  87. package/dist/utils/environment.d.ts +22 -0
  88. package/dist/utils/environment.d.ts.map +1 -0
  89. package/dist/utils/environment.js +39 -0
  90. package/dist/utils/environment.js.map +1 -0
  91. package/dist/utils/error-handler.d.ts +53 -0
  92. package/dist/utils/error-handler.d.ts.map +1 -0
  93. package/dist/utils/error-handler.js +174 -0
  94. package/dist/utils/error-handler.js.map +1 -0
  95. package/dist/utils/fuzzy-match.d.ts +31 -0
  96. package/dist/utils/fuzzy-match.d.ts.map +1 -0
  97. package/dist/utils/fuzzy-match.js +138 -0
  98. package/dist/utils/fuzzy-match.js.map +1 -0
  99. package/dist/utils/input-parser.d.ts +14 -0
  100. package/dist/utils/input-parser.d.ts.map +1 -0
  101. package/dist/utils/input-parser.js +34 -0
  102. package/dist/utils/input-parser.js.map +1 -0
  103. package/dist/utils/output.d.ts +55 -0
  104. package/dist/utils/output.d.ts.map +1 -0
  105. package/dist/utils/output.js +80 -0
  106. package/dist/utils/output.js.map +1 -0
  107. package/dist/utils/recent-workflows.d.ts +37 -0
  108. package/dist/utils/recent-workflows.d.ts.map +1 -0
  109. package/dist/utils/recent-workflows.js +172 -0
  110. package/dist/utils/recent-workflows.js.map +1 -0
  111. package/dist/utils/studio-api-client.d.ts +3 -0
  112. package/dist/utils/studio-api-client.d.ts.map +1 -0
  113. package/dist/utils/studio-api-client.js +3 -0
  114. package/dist/utils/studio-api-client.js.map +1 -0
  115. package/dist/utils/studio-api.d.ts +53 -0
  116. package/dist/utils/studio-api.d.ts.map +1 -0
  117. package/dist/utils/studio-api.js +102 -0
  118. package/dist/utils/studio-api.js.map +1 -0
  119. package/dist/utils/studio-config.d.ts +74 -0
  120. package/dist/utils/studio-config.d.ts.map +1 -0
  121. package/dist/utils/studio-config.js +213 -0
  122. package/dist/utils/studio-config.js.map +1 -0
  123. package/dist/utils/token-manager.d.ts +4 -0
  124. package/dist/utils/token-manager.d.ts.map +1 -0
  125. package/dist/utils/token-manager.js +3 -0
  126. package/dist/utils/token-manager.js.map +1 -0
  127. package/dist/utils/ui.d.ts +55 -1
  128. package/dist/utils/ui.d.ts.map +1 -1
  129. package/dist/utils/ui.js +151 -2
  130. package/dist/utils/ui.js.map +1 -1
  131. package/package.json +4 -1
  132. package/dist/__tests__/config-schema.test.d.ts +0 -2
  133. package/dist/__tests__/config-schema.test.d.ts.map +0 -1
  134. package/dist/__tests__/config-schema.test.js +0 -471
  135. package/dist/__tests__/config-schema.test.js.map +0 -1
  136. package/dist/__tests__/config.test.d.ts +0 -2
  137. package/dist/__tests__/config.test.d.ts.map +0 -1
  138. package/dist/__tests__/config.test.js +0 -75
  139. package/dist/__tests__/config.test.js.map +0 -1
  140. package/dist/__tests__/integration/configure.test.d.ts +0 -2
  141. package/dist/__tests__/integration/configure.test.d.ts.map +0 -1
  142. package/dist/__tests__/integration/configure.test.js +0 -247
  143. package/dist/__tests__/integration/configure.test.js.map +0 -1
  144. package/dist/__tests__/integration/fixtures/configs.d.ts +0 -477
  145. package/dist/__tests__/integration/fixtures/configs.d.ts.map +0 -1
  146. package/dist/__tests__/integration/fixtures/configs.js +0 -175
  147. package/dist/__tests__/integration/fixtures/configs.js.map +0 -1
  148. package/dist/__tests__/integration/helpers/cli-runner.d.ts +0 -63
  149. package/dist/__tests__/integration/helpers/cli-runner.d.ts.map +0 -1
  150. package/dist/__tests__/integration/helpers/cli-runner.js +0 -152
  151. package/dist/__tests__/integration/helpers/cli-runner.js.map +0 -1
  152. package/dist/__tests__/integration/helpers/command-runner.d.ts +0 -53
  153. package/dist/__tests__/integration/helpers/command-runner.d.ts.map +0 -1
  154. package/dist/__tests__/integration/helpers/command-runner.js +0 -117
  155. package/dist/__tests__/integration/helpers/command-runner.js.map +0 -1
  156. package/dist/__tests__/integration/studio-create.test.d.ts +0 -2
  157. package/dist/__tests__/integration/studio-create.test.d.ts.map +0 -1
  158. package/dist/__tests__/integration/studio-create.test.js +0 -209
  159. package/dist/__tests__/integration/studio-create.test.js.map +0 -1
  160. package/dist/__tests__/integration/studio-update.test.d.ts +0 -2
  161. package/dist/__tests__/integration/studio-update.test.d.ts.map +0 -1
  162. package/dist/__tests__/integration/studio-update.test.js +0 -166
  163. package/dist/__tests__/integration/studio-update.test.js.map +0 -1
  164. package/dist/commands/__tests__/configure.test.d.ts +0 -2
  165. package/dist/commands/__tests__/configure.test.d.ts.map +0 -1
  166. package/dist/commands/__tests__/configure.test.js +0 -229
  167. package/dist/commands/__tests__/configure.test.js.map +0 -1
  168. package/dist/prompts/__tests__/environment-setup.test.d.ts +0 -2
  169. package/dist/prompts/__tests__/environment-setup.test.d.ts.map +0 -1
  170. package/dist/prompts/__tests__/environment-setup.test.js +0 -206
  171. package/dist/prompts/__tests__/environment-setup.test.js.map +0 -1
  172. package/dist/prompts/__tests__/hub-integration.test.d.ts +0 -2
  173. package/dist/prompts/__tests__/hub-integration.test.d.ts.map +0 -1
  174. package/dist/prompts/__tests__/hub-integration.test.js +0 -126
  175. package/dist/prompts/__tests__/hub-integration.test.js.map +0 -1
  176. package/dist/prompts/__tests__/prompt-helpers.test.d.ts +0 -2
  177. package/dist/prompts/__tests__/prompt-helpers.test.d.ts.map +0 -1
  178. package/dist/prompts/__tests__/prompt-helpers.test.js +0 -235
  179. package/dist/prompts/__tests__/prompt-helpers.test.js.map +0 -1
  180. package/dist/sembix-cli-1.3.0.tgz +0 -0
  181. package/dist/utils/__tests__/config-file.test.d.ts +0 -2
  182. package/dist/utils/__tests__/config-file.test.d.ts.map +0 -1
  183. package/dist/utils/__tests__/config-file.test.js +0 -218
  184. package/dist/utils/__tests__/config-file.test.js.map +0 -1
  185. package/dist/utils/__tests__/config-loader.test.d.ts +0 -2
  186. package/dist/utils/__tests__/config-loader.test.d.ts.map +0 -1
  187. package/dist/utils/__tests__/config-loader.test.js +0 -325
  188. package/dist/utils/__tests__/config-loader.test.js.map +0 -1
  189. package/dist/utils/__tests__/github.test.d.ts +0 -2
  190. package/dist/utils/__tests__/github.test.d.ts.map +0 -1
  191. package/dist/utils/__tests__/github.test.js +0 -282
  192. package/dist/utils/__tests__/github.test.js.map +0 -1
  193. package/dist/utils/__tests__/ui.test.d.ts +0 -2
  194. package/dist/utils/__tests__/ui.test.d.ts.map +0 -1
  195. package/dist/utils/__tests__/ui.test.js +0 -256
  196. package/dist/utils/__tests__/ui.test.js.map +0 -1
@@ -0,0 +1,872 @@
1
+ # Sembix CLI - Usage Examples
2
+
3
+ Real-world examples showing different ways to use the CLI.
4
+
5
+ ## Getting Started
6
+
7
+ ### First Time Setup
8
+
9
+ Before creating environments, configure your credentials:
10
+
11
+ ```bash
12
+ sembix configure
13
+ ```
14
+
15
+ **What happens:**
16
+ - Prompts for GitHub Personal Access Token
17
+ - Prompts for default GitHub organization (optional)
18
+ - Saves to `~/.sembix/config` securely
19
+
20
+ **Alternative:** Create a `.env` file with `GITHUB_TOKEN=ghp_...`
21
+
22
+ ---
23
+
24
+ ## Basic Usage Patterns
25
+
26
+ ### 1. Fully Interactive (Beginner-Friendly)
27
+
28
+ Perfect for first-time users or when you want to see all options:
29
+
30
+ ```bash
31
+ sembix studio create
32
+ ```
33
+
34
+ **What happens:**
35
+ - Prompts for repository selection
36
+ - Prompts for environment name
37
+ - Walks through all 8 configuration steps with explanations
38
+ - Creates environment with all settings
39
+
40
+ ---
41
+
42
+ ### 2. Quick Create with Name Only
43
+
44
+ When you know the environment name but want to select repo interactively:
45
+
46
+ ```bash
47
+ sembix studio create production
48
+ ```
49
+
50
+ **What happens:**
51
+ - Uses "production" as environment name
52
+ - Prompts for repository selection
53
+ - Walks through configuration steps
54
+ - Creates environment
55
+
56
+ ---
57
+
58
+ ### 3. Specify Repository and Environment
59
+
60
+ Fast setup when you know both values:
61
+
62
+ ```bash
63
+ sembix studio create production --repo acme-corp/sembix-deployment
64
+ ```
65
+
66
+ Or using the `-e` flag:
67
+
68
+ ```bash
69
+ sembix studio create --repo acme-corp/sembix-deployment --env production
70
+ ```
71
+
72
+ **What happens:**
73
+ - ✅ Validates repository exists
74
+ - ✅ Validates environment name format
75
+ - ✅ Checks environment doesn't already exist
76
+ - Skips repository and name prompts
77
+ - Walks through configuration steps
78
+ - Creates environment
79
+
80
+ **Validation errors:**
81
+
82
+ ```bash
83
+ # Invalid repository
84
+ $ sembix studio create prod --repo invalid/repo
85
+ ✗ Repository 'invalid/repo' not found or not accessible.
86
+
87
+ 💡 Make sure:
88
+ • The repository name is correct (owner/repo)
89
+ • Your GitHub token has access to this repository
90
+
91
+ # Environment already exists
92
+ $ sembix studio create existing --repo acme/deploy
93
+ ✗ Environment 'existing' already exists in acme/deploy
94
+
95
+ 💡 Tip:
96
+ • Use a different environment name
97
+ • Or update the existing environment with: sembix studio add-hub
98
+
99
+ # Invalid environment name
100
+ $ sembix studio create PROD --repo acme/deploy
101
+ ✗ Invalid environment name. Must be lowercase letters, numbers, and hyphens (min 3 chars).
102
+ ```
103
+
104
+ ---
105
+
106
+ ## Hub Integration Usage
107
+
108
+ ### 1. Fully Interactive
109
+
110
+ ```bash
111
+ sembix studio add-hub
112
+ ```
113
+
114
+ **What happens:**
115
+ - Prompts for repository selection
116
+ - Lists environments in that repository
117
+ - Prompts for environment to update
118
+ - Collects Hub role ARNs
119
+ - Updates environment
120
+
121
+ ---
122
+
123
+ ### 2. Specify Environment Only
124
+
125
+ ```bash
126
+ sembix studio add-hub production
127
+ ```
128
+
129
+ **What happens:**
130
+ - Uses "production" as environment name
131
+ - Prompts for repository selection
132
+ - ✅ Validates environment exists in selected repository
133
+ - Collects Hub role ARNs
134
+ - Updates environment
135
+
136
+ ---
137
+
138
+ ### 3. Specify Both Repository and Environment
139
+
140
+ Fastest way - no prompts except for Hub configuration:
141
+
142
+ ```bash
143
+ sembix studio add-hub production --repo acme-corp/sembix-deployment
144
+ ```
145
+
146
+ Or using flags:
147
+
148
+ ```bash
149
+ sembix studio add-hub --repo acme-corp/sembix-deployment --env production
150
+ ```
151
+
152
+ **What happens:**
153
+ - ✅ Validates repository exists
154
+ - ✅ Validates environment exists in repository
155
+ - Skips repository and environment prompts
156
+ - Collects Hub role ARNs
157
+ - Updates environment
158
+
159
+ **Validation errors:**
160
+
161
+ ```bash
162
+ # Environment doesn't exist
163
+ $ sembix studio add-hub nonexistent --repo acme/deploy
164
+ ✗ Environment 'nonexistent' not found in acme/deploy
165
+
166
+ Available environments:
167
+ - production
168
+ - staging
169
+
170
+ # Repository not found
171
+ $ sembix studio add-hub prod --repo invalid/repo
172
+ ✗ Repository 'invalid/repo' not found or not accessible.
173
+ ```
174
+
175
+ ---
176
+
177
+ ## Common Workflows
178
+
179
+ ### Workflow 1: First-Time Setup (Learning Mode)
180
+
181
+ ```bash
182
+ # Step 1: Create environment interactively to learn all options
183
+ sembix studio create
184
+
185
+ # Follow all prompts, read explanations...
186
+
187
+ # Step 2: Deploy via GitHub Actions (manual step)
188
+ # Go to https://github.com/owner/repo/actions
189
+ # Run deployment workflow
190
+ # Copy Hub role ARNs from output
191
+
192
+ # Step 3: Add Hub integration interactively
193
+ sembix studio add-hub
194
+
195
+ # Select same repository and environment
196
+ # Enter Hub role ARNs
197
+ ```
198
+
199
+ ---
200
+
201
+ ### Workflow 2: Experienced User (Fast Mode)
202
+
203
+ ```bash
204
+ # Create environment with known values
205
+ sembix studio create prod --repo acme/deploy
206
+
207
+ # Answer remaining prompts (AWS, DB, networking, etc.)
208
+ # ... deployment happens in GitHub Actions ...
209
+
210
+ # Add Hub with known values
211
+ sembix studio add-hub prod --repo acme/deploy
212
+
213
+ # Enter Hub role ARNs
214
+ # Done!
215
+ ```
216
+
217
+ ---
218
+
219
+ ### Workflow 3: CI/CD / Automation
220
+
221
+ For scripts and automation, provide all non-AWS values upfront:
222
+
223
+ ```bash
224
+ #!/bin/bash
225
+
226
+ REPO="acme-corp/sembix-deployment"
227
+ ENV="client-${CLIENT_NAME}-production"
228
+ TOKEN="${GITHUB_TOKEN}"
229
+
230
+ # Create environment (still requires interactive AWS config)
231
+ sembix studio create "${ENV}" \
232
+ --repo "${REPO}" \
233
+ --token "${TOKEN}"
234
+
235
+ # Later, after deployment...
236
+ sembix studio add-hub "${ENV}" \
237
+ --repo "${REPO}" \
238
+ --token "${TOKEN}"
239
+ ```
240
+
241
+ ---
242
+
243
+ ### Workflow 4: Multiple Environments
244
+
245
+ Setting up multiple environments for the same repository:
246
+
247
+ ```bash
248
+ # Production
249
+ sembix studio create production --repo acme/deploy
250
+
251
+ # Staging
252
+ sembix studio create staging --repo acme/deploy
253
+
254
+ # Development
255
+ sembix studio create development --repo acme/deploy
256
+
257
+ # List all environments
258
+ sembix studio list acme/deploy
259
+ ```
260
+
261
+ ---
262
+
263
+ ## Using Different GitHub Tokens
264
+
265
+ ### Set Default Token (Recommended)
266
+
267
+ ```bash
268
+ # Interactive configuration (easiest)
269
+ sembix configure
270
+
271
+ # This saves your token to ~/.sembix/config
272
+ # All commands will use this token by default
273
+ ```
274
+
275
+ ### Override Token Per Command
276
+
277
+ ```bash
278
+ # Use different token for specific operation
279
+ sembix studio create --token ghp_custom_token --repo acme/deploy
280
+
281
+ # Useful for:
282
+ # - Testing with different accounts
283
+ # - CI/CD with service account tokens
284
+ # - One-time operations
285
+ ```
286
+
287
+ ### Alternative: Environment Variable
288
+
289
+ ```bash
290
+ # In .env file
291
+ GITHUB_TOKEN=ghp_your_default_token
292
+
293
+ # Or as environment variable
294
+ export GITHUB_TOKEN=ghp_your_token
295
+
296
+ # All commands use this token by default
297
+ sembix studio create
298
+ sembix studio add-hub
299
+ sembix studio list
300
+ ```
301
+
302
+ ---
303
+
304
+ ## Listing Environments
305
+
306
+ ### List All Repositories
307
+
308
+ ```bash
309
+ sembix studio list
310
+ ```
311
+
312
+ **Output:**
313
+ ```
314
+ ┌─────────────────────────────────────────┐
315
+ │ │
316
+ │ Sembix CLI │
317
+ │ │
318
+ └─────────────────────────────────────────┘
319
+
320
+ Sembix Studio - Environments
321
+
322
+ 💡 Tip: Specify a repository to see its environments
323
+ Example: sembix studio list owner/repo
324
+
325
+ ━━━ Your Repositories ━━━
326
+
327
+ 1. acme-corp/sembix-deployment
328
+ 2. globex-inc/studio-deploy
329
+ 3. partner-xyz/deployments
330
+ ```
331
+
332
+ ---
333
+
334
+ ### List Environments in Repository
335
+
336
+ ```bash
337
+ sembix studio list acme-corp/sembix-deployment
338
+ ```
339
+
340
+ **Output:**
341
+ ```
342
+ Environments in acme-corp/sembix-deployment
343
+
344
+ ━━━ Environments ━━━
345
+
346
+ 1. production
347
+ https://github.com/acme-corp/sembix-deployment/settings/environments/production
348
+
349
+ 2. staging
350
+ https://github.com/acme-corp/sembix-deployment/settings/environments/staging
351
+
352
+ 3. development
353
+ https://github.com/acme-corp/sembix-deployment/settings/environments/development
354
+ ```
355
+
356
+ ---
357
+
358
+ ## Error Handling Examples
359
+
360
+ ### Missing GitHub Token
361
+
362
+ ```bash
363
+ $ sembix studio create
364
+ ✗ GitHub token is required. Please provide it using one of these methods:
365
+ 1. Run: sembix configure
366
+ 2. Set GITHUB_TOKEN environment variable
367
+ 3. Pass --token flag to the command
368
+ 4. Create a .env file with GITHUB_TOKEN
369
+
370
+ Configuration file location: ~/.sembix/config
371
+ ```
372
+
373
+ **Solution:**
374
+ ```bash
375
+ sembix configure
376
+ ```
377
+
378
+ ### Invalid Repository Format
379
+
380
+ ```bash
381
+ $ sembix studio create prod --repo invalid_format
382
+ ✗ Invalid repository format. Use: owner/repo
383
+ ```
384
+
385
+ ### Repository Not Found
386
+
387
+ ```bash
388
+ $ sembix studio create prod --repo nonexistent/repo
389
+ ✗ Repository 'nonexistent/repo' not found or not accessible.
390
+
391
+ 💡 Make sure:
392
+ • The repository name is correct (owner/repo)
393
+ • Your GitHub token has access to this repository
394
+ ```
395
+
396
+ ### Invalid Environment Name
397
+
398
+ ```bash
399
+ $ sembix studio create "My Environment" --repo acme/deploy
400
+ ✗ Invalid environment name. Must be lowercase letters, numbers, and hyphens (min 3 chars).
401
+ ```
402
+
403
+ ### Environment Already Exists
404
+
405
+ ```bash
406
+ $ sembix studio create production --repo acme/deploy
407
+ ✗ Environment 'production' already exists in acme/deploy
408
+
409
+ 💡 Tip:
410
+ • Use a different environment name
411
+ • Or update the existing environment with: sembix studio add-hub
412
+ ```
413
+
414
+ ### Environment Not Found (Hub Integration)
415
+
416
+ ```bash
417
+ $ sembix studio add-hub nonexistent --repo acme/deploy
418
+ ✗ Environment 'nonexistent' not found in acme/deploy
419
+
420
+ Available environments:
421
+ - production
422
+ - staging
423
+ ```
424
+
425
+ ### Missing GitHub Token
426
+
427
+ ```bash
428
+ $ sembix studio create
429
+ ✗ GITHUB_TOKEN environment variable is required. Please set it in a .env file or as an environment variable.
430
+ ```
431
+
432
+ ---
433
+
434
+ ## Quick Reference
435
+
436
+ ### Create Command Syntax
437
+
438
+ ```bash
439
+ # All valid formats:
440
+ sembix studio create
441
+ sembix studio create <name>
442
+ sembix studio create --env <name>
443
+ sembix studio create --repo <owner/repo>
444
+ sembix studio create <name> --repo <owner/repo>
445
+ sembix studio create --repo <owner/repo> --env <name>
446
+ sembix studio create --repo <owner/repo> --env <name> --token <token>
447
+ ```
448
+
449
+ ### Add-Hub Command Syntax
450
+
451
+ ```bash
452
+ # All valid formats:
453
+ sembix studio add-hub
454
+ sembix studio add-hub <name>
455
+ sembix studio add-hub --env <name>
456
+ sembix studio add-hub --repo <owner/repo>
457
+ sembix studio add-hub <name> --repo <owner/repo>
458
+ sembix studio add-hub --repo <owner/repo> --env <name>
459
+ sembix studio add-hub --repo <owner/repo> --env <name> --token <token>
460
+ ```
461
+
462
+ ### List Command Syntax
463
+
464
+ ```bash
465
+ # All valid formats:
466
+ sembix studio list
467
+ sembix studio list <owner/repo>
468
+ sembix studio list --token <token>
469
+ sembix studio list <owner/repo> --token <token>
470
+ ```
471
+
472
+ ---
473
+
474
+ ## Tips for Power Users
475
+
476
+ ### 1. Aliases
477
+
478
+ Add to your shell profile:
479
+
480
+ ```bash
481
+ # ~/.zshrc or ~/.bashrc
482
+ alias sc='sembix studio create'
483
+ alias sh='sembix studio add-hub'
484
+ alias sl='sembix studio list'
485
+
486
+ # Usage
487
+ sc prod --repo acme/deploy
488
+ sh prod --repo acme/deploy
489
+ sl acme/deploy
490
+ ```
491
+
492
+ ---
493
+
494
+ ### 2. Environment Variables
495
+
496
+ Store common values:
497
+
498
+ ```bash
499
+ # In your .env or shell profile
500
+ export SEMBIX_REPO="acme-corp/sembix-deployment"
501
+ export GITHUB_TOKEN="ghp_your_token"
502
+
503
+ # Use in commands
504
+ sembix studio create prod --repo "$SEMBIX_REPO"
505
+ ```
506
+
507
+ ---
508
+
509
+ ### 3. Tab Completion
510
+
511
+ Most shells support command completion for `--repo`, `--env`, etc.
512
+
513
+ ---
514
+
515
+ ### 4. Validation First
516
+
517
+ Check what exists before creating:
518
+
519
+ ```bash
520
+ # See what's already there
521
+ sembix studio list acme/deploy
522
+
523
+ # Create new environment
524
+ sembix studio create newenv --repo acme/deploy
525
+ ```
526
+
527
+ ---
528
+
529
+ ## Best Practices
530
+
531
+ ### ✅ DO
532
+
533
+ - Use `--repo` and `--env` for repeated operations
534
+ - Validate with `sembix studio list` first
535
+ - Use descriptive environment names (client-production, staging-v2)
536
+ - Store GitHub token in `.env` file
537
+ - Keep environment names lowercase with hyphens
538
+
539
+ ### ❌ DON'T
540
+
541
+ - Don't use uppercase in environment names
542
+ - Don't use spaces or special characters
543
+ - Don't share your GitHub token
544
+ - Don't create environments without verifying repo access first
545
+ - Don't forget to run deployment between create and add-hub
546
+
547
+ ---
548
+
549
+ ## Project Management Usage
550
+
551
+ ### 1. List All Projects
552
+
553
+ ```bash
554
+ sembix project list
555
+ ```
556
+
557
+ **Output:**
558
+ ```json
559
+ {
560
+ "message": "Projects retrieved successfully",
561
+ "items": [
562
+ {
563
+ "projectId": "proj_abc123",
564
+ "name": "Production Deployment",
565
+ "state": "ACTIVE",
566
+ "createdAt": "2024-01-15T10:00:00Z"
567
+ },
568
+ {
569
+ "projectId": "proj_def456",
570
+ "name": "Staging Environment",
571
+ "state": "ACTIVE",
572
+ "createdAt": "2024-01-20T14:30:00Z"
573
+ }
574
+ ]
575
+ }
576
+ ```
577
+
578
+ ---
579
+
580
+ ### 2. Search Projects by Name
581
+
582
+ ```bash
583
+ sembix project list --name "Production"
584
+ ```
585
+
586
+ ---
587
+
588
+ ### 3. Show Project Details
589
+
590
+ ```bash
591
+ sembix project show --project-id proj_abc123
592
+ ```
593
+
594
+ **Output:**
595
+ ```json
596
+ {
597
+ "projectId": "proj_abc123",
598
+ "name": "Production Deployment",
599
+ "description": "Main production deployment project",
600
+ "state": "ACTIVE",
601
+ "createdAt": "2024-01-15T10:00:00Z",
602
+ "workflowPackConfigured": true,
603
+ "providerConfiguration": {...}
604
+ }
605
+ ```
606
+
607
+ ---
608
+
609
+ ## Profile Default Project Usage
610
+
611
+ ### 1. Set Default Project for Profile
612
+
613
+ ```bash
614
+ sembix profile set-default-project production proj_abc123
615
+ ```
616
+
617
+ **Output:**
618
+ ```
619
+ ✓ Default project set for profile 'production': proj_abc123
620
+ ```
621
+
622
+ ---
623
+
624
+ ### 2. Use Default Project in Commands
625
+
626
+ ```bash
627
+ # Set default
628
+ sembix profile set-default-project production proj_abc123
629
+
630
+ # Now you can omit --project-id
631
+ sembix workflow start --workflow-id wf_456 --inputs '{...}'
632
+
633
+ # Instead of
634
+ sembix workflow start --project-id proj_abc123 --workflow-id wf_456 --inputs '{...}'
635
+ ```
636
+
637
+ ---
638
+
639
+ ### 3. Get Default Project
640
+
641
+ ```bash
642
+ sembix profile get-default-project production
643
+ ```
644
+
645
+ **Output:**
646
+ ```
647
+ proj_abc123
648
+ ```
649
+
650
+ ---
651
+
652
+ ### 4. Clear Default Project
653
+
654
+ ```bash
655
+ sembix profile clear-default-project production
656
+ ```
657
+
658
+ **Output:**
659
+ ```
660
+ ✓ Default project cleared for profile 'production'
661
+ ```
662
+
663
+ ---
664
+
665
+ ## Interactive Workflow Start Usage
666
+
667
+ ### 1. Fully Interactive Mode
668
+
669
+ ```bash
670
+ sembix workflow start
671
+ ```
672
+
673
+ **What happens:**
674
+ 1. Prompts to select profile (if multiple configured)
675
+ 2. Prompts to select project (or uses default)
676
+ 3. Prompts to select workflow from project
677
+ 4. Prompts for each required input variable
678
+ 5. Starts workflow with provided inputs
679
+
680
+ **Example interaction:**
681
+ ```
682
+ ? Select profile: production
683
+ ? Select project: Production Deployment (proj_abc123)
684
+ ? Select workflow: Deploy to Production (wf_deploy_prod)
685
+
686
+ Configure workflow inputs:
687
+
688
+ ? environment (string): production
689
+ ? version (string): 1.2.3
690
+ ? replicas (number): 3
691
+
692
+ ✓ Workflow started successfully!
693
+ Run ID: run_xyz789
694
+ Task ARN: arn:aws:ecs:...
695
+ ```
696
+
697
+ ---
698
+
699
+ ### 2. Interactive with Workflow Name
700
+
701
+ ```bash
702
+ sembix workflow start --project-id proj_abc123 --workflow-name "Deploy"
703
+ ```
704
+
705
+ **What happens:**
706
+ 1. Searches for workflows matching "Deploy" in project
707
+ 2. If multiple matches, prompts to select
708
+ 3. Prompts for input variables
709
+ 4. Starts workflow
710
+
711
+ ---
712
+
713
+ ### 3. Non-Interactive Mode
714
+
715
+ ```bash
716
+ sembix workflow start \
717
+ --project-id proj_abc123 \
718
+ --workflow-id wf_456 \
719
+ --inputs @inputs.json \
720
+ --no-interactive
721
+ ```
722
+
723
+ **What happens:**
724
+ - Skips all prompts
725
+ - Uses provided inputs directly
726
+ - Fails if required inputs are missing
727
+
728
+ ---
729
+
730
+ ## Output Formatting Usage
731
+
732
+ ### 1. JSON Output (Default)
733
+
734
+ ```bash
735
+ sembix project list
736
+ ```
737
+
738
+ **Output:**
739
+ ```json
740
+ {"message":"Projects retrieved successfully","items":[...]}
741
+ ```
742
+
743
+ ---
744
+
745
+ ### 2. Pretty JSON Output
746
+
747
+ ```bash
748
+ sembix project list --pretty
749
+ ```
750
+
751
+ **Output:**
752
+ ```json
753
+ {
754
+ "message": "Projects retrieved successfully",
755
+ "items": [
756
+ {
757
+ "projectId": "proj_abc123",
758
+ "name": "Production Deployment",
759
+ "state": "ACTIVE"
760
+ }
761
+ ]
762
+ }
763
+ ```
764
+
765
+ ---
766
+
767
+ ### 3. Text Output
768
+
769
+ ```bash
770
+ sembix project list --output text
771
+ ```
772
+
773
+ **Output:**
774
+ ```
775
+ Projects:
776
+ 1. Production Deployment (proj_abc123) - ACTIVE
777
+ 2. Staging Environment (proj_def456) - ACTIVE
778
+ ```
779
+
780
+ ---
781
+
782
+ ## Workflow Run Management Usage
783
+
784
+ ### 1. List Workflow Runs (Excludes Subflows)
785
+
786
+ ```bash
787
+ sembix workflow run list --workflow-id wf_456
788
+ ```
789
+
790
+ **Output:**
791
+ ```json
792
+ {
793
+ "items": [
794
+ {
795
+ "runs": [
796
+ {
797
+ "runId": "run_xyz789",
798
+ "status": "IN_PROGRESS",
799
+ "progress": 45,
800
+ "createdAt": "2024-01-15T14:30:00Z"
801
+ }
802
+ ],
803
+ "totalCount": 15
804
+ }
805
+ ]
806
+ }
807
+ ```
808
+
809
+ ---
810
+
811
+ ### 2. Include Sub-Workflow Runs
812
+
813
+ ```bash
814
+ sembix workflow run list --workflow-id wf_456 --include-subflows
815
+ ```
816
+
817
+ ---
818
+
819
+ ### 3. Filter to Top-Level Runs Only
820
+
821
+ ```bash
822
+ sembix workflow run list --parent-id NULL
823
+ ```
824
+
825
+ ---
826
+
827
+ ### 4. Show Full Run Details
828
+
829
+ ```bash
830
+ sembix workflow run show --workflow-id wf_456 --run-id run_xyz789
831
+ ```
832
+
833
+ **Output:**
834
+ ```json
835
+ {
836
+ "run": {
837
+ "runId": "run_xyz789",
838
+ "status": "IN_PROGRESS",
839
+ "progress": 45,
840
+ "steps": [
841
+ {
842
+ "stepId": "step_1",
843
+ "name": "Initialize",
844
+ "state": "Complete"
845
+ },
846
+ {
847
+ "stepId": "step_2",
848
+ "name": "Deploy",
849
+ "state": "Pending"
850
+ }
851
+ ],
852
+ "currentStepId": "step_2"
853
+ }
854
+ }
855
+ ```
856
+
857
+ ---
858
+
859
+ ### 5. Watch Run Until Completion
860
+
861
+ ```bash
862
+ sembix workflow run show --workflow-id wf_456 --run-id run_xyz789 --watch
863
+ ```
864
+
865
+ **What happens:**
866
+ - Polls run status every 5 seconds
867
+ - Displays progress updates
868
+ - Exits when run reaches terminal state (COMPLETED, FAILED, CANCELLED)
869
+
870
+ ---
871
+
872
+ **Last Updated**: November 2024