@build-astron-co/nimbus 0.2.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 (313) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +628 -0
  3. package/bin/nimbus +38 -0
  4. package/package.json +80 -0
  5. package/src/__tests__/app.test.ts +76 -0
  6. package/src/__tests__/audit.test.ts +877 -0
  7. package/src/__tests__/circuit-breaker.test.ts +116 -0
  8. package/src/__tests__/cli-run.test.ts +115 -0
  9. package/src/__tests__/context-manager.test.ts +502 -0
  10. package/src/__tests__/context.test.ts +242 -0
  11. package/src/__tests__/enterprise.test.ts +401 -0
  12. package/src/__tests__/generator.test.ts +433 -0
  13. package/src/__tests__/hooks.test.ts +582 -0
  14. package/src/__tests__/init.test.ts +436 -0
  15. package/src/__tests__/intent-parser.test.ts +229 -0
  16. package/src/__tests__/llm-router.test.ts +209 -0
  17. package/src/__tests__/lsp.test.ts +293 -0
  18. package/src/__tests__/modes.test.ts +336 -0
  19. package/src/__tests__/permissions.test.ts +338 -0
  20. package/src/__tests__/serve.test.ts +275 -0
  21. package/src/__tests__/sessions.test.ts +227 -0
  22. package/src/__tests__/sharing.test.ts +288 -0
  23. package/src/__tests__/snapshots.test.ts +581 -0
  24. package/src/__tests__/state-db.test.ts +334 -0
  25. package/src/__tests__/stream-with-tools.test.ts +732 -0
  26. package/src/__tests__/subagents.test.ts +176 -0
  27. package/src/__tests__/system-prompt.test.ts +169 -0
  28. package/src/__tests__/tool-converter.test.ts +256 -0
  29. package/src/__tests__/tool-schemas.test.ts +397 -0
  30. package/src/__tests__/tools.test.ts +143 -0
  31. package/src/__tests__/version.test.ts +49 -0
  32. package/src/agent/compaction-agent.ts +227 -0
  33. package/src/agent/context-manager.ts +435 -0
  34. package/src/agent/context.ts +427 -0
  35. package/src/agent/deploy-preview.ts +426 -0
  36. package/src/agent/index.ts +68 -0
  37. package/src/agent/loop.ts +717 -0
  38. package/src/agent/modes.ts +429 -0
  39. package/src/agent/permissions.ts +466 -0
  40. package/src/agent/subagents/base.ts +116 -0
  41. package/src/agent/subagents/cost.ts +51 -0
  42. package/src/agent/subagents/explore.ts +42 -0
  43. package/src/agent/subagents/general.ts +54 -0
  44. package/src/agent/subagents/index.ts +102 -0
  45. package/src/agent/subagents/infra.ts +59 -0
  46. package/src/agent/subagents/security.ts +69 -0
  47. package/src/agent/system-prompt.ts +436 -0
  48. package/src/app.ts +122 -0
  49. package/src/audit/activity-log.ts +290 -0
  50. package/src/audit/compliance-checker.ts +540 -0
  51. package/src/audit/cost-tracker.ts +318 -0
  52. package/src/audit/index.ts +23 -0
  53. package/src/audit/security-scanner.ts +596 -0
  54. package/src/auth/guard.ts +75 -0
  55. package/src/auth/index.ts +56 -0
  56. package/src/auth/oauth.ts +455 -0
  57. package/src/auth/providers.ts +470 -0
  58. package/src/auth/sso.ts +113 -0
  59. package/src/auth/store.ts +505 -0
  60. package/src/auth/types.ts +187 -0
  61. package/src/build.ts +141 -0
  62. package/src/cli/index.ts +16 -0
  63. package/src/cli/init.ts +854 -0
  64. package/src/cli/openapi-spec.ts +356 -0
  65. package/src/cli/run.ts +237 -0
  66. package/src/cli/serve-auth.ts +80 -0
  67. package/src/cli/serve.ts +462 -0
  68. package/src/cli/web.ts +67 -0
  69. package/src/cli.ts +1417 -0
  70. package/src/clients/core-engine-client.ts +227 -0
  71. package/src/clients/enterprise-client.ts +334 -0
  72. package/src/clients/generator-client.ts +351 -0
  73. package/src/clients/git-client.ts +627 -0
  74. package/src/clients/github-client.ts +410 -0
  75. package/src/clients/helm-client.ts +504 -0
  76. package/src/clients/index.ts +80 -0
  77. package/src/clients/k8s-client.ts +497 -0
  78. package/src/clients/llm-client.ts +161 -0
  79. package/src/clients/rest-client.ts +130 -0
  80. package/src/clients/service-discovery.ts +33 -0
  81. package/src/clients/terraform-client.ts +482 -0
  82. package/src/clients/tools-client.ts +1843 -0
  83. package/src/clients/ws-client.ts +115 -0
  84. package/src/commands/analyze/index.ts +352 -0
  85. package/src/commands/apply/helm.ts +473 -0
  86. package/src/commands/apply/index.ts +213 -0
  87. package/src/commands/apply/k8s.ts +454 -0
  88. package/src/commands/apply/terraform.ts +582 -0
  89. package/src/commands/ask.ts +167 -0
  90. package/src/commands/audit/index.ts +238 -0
  91. package/src/commands/auth-cloud.ts +294 -0
  92. package/src/commands/auth-list.ts +134 -0
  93. package/src/commands/auth-profile.ts +121 -0
  94. package/src/commands/auth-status.ts +141 -0
  95. package/src/commands/aws/ec2.ts +501 -0
  96. package/src/commands/aws/iam.ts +397 -0
  97. package/src/commands/aws/index.ts +133 -0
  98. package/src/commands/aws/lambda.ts +396 -0
  99. package/src/commands/aws/rds.ts +439 -0
  100. package/src/commands/aws/s3.ts +439 -0
  101. package/src/commands/aws/vpc.ts +393 -0
  102. package/src/commands/aws-discover.ts +649 -0
  103. package/src/commands/aws-terraform.ts +805 -0
  104. package/src/commands/azure/aks.ts +376 -0
  105. package/src/commands/azure/functions.ts +253 -0
  106. package/src/commands/azure/index.ts +116 -0
  107. package/src/commands/azure/storage.ts +478 -0
  108. package/src/commands/azure/vm.ts +355 -0
  109. package/src/commands/billing/index.ts +256 -0
  110. package/src/commands/chat.ts +314 -0
  111. package/src/commands/config.ts +346 -0
  112. package/src/commands/cost/cloud-cost-estimator.ts +266 -0
  113. package/src/commands/cost/estimator.ts +79 -0
  114. package/src/commands/cost/index.ts +594 -0
  115. package/src/commands/cost/parsers/terraform.ts +273 -0
  116. package/src/commands/cost/parsers/types.ts +25 -0
  117. package/src/commands/cost/pricing/aws.ts +544 -0
  118. package/src/commands/cost/pricing/azure.ts +499 -0
  119. package/src/commands/cost/pricing/gcp.ts +396 -0
  120. package/src/commands/cost/pricing/index.ts +40 -0
  121. package/src/commands/demo.ts +250 -0
  122. package/src/commands/doctor.ts +794 -0
  123. package/src/commands/drift/index.ts +439 -0
  124. package/src/commands/explain.ts +277 -0
  125. package/src/commands/feedback.ts +389 -0
  126. package/src/commands/fix.ts +324 -0
  127. package/src/commands/fs/index.ts +402 -0
  128. package/src/commands/gcp/compute.ts +325 -0
  129. package/src/commands/gcp/functions.ts +271 -0
  130. package/src/commands/gcp/gke.ts +438 -0
  131. package/src/commands/gcp/iam.ts +344 -0
  132. package/src/commands/gcp/index.ts +129 -0
  133. package/src/commands/gcp/storage.ts +284 -0
  134. package/src/commands/generate-helm.ts +1249 -0
  135. package/src/commands/generate-k8s.ts +1560 -0
  136. package/src/commands/generate-terraform.ts +1460 -0
  137. package/src/commands/gh/index.ts +863 -0
  138. package/src/commands/git/index.ts +1343 -0
  139. package/src/commands/helm/index.ts +1126 -0
  140. package/src/commands/help.ts +539 -0
  141. package/src/commands/history.ts +142 -0
  142. package/src/commands/import.ts +868 -0
  143. package/src/commands/index.ts +367 -0
  144. package/src/commands/init.ts +1046 -0
  145. package/src/commands/k8s/index.ts +1137 -0
  146. package/src/commands/login.ts +631 -0
  147. package/src/commands/logout.ts +83 -0
  148. package/src/commands/onboarding.ts +228 -0
  149. package/src/commands/plan/display.ts +279 -0
  150. package/src/commands/plan/index.ts +599 -0
  151. package/src/commands/preview.ts +452 -0
  152. package/src/commands/questionnaire.ts +1270 -0
  153. package/src/commands/resume.ts +55 -0
  154. package/src/commands/team/index.ts +346 -0
  155. package/src/commands/template.ts +232 -0
  156. package/src/commands/tf/index.ts +1034 -0
  157. package/src/commands/upgrade.ts +550 -0
  158. package/src/commands/usage/index.ts +134 -0
  159. package/src/commands/version.ts +170 -0
  160. package/src/compat/index.ts +2 -0
  161. package/src/compat/runtime.ts +12 -0
  162. package/src/compat/sqlite.ts +107 -0
  163. package/src/config/index.ts +17 -0
  164. package/src/config/manager.ts +530 -0
  165. package/src/config/safety-policy.ts +358 -0
  166. package/src/config/schema.ts +125 -0
  167. package/src/config/types.ts +527 -0
  168. package/src/context/context-db.ts +199 -0
  169. package/src/demo/index.ts +349 -0
  170. package/src/demo/scenarios/full-journey.ts +229 -0
  171. package/src/demo/scenarios/getting-started.ts +127 -0
  172. package/src/demo/scenarios/helm-release.ts +341 -0
  173. package/src/demo/scenarios/k8s-deployment.ts +194 -0
  174. package/src/demo/scenarios/terraform-vpc.ts +170 -0
  175. package/src/demo/types.ts +92 -0
  176. package/src/engine/cost-estimator.ts +438 -0
  177. package/src/engine/diagram-generator.ts +256 -0
  178. package/src/engine/drift-detector.ts +902 -0
  179. package/src/engine/executor.ts +1035 -0
  180. package/src/engine/index.ts +76 -0
  181. package/src/engine/orchestrator.ts +636 -0
  182. package/src/engine/planner.ts +720 -0
  183. package/src/engine/safety.ts +743 -0
  184. package/src/engine/verifier.ts +770 -0
  185. package/src/enterprise/audit.ts +348 -0
  186. package/src/enterprise/auth.ts +270 -0
  187. package/src/enterprise/billing.ts +822 -0
  188. package/src/enterprise/index.ts +17 -0
  189. package/src/enterprise/teams.ts +443 -0
  190. package/src/generator/best-practices.ts +1608 -0
  191. package/src/generator/helm.ts +630 -0
  192. package/src/generator/index.ts +37 -0
  193. package/src/generator/intent-parser.ts +514 -0
  194. package/src/generator/kubernetes.ts +976 -0
  195. package/src/generator/terraform.ts +1867 -0
  196. package/src/history/index.ts +8 -0
  197. package/src/history/manager.ts +322 -0
  198. package/src/history/types.ts +34 -0
  199. package/src/hooks/config.ts +432 -0
  200. package/src/hooks/engine.ts +391 -0
  201. package/src/hooks/index.ts +4 -0
  202. package/src/llm/auth-bridge.ts +198 -0
  203. package/src/llm/circuit-breaker.ts +140 -0
  204. package/src/llm/config-loader.ts +201 -0
  205. package/src/llm/cost-calculator.ts +171 -0
  206. package/src/llm/index.ts +8 -0
  207. package/src/llm/model-aliases.ts +115 -0
  208. package/src/llm/provider-registry.ts +63 -0
  209. package/src/llm/providers/anthropic.ts +433 -0
  210. package/src/llm/providers/bedrock.ts +477 -0
  211. package/src/llm/providers/google.ts +405 -0
  212. package/src/llm/providers/ollama.ts +767 -0
  213. package/src/llm/providers/openai-compatible.ts +340 -0
  214. package/src/llm/providers/openai.ts +328 -0
  215. package/src/llm/providers/openrouter.ts +338 -0
  216. package/src/llm/router.ts +1035 -0
  217. package/src/llm/types.ts +232 -0
  218. package/src/lsp/client.ts +298 -0
  219. package/src/lsp/languages.ts +116 -0
  220. package/src/lsp/manager.ts +278 -0
  221. package/src/mcp/client.ts +402 -0
  222. package/src/mcp/index.ts +5 -0
  223. package/src/mcp/manager.ts +133 -0
  224. package/src/nimbus.ts +214 -0
  225. package/src/plugins/index.ts +27 -0
  226. package/src/plugins/loader.ts +334 -0
  227. package/src/plugins/manager.ts +376 -0
  228. package/src/plugins/types.ts +284 -0
  229. package/src/scanners/cicd-scanner.ts +258 -0
  230. package/src/scanners/cloud-scanner.ts +466 -0
  231. package/src/scanners/framework-scanner.ts +469 -0
  232. package/src/scanners/iac-scanner.ts +388 -0
  233. package/src/scanners/index.ts +539 -0
  234. package/src/scanners/language-scanner.ts +276 -0
  235. package/src/scanners/package-manager-scanner.ts +277 -0
  236. package/src/scanners/types.ts +172 -0
  237. package/src/sessions/manager.ts +365 -0
  238. package/src/sessions/types.ts +44 -0
  239. package/src/sharing/sync.ts +296 -0
  240. package/src/sharing/viewer.ts +97 -0
  241. package/src/snapshots/index.ts +2 -0
  242. package/src/snapshots/manager.ts +530 -0
  243. package/src/state/artifacts.ts +147 -0
  244. package/src/state/audit.ts +137 -0
  245. package/src/state/billing.ts +240 -0
  246. package/src/state/checkpoints.ts +117 -0
  247. package/src/state/config.ts +67 -0
  248. package/src/state/conversations.ts +14 -0
  249. package/src/state/credentials.ts +154 -0
  250. package/src/state/db.ts +58 -0
  251. package/src/state/index.ts +26 -0
  252. package/src/state/messages.ts +115 -0
  253. package/src/state/projects.ts +123 -0
  254. package/src/state/schema.ts +236 -0
  255. package/src/state/sessions.ts +147 -0
  256. package/src/state/teams.ts +200 -0
  257. package/src/telemetry.ts +108 -0
  258. package/src/tools/aws-ops.ts +952 -0
  259. package/src/tools/azure-ops.ts +579 -0
  260. package/src/tools/file-ops.ts +593 -0
  261. package/src/tools/gcp-ops.ts +625 -0
  262. package/src/tools/git-ops.ts +773 -0
  263. package/src/tools/github-ops.ts +799 -0
  264. package/src/tools/helm-ops.ts +943 -0
  265. package/src/tools/index.ts +17 -0
  266. package/src/tools/k8s-ops.ts +819 -0
  267. package/src/tools/schemas/converter.ts +184 -0
  268. package/src/tools/schemas/devops.ts +612 -0
  269. package/src/tools/schemas/index.ts +73 -0
  270. package/src/tools/schemas/standard.ts +1144 -0
  271. package/src/tools/schemas/types.ts +705 -0
  272. package/src/tools/terraform-ops.ts +862 -0
  273. package/src/types/ambient.d.ts +193 -0
  274. package/src/types/config.ts +83 -0
  275. package/src/types/drift.ts +116 -0
  276. package/src/types/enterprise.ts +335 -0
  277. package/src/types/index.ts +20 -0
  278. package/src/types/plan.ts +44 -0
  279. package/src/types/request.ts +65 -0
  280. package/src/types/response.ts +54 -0
  281. package/src/types/service.ts +51 -0
  282. package/src/ui/App.tsx +997 -0
  283. package/src/ui/DeployPreview.tsx +169 -0
  284. package/src/ui/Header.tsx +68 -0
  285. package/src/ui/InputBox.tsx +350 -0
  286. package/src/ui/MessageList.tsx +585 -0
  287. package/src/ui/PermissionPrompt.tsx +151 -0
  288. package/src/ui/StatusBar.tsx +158 -0
  289. package/src/ui/ToolCallDisplay.tsx +409 -0
  290. package/src/ui/chat-ui.ts +853 -0
  291. package/src/ui/index.ts +33 -0
  292. package/src/ui/ink/index.ts +711 -0
  293. package/src/ui/streaming.ts +176 -0
  294. package/src/ui/types.ts +57 -0
  295. package/src/utils/analytics.ts +72 -0
  296. package/src/utils/cost-warning.ts +27 -0
  297. package/src/utils/env.ts +46 -0
  298. package/src/utils/errors.ts +69 -0
  299. package/src/utils/event-bus.ts +38 -0
  300. package/src/utils/index.ts +24 -0
  301. package/src/utils/logger.ts +171 -0
  302. package/src/utils/rate-limiter.ts +121 -0
  303. package/src/utils/service-auth.ts +49 -0
  304. package/src/utils/validation.ts +53 -0
  305. package/src/version.ts +4 -0
  306. package/src/watcher/index.ts +163 -0
  307. package/src/wizard/approval.ts +383 -0
  308. package/src/wizard/index.ts +25 -0
  309. package/src/wizard/prompts.ts +338 -0
  310. package/src/wizard/types.ts +171 -0
  311. package/src/wizard/ui.ts +556 -0
  312. package/src/wizard/wizard.ts +304 -0
  313. package/tsconfig.json +24 -0
@@ -0,0 +1,341 @@
1
+ /**
2
+ * Helm Release Demo Scenario
3
+ *
4
+ * Demonstrates creating and deploying a Helm chart
5
+ */
6
+
7
+ import type { DemoScenario } from '../types';
8
+
9
+ export const helmReleaseScenario: DemoScenario = {
10
+ id: 'helm-release',
11
+ name: 'Create and Deploy Helm Chart',
12
+ description: 'Learn how to create and deploy Helm charts with Nimbus',
13
+ category: 'helm',
14
+ duration: 15,
15
+ prerequisites: [
16
+ 'Helm 3.x installed',
17
+ 'kubectl configured with cluster access',
18
+ 'Nimbus CLI installed',
19
+ ],
20
+ tags: ['helm', 'charts', 'deployment', 'kubernetes'],
21
+ steps: [
22
+ {
23
+ id: 'check-helm',
24
+ title: 'Verify Helm Installation',
25
+ description: 'Check that Helm is installed and configured',
26
+ command: 'nimbus helm version',
27
+ showOutput: true,
28
+ waitForInput: true,
29
+ mockResponse: `
30
+ Helm Version: v3.14.0
31
+ Kubernetes Version: v1.28.0
32
+ `.trim(),
33
+ },
34
+ {
35
+ id: 'generate-chart',
36
+ title: 'Generate Helm Chart',
37
+ description: 'Create a new Helm chart for a web application',
38
+ command: 'nimbus generate helm --name my-webapp --type web --output ./charts',
39
+ showOutput: true,
40
+ waitForInput: true,
41
+ mockResponse: `
42
+ Generating Helm chart...
43
+
44
+ Created chart: my-webapp
45
+
46
+ charts/my-webapp/
47
+ ├── Chart.yaml # Chart metadata
48
+ ├── values.yaml # Default values
49
+ ├── templates/
50
+ │ ├── _helpers.tpl # Template helpers
51
+ │ ├── deployment.yaml # Deployment template
52
+ │ ├── service.yaml # Service template
53
+ │ ├── ingress.yaml # Ingress template
54
+ │ ├── configmap.yaml # ConfigMap template
55
+ │ ├── hpa.yaml # HPA template
56
+ │ └── NOTES.txt # Post-install notes
57
+ └── .helmignore # Files to ignore
58
+
59
+ Chart type: Web Application
60
+ Features:
61
+ ✓ Deployment with health checks
62
+ ✓ Service (ClusterIP/LoadBalancer)
63
+ ✓ Ingress with TLS support
64
+ ✓ ConfigMap for environment
65
+ ✓ Horizontal Pod Autoscaler
66
+
67
+ Generated successfully!
68
+ `.trim(),
69
+ },
70
+ {
71
+ id: 'review-chart',
72
+ title: 'Review Chart Configuration',
73
+ description: 'Examine the generated Chart.yaml and values.yaml',
74
+ command: 'nimbus explain helm charts/my-webapp',
75
+ showOutput: true,
76
+ waitForInput: true,
77
+ mockResponse: `
78
+ Chart: my-webapp
79
+
80
+ Chart.yaml:
81
+ name: my-webapp
82
+ version: 0.1.0
83
+ appVersion: "1.0.0"
84
+ description: A Helm chart for a web application
85
+ type: application
86
+
87
+ values.yaml (key configurations):
88
+
89
+ replicaCount: 2
90
+
91
+ image:
92
+ repository: nginx
93
+ tag: "latest"
94
+ pullPolicy: IfNotPresent
95
+
96
+ service:
97
+ type: ClusterIP
98
+ port: 80
99
+
100
+ ingress:
101
+ enabled: false
102
+ className: "nginx"
103
+ hosts:
104
+ - host: my-webapp.local
105
+ paths:
106
+ - path: /
107
+ pathType: Prefix
108
+
109
+ resources:
110
+ limits:
111
+ cpu: 500m
112
+ memory: 512Mi
113
+ requests:
114
+ cpu: 100m
115
+ memory: 128Mi
116
+
117
+ autoscaling:
118
+ enabled: true
119
+ minReplicas: 2
120
+ maxReplicas: 10
121
+ targetCPUUtilization: 70
122
+
123
+ This chart follows Helm best practices with
124
+ configurable replicas, resources, and scaling.
125
+ `.trim(),
126
+ },
127
+ {
128
+ id: 'lint-chart',
129
+ title: 'Lint the Chart',
130
+ description: 'Validate the chart structure and templates',
131
+ command: 'nimbus helm lint charts/my-webapp',
132
+ showOutput: true,
133
+ waitForInput: true,
134
+ mockResponse: `
135
+ ==> Linting charts/my-webapp
136
+
137
+ [INFO] Chart.yaml: icon is recommended
138
+
139
+ 1 chart(s) linted, 0 chart(s) failed
140
+
141
+ Lint Summary:
142
+ ✓ Chart.yaml valid
143
+ ✓ values.yaml valid
144
+ ✓ Templates compile correctly
145
+ ✓ Required files present
146
+
147
+ Chart is ready for deployment!
148
+ `.trim(),
149
+ },
150
+ {
151
+ id: 'template-preview',
152
+ title: 'Preview Rendered Templates',
153
+ description: 'See what the chart will generate when installed',
154
+ command:
155
+ 'nimbus helm template my-webapp charts/my-webapp --values charts/my-webapp/values.yaml | head -50',
156
+ showOutput: true,
157
+ waitForInput: true,
158
+ mockResponse: `
159
+ ---
160
+ # Source: my-webapp/templates/configmap.yaml
161
+ apiVersion: v1
162
+ kind: ConfigMap
163
+ metadata:
164
+ name: my-webapp-config
165
+ labels:
166
+ app.kubernetes.io/name: my-webapp
167
+ app.kubernetes.io/instance: my-webapp
168
+ data:
169
+ APP_ENV: "production"
170
+ ---
171
+ # Source: my-webapp/templates/service.yaml
172
+ apiVersion: v1
173
+ kind: Service
174
+ metadata:
175
+ name: my-webapp
176
+ labels:
177
+ app.kubernetes.io/name: my-webapp
178
+ spec:
179
+ type: ClusterIP
180
+ ports:
181
+ - port: 80
182
+ targetPort: http
183
+ protocol: TCP
184
+ name: http
185
+ selector:
186
+ app.kubernetes.io/name: my-webapp
187
+ ---
188
+ # Source: my-webapp/templates/deployment.yaml
189
+ apiVersion: apps/v1
190
+ kind: Deployment
191
+ metadata:
192
+ name: my-webapp
193
+ labels:
194
+ app.kubernetes.io/name: my-webapp
195
+ spec:
196
+ replicas: 2
197
+ selector:
198
+ matchLabels:
199
+ app.kubernetes.io/name: my-webapp
200
+ template:
201
+ ...
202
+ `.trim(),
203
+ },
204
+ {
205
+ id: 'install-release',
206
+ title: 'Install Helm Release (Dry Run)',
207
+ description: 'Deploy the chart to Kubernetes (dry run mode)',
208
+ command:
209
+ 'nimbus apply helm --release my-webapp --chart charts/my-webapp --namespace demo --dry-run',
210
+ showOutput: true,
211
+ waitForInput: true,
212
+ mockResponse: `
213
+ Dry Run - Helm Install
214
+
215
+ Release: my-webapp
216
+ Namespace: demo
217
+ Chart: charts/my-webapp (0.1.0)
218
+
219
+ Resources to be created:
220
+ ✓ ConfigMap/my-webapp-config
221
+ ✓ Service/my-webapp
222
+ ✓ Deployment/my-webapp
223
+ ✓ HorizontalPodAutoscaler/my-webapp
224
+
225
+ Computed Values:
226
+ replicaCount: 2
227
+ image.repository: nginx
228
+ image.tag: latest
229
+ service.type: ClusterIP
230
+
231
+ No resources were created (dry run mode)
232
+
233
+ To install for real, remove --dry-run flag
234
+ `.trim(),
235
+ },
236
+ {
237
+ id: 'install-actual',
238
+ title: 'Install Helm Release',
239
+ description: 'Actually deploy the chart to the cluster',
240
+ command:
241
+ 'nimbus apply helm --release my-webapp --chart charts/my-webapp --namespace demo --create-namespace',
242
+ showOutput: true,
243
+ waitForInput: true,
244
+ mockResponse: `
245
+ Installing Helm release...
246
+
247
+ NAME: my-webapp
248
+ NAMESPACE: demo
249
+ STATUS: deployed
250
+ REVISION: 1
251
+
252
+ Resources:
253
+ ✓ ConfigMap/my-webapp-config created
254
+ ✓ Service/my-webapp created
255
+ ✓ Deployment/my-webapp created
256
+ ✓ HorizontalPodAutoscaler/my-webapp created
257
+
258
+ Waiting for deployment...
259
+ Pods: 2/2 ready
260
+
261
+ NOTES:
262
+ Thank you for installing my-webapp!
263
+
264
+ To access the application:
265
+ kubectl port-forward svc/my-webapp 8080:80 -n demo
266
+ Then visit: http://localhost:8080
267
+
268
+ Installation complete!
269
+ `.trim(),
270
+ },
271
+ {
272
+ id: 'list-releases',
273
+ title: 'List Helm Releases',
274
+ description: 'View all deployed Helm releases',
275
+ command: 'nimbus helm list --namespace demo',
276
+ showOutput: true,
277
+ waitForInput: true,
278
+ mockResponse: `
279
+ NAME NAMESPACE REVISION STATUS CHART APP VERSION
280
+ my-webapp demo 1 deployed my-webapp-0.1.0 1.0.0
281
+ `.trim(),
282
+ },
283
+ {
284
+ id: 'upgrade-release',
285
+ title: 'Upgrade Release',
286
+ description: 'Upgrade the release with new values',
287
+ command:
288
+ 'nimbus helm upgrade my-webapp charts/my-webapp --namespace demo --set replicaCount=3',
289
+ showOutput: true,
290
+ waitForInput: true,
291
+ mockResponse: `
292
+ Upgrading Helm release...
293
+
294
+ Release "my-webapp" has been upgraded.
295
+ REVISION: 2
296
+
297
+ Changes:
298
+ - replicaCount: 2 -> 3
299
+
300
+ Waiting for rollout...
301
+ Deployment updated: 3/3 replicas ready
302
+
303
+ Upgrade complete!
304
+ `.trim(),
305
+ },
306
+ {
307
+ id: 'history',
308
+ title: 'View Release History',
309
+ description: 'See the revision history of the release',
310
+ command: 'nimbus helm history my-webapp --namespace demo',
311
+ showOutput: true,
312
+ waitForInput: true,
313
+ mockResponse: `
314
+ REVISION STATUS DESCRIPTION
315
+ 1 superseded Install complete
316
+ 2 deployed Upgrade complete
317
+ `.trim(),
318
+ },
319
+ {
320
+ id: 'cleanup',
321
+ title: 'Uninstall Release',
322
+ description: 'Remove the Helm release (optional)',
323
+ command: 'nimbus helm uninstall my-webapp --namespace demo',
324
+ showOutput: true,
325
+ waitForInput: false,
326
+ mockResponse: `
327
+ Uninstalling release...
328
+
329
+ release "my-webapp" uninstalled
330
+
331
+ All resources removed:
332
+ - ConfigMap/my-webapp-config
333
+ - Service/my-webapp
334
+ - Deployment/my-webapp
335
+ - HorizontalPodAutoscaler/my-webapp
336
+
337
+ Cleanup complete!
338
+ `.trim(),
339
+ },
340
+ ],
341
+ };
@@ -0,0 +1,194 @@
1
+ /**
2
+ * Kubernetes Deployment Demo Scenario
3
+ *
4
+ * Demonstrates deploying an application to Kubernetes
5
+ */
6
+
7
+ import type { DemoScenario } from '../types';
8
+
9
+ export const k8sDeploymentScenario: DemoScenario = {
10
+ id: 'k8s-deployment',
11
+ name: 'Deploy to Kubernetes',
12
+ description: 'Learn how to generate and deploy Kubernetes manifests',
13
+ category: 'kubernetes',
14
+ duration: 10,
15
+ prerequisites: ['kubectl configured with cluster access', 'Nimbus CLI installed'],
16
+ tags: ['kubernetes', 'k8s', 'deployment', 'manifests'],
17
+ steps: [
18
+ {
19
+ id: 'check-cluster',
20
+ title: 'Verify Cluster Connection',
21
+ description: 'Check that kubectl can connect to your cluster',
22
+ command: 'nimbus k8s get nodes',
23
+ showOutput: true,
24
+ waitForInput: true,
25
+ mockResponse: `
26
+ NAME STATUS ROLES AGE VERSION
27
+ node-1 Ready control-plane 30d v1.28.0
28
+ node-2 Ready <none> 30d v1.28.0
29
+ node-3 Ready <none> 30d v1.28.0
30
+ `.trim(),
31
+ },
32
+ {
33
+ id: 'generate-manifests',
34
+ title: 'Generate Kubernetes Manifests',
35
+ description: 'Use Nimbus to generate deployment manifests for an nginx application',
36
+ command:
37
+ 'nimbus generate k8s --type deployment --image nginx:latest --replicas 3 --port 80 --output ./k8s-demo',
38
+ showOutput: true,
39
+ waitForInput: true,
40
+ mockResponse: `
41
+ Generating Kubernetes manifests...
42
+
43
+ Created files:
44
+ k8s-demo/
45
+ ├── deployment.yaml # Deployment with 3 replicas
46
+ ├── service.yaml # ClusterIP service on port 80
47
+ └── kustomization.yaml # Kustomize configuration
48
+
49
+ Configuration:
50
+ Image: nginx:latest
51
+ Replicas: 3
52
+ Port: 80
53
+ Service: ClusterIP
54
+
55
+ Generated successfully!
56
+ `.trim(),
57
+ },
58
+ {
59
+ id: 'review-deployment',
60
+ title: 'Review Deployment Manifest',
61
+ description: 'Examine the generated deployment configuration',
62
+ command: 'nimbus explain k8s k8s-demo/deployment.yaml',
63
+ showOutput: true,
64
+ waitForInput: true,
65
+ mockResponse: `
66
+ File: k8s-demo/deployment.yaml
67
+
68
+ This Kubernetes Deployment defines:
69
+
70
+ 1. Metadata
71
+ - Name: nginx
72
+ - Labels: app=nginx
73
+
74
+ 2. Pod Spec
75
+ - Replicas: 3
76
+ - Container: nginx:latest
77
+ - Port: 80 (HTTP)
78
+
79
+ 3. Resource Limits
80
+ - CPU: 100m request, 500m limit
81
+ - Memory: 128Mi request, 256Mi limit
82
+
83
+ 4. Health Checks
84
+ - Liveness probe: HTTP GET /
85
+ - Readiness probe: HTTP GET /
86
+
87
+ 5. Update Strategy
88
+ - RollingUpdate
89
+ - maxUnavailable: 1
90
+ - maxSurge: 1
91
+
92
+ This is a production-ready deployment with proper
93
+ resource management and health monitoring.
94
+ `.trim(),
95
+ },
96
+ {
97
+ id: 'preview-apply',
98
+ title: 'Preview Apply (Dry Run)',
99
+ description: 'See what would be created without actually applying',
100
+ command: 'nimbus apply k8s --path ./k8s-demo --dry-run',
101
+ showOutput: true,
102
+ waitForInput: true,
103
+ mockResponse: `
104
+ Dry Run - Kubernetes Apply
105
+
106
+ Resources to create:
107
+ ✓ deployment/nginx (3 replicas)
108
+ ✓ service/nginx (ClusterIP:80)
109
+
110
+ Resource Summary:
111
+ Deployments: 1
112
+ Services: 1
113
+ ConfigMaps: 0
114
+ Secrets: 0
115
+
116
+ No changes will be applied (dry run mode)
117
+ `.trim(),
118
+ },
119
+ {
120
+ id: 'apply-manifests',
121
+ title: 'Apply to Cluster',
122
+ description: 'Deploy the application to your Kubernetes cluster',
123
+ command: 'nimbus apply k8s --path ./k8s-demo --namespace demo',
124
+ showOutput: true,
125
+ waitForInput: true,
126
+ mockResponse: `
127
+ Applying Kubernetes manifests...
128
+
129
+ namespace/demo created
130
+ deployment.apps/nginx created
131
+ service/nginx created
132
+
133
+ Waiting for deployment to be ready...
134
+ Replicas: 3/3 ready
135
+ Conditions: Available, Progressing
136
+
137
+ Deployment successful!
138
+
139
+ To access the application:
140
+ kubectl port-forward svc/nginx 8080:80 -n demo
141
+ Then visit: http://localhost:8080
142
+ `.trim(),
143
+ },
144
+ {
145
+ id: 'check-status',
146
+ title: 'Check Deployment Status',
147
+ description: 'Verify the deployment is running correctly',
148
+ command: 'nimbus k8s get pods --namespace demo',
149
+ showOutput: true,
150
+ waitForInput: true,
151
+ mockResponse: `
152
+ NAME READY STATUS RESTARTS AGE
153
+ nginx-5d4f8b7c9d-abc12 1/1 Running 0 30s
154
+ nginx-5d4f8b7c9d-def34 1/1 Running 0 30s
155
+ nginx-5d4f8b7c9d-ghi56 1/1 Running 0 30s
156
+ `.trim(),
157
+ },
158
+ {
159
+ id: 'scale-deployment',
160
+ title: 'Scale the Deployment',
161
+ description: 'Increase replicas to handle more traffic',
162
+ command: 'nimbus k8s scale deployment/nginx --replicas=5 --namespace demo',
163
+ showOutput: true,
164
+ waitForInput: true,
165
+ mockResponse: `
166
+ deployment.apps/nginx scaled
167
+
168
+ Scaling deployment from 3 to 5 replicas...
169
+
170
+ Current status:
171
+ Ready: 5/5 replicas
172
+
173
+ Scaling complete!
174
+ `.trim(),
175
+ },
176
+ {
177
+ id: 'cleanup',
178
+ title: 'Clean Up Resources',
179
+ description: 'Remove the demo deployment (optional)',
180
+ command: 'nimbus k8s delete --path ./k8s-demo --namespace demo',
181
+ showOutput: true,
182
+ waitForInput: false,
183
+ mockResponse: `
184
+ Deleting Kubernetes resources...
185
+
186
+ deployment.apps/nginx deleted
187
+ service/nginx deleted
188
+ namespace/demo deleted
189
+
190
+ Cleanup complete!
191
+ `.trim(),
192
+ },
193
+ ],
194
+ };
@@ -0,0 +1,170 @@
1
+ /**
2
+ * Terraform VPC Demo Scenario
3
+ *
4
+ * Demonstrates creating a VPC with Terraform
5
+ */
6
+
7
+ import type { DemoScenario } from '../types';
8
+
9
+ export const terraformVpcScenario: DemoScenario = {
10
+ id: 'terraform-vpc',
11
+ name: 'Create AWS VPC with Terraform',
12
+ description: 'Deploy a complete VPC infrastructure using Nimbus and Terraform',
13
+ category: 'terraform',
14
+ duration: 10,
15
+ prerequisites: [
16
+ 'AWS CLI configured with credentials',
17
+ 'Terraform installed (v1.0+)',
18
+ 'Nimbus CLI installed',
19
+ ],
20
+ tags: ['terraform', 'aws', 'vpc', 'networking'],
21
+ steps: [
22
+ {
23
+ id: 'init-project',
24
+ title: 'Initialize Nimbus Project',
25
+ description: 'Scan the current directory and set up Nimbus configuration',
26
+ command: 'nimbus init',
27
+ showOutput: true,
28
+ waitForInput: true,
29
+ mockResponse: `
30
+ Nimbus Initialization
31
+
32
+ Scanning project...
33
+
34
+ Project Summary:
35
+ Type: infrastructure
36
+ Languages: HCL
37
+ IaC Tools: Terraform
38
+ Cloud: AWS
39
+
40
+ Created .nimbus/project.yaml
41
+ Created .nimbus/config.yaml
42
+
43
+ Project initialized successfully!
44
+ `.trim(),
45
+ },
46
+ {
47
+ id: 'start-questionnaire',
48
+ title: 'Start Terraform Questionnaire',
49
+ description: 'Use the interactive wizard to configure VPC settings',
50
+ command: 'nimbus questionnaire terraform',
51
+ showOutput: true,
52
+ waitForInput: true,
53
+ mockResponse: `
54
+ Terraform Configuration Wizard
55
+
56
+ Starting local questionnaire...
57
+
58
+ Step 1/3: Provider Configuration
59
+ Provider: aws
60
+ Region: us-east-1
61
+
62
+ Step 2/3: Component Selection
63
+ Components: vpc
64
+
65
+ Step 3/3: VPC Configuration
66
+ CIDR Block: 10.0.0.0/16
67
+ Availability Zones: 3
68
+
69
+ Questionnaire completed!
70
+ Generating code...
71
+
72
+ Generated files:
73
+ ● main.tf
74
+ ● variables.tf
75
+ ● outputs.tf
76
+
77
+ Output directory: ./terraform
78
+ `.trim(),
79
+ },
80
+ {
81
+ id: 'preview-plan',
82
+ title: 'Preview Terraform Plan',
83
+ description: 'See what changes will be made before applying',
84
+ command: 'nimbus preview terraform ./terraform',
85
+ showOutput: true,
86
+ waitForInput: true,
87
+ mockResponse: `
88
+ Preview Terraform Changes
89
+
90
+ Directory: ./terraform
91
+
92
+ Creating execution plan...
93
+ Plan created
94
+
95
+ Plan Summary:
96
+
97
+ + 6 to add
98
+ ~ 0 to change
99
+ - 0 to destroy
100
+
101
+ Safety Check Summary:
102
+
103
+ 🟡 [MEDIUM] This operation will modify infrastructure
104
+
105
+ All safety checks passed
106
+ `.trim(),
107
+ },
108
+ {
109
+ id: 'apply-terraform',
110
+ title: 'Apply Terraform Configuration',
111
+ description: 'Deploy the VPC infrastructure with safety approval',
112
+ command: 'nimbus apply terraform ./terraform',
113
+ showOutput: true,
114
+ waitForInput: true,
115
+ mockResponse: `
116
+ Terraform Apply
117
+
118
+ Directory: ./terraform
119
+
120
+ Creating execution plan...
121
+ Plan created
122
+
123
+ Plan Summary:
124
+ + 6 to add
125
+
126
+ ╔══════════════════════════════════════════════════════════╗
127
+ ║ APPROVAL REQUIRED ║
128
+ ╠══════════════════════════════════════════════════════════╣
129
+ ║ Operation: terraform apply ║
130
+ ╚══════════════════════════════════════════════════════════╝
131
+
132
+ Identified Risks:
133
+
134
+ 🟡 [MEDIUM] This operation will modify infrastructure
135
+
136
+ Do you want to proceed with this operation? Yes
137
+
138
+ Operation approved
139
+
140
+ Applying changes...
141
+ Apply complete!
142
+
143
+ Apply complete! Resources: 6 added, 0 changed, 0 destroyed.
144
+
145
+ Outputs:
146
+ vpc_id = "vpc-0abc123def456789"
147
+ private_subnets = ["subnet-001", "subnet-002", "subnet-003"]
148
+ public_subnets = ["subnet-101", "subnet-102", "subnet-103"]
149
+ `.trim(),
150
+ },
151
+ {
152
+ id: 'verify-vpc',
153
+ title: 'Verify VPC Creation',
154
+ description: 'List VPCs to confirm our new VPC was created',
155
+ command: 'nimbus aws vpc list',
156
+ showOutput: true,
157
+ waitForInput: false,
158
+ mockResponse: `
159
+ VPCs
160
+
161
+ Found 2 VPC(s)
162
+
163
+ VPC ID Name CIDR State Default
164
+ ─────────────────────────────────────────────────────────────────────
165
+ vpc-default default 172.31.0.0/16 available Yes
166
+ vpc-0abc123def456789 my-project 10.0.0.0/16 available No
167
+ `.trim(),
168
+ },
169
+ ],
170
+ };