@stackweld/cli 0.2.1 → 0.2.3

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 (3) hide show
  1. package/LICENSE +21 -0
  2. package/dist/index.js +458 -72
  3. package/package.json +23 -15
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025-2026 Orlando Fernandez / XPlus Technologies LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
  /**
3
3
  * Stackweld CLI — The operating system for your dev stacks.
4
4
  */
5
+ import { input, select, Separator } from "@inquirer/prompts";
5
6
  import chalk from "chalk";
6
7
  import { Command } from "commander";
7
8
  import { aiCommand } from "./commands/ai.js";
@@ -40,9 +41,7 @@ import { statusCommand } from "./commands/status.js";
40
41
  import { templateCommand } from "./commands/template.js";
41
42
  import { upCommand } from "./commands/up.js";
42
43
  import { versionCommand } from "./commands/version-cmd.js";
43
- import { banner } from "./ui/format.js";
44
- // Read version from package.json at build time; fallback for development
45
- const VERSION = "0.2.0";
44
+ const VERSION = "0.2.3";
46
45
  const program = new Command();
47
46
  program
48
47
  .name("stackweld")
@@ -85,76 +84,463 @@ program
85
84
  .addCommand(costCommand)
86
85
  .addCommand(pluginCommand)
87
86
  .addCommand(versionCommand);
88
- // Show banner when run without arguments
87
+ // ─── Helpers ──────────────────────────────────────────────
88
+ function isExitSignal(err) {
89
+ if (!err || typeof err !== "object")
90
+ return false;
91
+ const e = err;
92
+ return (e.name === "ExitPromptError" ||
93
+ e.code === "ERR_USE_AFTER_CLOSE");
94
+ }
95
+ async function pressEnterToContinue() {
96
+ await input({ message: chalk.dim("Press Enter to continue...") });
97
+ }
98
+ async function run(args) {
99
+ try {
100
+ await program.parseAsync(["node", "stackweld", ...args]);
101
+ }
102
+ catch (err) {
103
+ const code = err?.code;
104
+ if (code === "commander.helpDisplayed" || code === "commander.version")
105
+ return;
106
+ if (code === "commander.missingMandatoryOptionValue" || code === "commander.missingArgument") {
107
+ return;
108
+ }
109
+ throw err;
110
+ }
111
+ }
112
+ // ─── ASCII Art Logo ──────────────────────────────────────
113
+ function printLogo() {
114
+ const g = chalk.hex("#FFD700"); // gold
115
+ const c = chalk.hex("#00E3FD"); // cyan
116
+ const m = chalk.hex("#FF51FA"); // magenta
117
+ const p = chalk.hex("#7C5CFC"); // purple/brand
118
+ const logo = [
119
+ "",
120
+ ` ${g("\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557")} ${g("\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557")} ${g("\u2588\u2588\u2588\u2588\u2588\u2557")} ${c("\u2588\u2588\u2588\u2588\u2588\u2588\u2557")} ${c("\u2588\u2588\u2557 \u2588\u2588\u2557")} ${c("\u2588\u2588\u2557")} ${m("\u2588\u2588\u2557")} ${m("\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557")} ${m("\u2588\u2588\u2557")} ${m("\u2588\u2588\u2588\u2588\u2588\u2588\u2557 ")}`,
121
+ ` ${g("\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D")} ${g("\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D")} ${g("\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557")} ${c("\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D")} ${c("\u2588\u2588\u2551 \u2588\u2588\u2554\u255D")} ${c("\u2588\u2588\u2551")} ${m("\u2588\u2588\u2551")} ${m("\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D")} ${m("\u2588\u2588\u2551")} ${m("\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557")}`,
122
+ ` ${g("\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557")} ${g("\u2588\u2588\u2551")} ${g("\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551")} ${c("\u2588\u2588\u2551")} ${c("\u2588\u2588\u2588\u2588\u2588\u2554\u255D")} ${c("\u2588\u2588\u2551")} ${c("\u2588\u2588\u2557")} ${m("\u2588\u2588\u2551")} ${m("\u2588\u2588\u2588\u2588\u2588\u2557")} ${m("\u2588\u2588\u2551")} ${m("\u2588\u2588\u2551 \u2588\u2588\u2551")}`,
123
+ ` ${g("\u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551")} ${g("\u2588\u2588\u2551")} ${g("\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551")} ${c("\u2588\u2588\u2551")} ${c("\u2588\u2588\u2554\u2550\u2588\u2588\u2557")} ${c("\u2588\u2588\u2551")} ${c("\u2588\u2588\u2588\u2557")}${m("\u2588\u2588\u2551")} ${m("\u2588\u2588\u2554\u2550\u2550\u255D")} ${m("\u2588\u2588\u2551")} ${m("\u2588\u2588\u2551 \u2588\u2588\u2551")}`,
124
+ ` ${g("\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551")} ${g("\u2588\u2588\u2551")} ${g("\u2588\u2588\u2551 \u2588\u2588\u2551")} ${c("\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2557")} ${c("\u2588\u2588\u2551 \u2588\u2588\u2557")} ${c("\u255A\u2588\u2588\u2588\u2554\u2588\u2588\u2588\u2554\u255D")} ${m("\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557")} ${m("\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557")} ${m("\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D")}`,
125
+ ` ${g("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D")} ${g("\u255A\u2550\u255D")} ${g("\u255A\u2550\u255D \u255A\u2550\u255D")} ${c("\u255A\u2550\u2550\u2550\u2550\u2550\u255D")} ${c("\u255A\u2550\u255D \u255A\u2550\u255D")} ${c("\u255A\u2550\u2550\u255D\u255A\u2550\u2550\u255D")} ${m("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D")} ${m("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D")} ${m("\u255A\u2550\u2550\u2550\u2550\u2550\u255D")} `,
126
+ "",
127
+ ` ${p.bold("The Developer's Forge")} ${chalk.dim(`v${VERSION}`)}`,
128
+ ` ${chalk.dim("github.com/mundowise/Stackweld")}`,
129
+ "",
130
+ ];
131
+ for (const line of logo) {
132
+ console.log(line);
133
+ }
134
+ }
135
+ // ─── Command List ────────────────────────────────────────
136
+ function printCommandList() {
137
+ const b = chalk.hex("#7C5CFC").bold;
138
+ const d = chalk.dim;
139
+ const w = chalk.white;
140
+ const categories = [
141
+ {
142
+ name: "Project Setup",
143
+ commands: [
144
+ ["init", "Create a new project interactively"],
145
+ ["create", "Create a stack definition from options"],
146
+ ["generate", "Generate docker-compose & configs"],
147
+ ["scaffold", "Scaffold project files from a stack"],
148
+ ["template", "Manage & apply stack templates"],
149
+ ],
150
+ },
151
+ {
152
+ name: "Stack Management",
153
+ commands: [
154
+ ["list", "List all saved stacks"],
155
+ ["info", "Show stack or technology details"],
156
+ ["save", "Save current stack definition"],
157
+ ["delete", "Delete a saved stack"],
158
+ ["clone", "Clone an existing stack"],
159
+ ["export", "Export stack to a file"],
160
+ ["import", "Import stack from a file"],
161
+ ["share", "Share stack via URL"],
162
+ ["import-url", "Import stack from a shared URL"],
163
+ ["compare", "Compare two stacks side-by-side"],
164
+ ],
165
+ },
166
+ {
167
+ name: "Runtime & Services",
168
+ commands: [
169
+ ["up", "Start stack services (docker-compose up)"],
170
+ ["down", "Stop stack services"],
171
+ ["status", "Show running service status"],
172
+ ["logs", "View service logs"],
173
+ ["health", "Run health checks on services"],
174
+ ["env", "Manage environment variables"],
175
+ ],
176
+ },
177
+ {
178
+ name: "Analysis & Intelligence",
179
+ commands: [
180
+ ["browse", "Browse available technologies"],
181
+ ["analyze", "Analyze an existing project"],
182
+ ["score", "Score compatibility between technologies"],
183
+ ["learn", "Learn about a technology in depth"],
184
+ ["migrate", "Get migration guide between technologies"],
185
+ ["cost", "Estimate hosting costs for a stack"],
186
+ ["benchmark", "Profile performance characteristics"],
187
+ ["doctor", "Check system prerequisites"],
188
+ ["ai", "AI-powered stack recommendations"],
189
+ ],
190
+ },
191
+ {
192
+ name: "Tools & Settings",
193
+ commands: [
194
+ ["config", "View/set configuration preferences"],
195
+ ["completion", "Generate shell completions"],
196
+ ["deploy", "Generate deploy infrastructure"],
197
+ ["lint", "Lint stack against best practices"],
198
+ ["preview", "Preview stack in browser"],
199
+ ["plugin", "Manage CLI plugins"],
200
+ ["version", "Show detailed version info"],
201
+ ],
202
+ },
203
+ ];
204
+ console.log(`\n ${b("Available Commands")}\n`);
205
+ for (const cat of categories) {
206
+ console.log(` ${chalk.yellow.bold(cat.name)}`);
207
+ for (const [cmd, desc] of cat.commands) {
208
+ console.log(` ${w(`stackweld ${cmd}`)} ${d(desc)}`);
209
+ }
210
+ console.log("");
211
+ }
212
+ console.log(` ${d("Run")} ${w("stackweld <command> --help")} ${d("for detailed usage.")}\n`);
213
+ }
214
+ // ─── Submenus ─────────────────────────────────────────────
215
+ async function stacksSubmenu() {
216
+ const action = await select({
217
+ message: "Manage saved stacks",
218
+ loop: false,
219
+ pageSize: 15,
220
+ choices: [
221
+ { name: "\uD83D\uDCCB List all stacks", value: "list" },
222
+ { name: "\uD83D\uDD0D Stack/tech info", value: "info" },
223
+ { name: "\uD83D\uDDD1\uFE0F Delete a stack", value: "delete" },
224
+ { name: "\uD83D\uDCC2 Clone a stack", value: "clone" },
225
+ { name: "\uD83D\uDCE4 Export a stack", value: "export" },
226
+ { name: "\uD83D\uDCE5 Import a stack", value: "import" },
227
+ { name: "\uD83D\uDD17 Share a stack (URL)", value: "share" },
228
+ { name: "\uD83D\uDD17 Import from URL", value: "import-url" },
229
+ { name: "\uD83D\uDD0D Compare two stacks", value: "compare" },
230
+ new Separator(),
231
+ { name: "\u2B05\uFE0F Back to main menu", value: "back" },
232
+ ],
233
+ });
234
+ if (action === "back")
235
+ return;
236
+ switch (action) {
237
+ case "list":
238
+ await run(["list"]);
239
+ break;
240
+ case "info": {
241
+ const id = await input({ message: "Stack or technology ID:" });
242
+ if (id.trim())
243
+ await run(["info", id.trim()]);
244
+ break;
245
+ }
246
+ case "delete": {
247
+ const id = await input({ message: "Stack ID to delete:" });
248
+ if (id.trim())
249
+ await run(["delete", id.trim()]);
250
+ break;
251
+ }
252
+ case "clone": {
253
+ const id = await input({ message: "Stack ID to clone:" });
254
+ if (id.trim())
255
+ await run(["clone", id.trim()]);
256
+ break;
257
+ }
258
+ case "export": {
259
+ const id = await input({ message: "Stack ID to export:" });
260
+ if (id.trim())
261
+ await run(["export", id.trim()]);
262
+ break;
263
+ }
264
+ case "import": {
265
+ const file = await input({ message: "File path to import:" });
266
+ if (file.trim())
267
+ await run(["import", file.trim()]);
268
+ break;
269
+ }
270
+ case "share": {
271
+ const id = await input({ message: "Stack ID to share:" });
272
+ if (id.trim())
273
+ await run(["share", id.trim()]);
274
+ break;
275
+ }
276
+ case "import-url": {
277
+ const url = await input({ message: "Share URL to import:" });
278
+ if (url.trim())
279
+ await run(["import-url", url.trim()]);
280
+ break;
281
+ }
282
+ case "compare": {
283
+ const a = await input({ message: "First stack ID:" });
284
+ const b = await input({ message: "Second stack ID:" });
285
+ if (a.trim() && b.trim())
286
+ await run(["compare", a.trim(), b.trim()]);
287
+ break;
288
+ }
289
+ }
290
+ }
291
+ async function runtimeSubmenu() {
292
+ const action = await select({
293
+ message: "Runtime & services",
294
+ loop: false,
295
+ pageSize: 10,
296
+ choices: [
297
+ { name: "\u25B6\uFE0F Start services (up)", value: "up" },
298
+ { name: "\u23F9\uFE0F Stop services (down)", value: "down" },
299
+ { name: "\uD83D\uDFE2 Service status", value: "status" },
300
+ { name: "\uD83D\uDCDC View logs", value: "logs" },
301
+ { name: "\uD83C\uDFE5 Health checks", value: "health" },
302
+ { name: "\uD83D\uDD10 Environment variables", value: "env" },
303
+ new Separator(),
304
+ { name: "\u2B05\uFE0F Back to main menu", value: "back" },
305
+ ],
306
+ });
307
+ if (action === "back")
308
+ return;
309
+ switch (action) {
310
+ case "up":
311
+ await run(["up"]);
312
+ break;
313
+ case "down":
314
+ await run(["down"]);
315
+ break;
316
+ case "status":
317
+ await run(["status"]);
318
+ break;
319
+ case "logs":
320
+ await run(["logs"]);
321
+ break;
322
+ case "health":
323
+ await run(["health"]);
324
+ break;
325
+ case "env":
326
+ await run(["env"]);
327
+ break;
328
+ }
329
+ }
330
+ async function settingsSubmenu() {
331
+ const action = await select({
332
+ message: "Settings & tools",
333
+ loop: false,
334
+ pageSize: 10,
335
+ choices: [
336
+ { name: "\u2699\uFE0F Configuration preferences", value: "config" },
337
+ { name: "\uD83D\uDCDD Shell completions (bash/zsh/fish)", value: "completion" },
338
+ { name: "\uD83D\uDD0C Manage plugins", value: "plugins" },
339
+ { name: "\uD83D\uDE80 Generate deploy infrastructure", value: "deploy" },
340
+ { name: "\uD83D\uDCCF Lint stack against standards", value: "lint" },
341
+ { name: "\uD83D\uDD0D Preview stack in browser", value: "preview" },
342
+ new Separator(),
343
+ { name: "\u2B05\uFE0F Back to main menu", value: "back" },
344
+ ],
345
+ });
346
+ if (action === "back")
347
+ return;
348
+ switch (action) {
349
+ case "config":
350
+ await run(["config", "list"]);
351
+ break;
352
+ case "completion": {
353
+ const shell = await select({
354
+ message: "Shell type:",
355
+ loop: false,
356
+ choices: [
357
+ { name: "bash", value: "bash" },
358
+ { name: "zsh", value: "zsh" },
359
+ { name: "fish", value: "fish" },
360
+ ],
361
+ });
362
+ await run(["completion", shell]);
363
+ break;
364
+ }
365
+ case "plugins":
366
+ await run(["plugin", "list"]);
367
+ break;
368
+ case "deploy": {
369
+ const id = await input({ message: "Stack ID to deploy:" });
370
+ if (id.trim())
371
+ await run(["deploy", id.trim()]);
372
+ break;
373
+ }
374
+ case "lint":
375
+ await run(["lint"]);
376
+ break;
377
+ case "preview":
378
+ await run(["preview"]);
379
+ break;
380
+ }
381
+ }
382
+ // ─── Interactive Menu ─────────────────────────────────────
383
+ async function interactiveMenu() {
384
+ program.exitOverride();
385
+ console.clear();
386
+ printLogo();
387
+ while (true) {
388
+ let choice;
389
+ try {
390
+ choice = await select({
391
+ message: "What would you like to do?",
392
+ loop: false,
393
+ pageSize: 20,
394
+ choices: [
395
+ { name: "\uD83D\uDE80 Create a new project", value: "init" },
396
+ { name: "\uD83D\uDCCB Browse technologies", value: "browse" },
397
+ { name: "\uD83D\uDD0D Analyze an existing project", value: "analyze" },
398
+ { name: "\uD83C\uDFE5 Check system health (doctor)", value: "doctor" },
399
+ { name: "\uD83D\uDCCA Score compatibility", value: "score" },
400
+ { name: "\uD83D\uDCDA Learn about a technology", value: "learn" },
401
+ { name: "\uD83D\uDD04 Migrate between technologies", value: "migrate" },
402
+ { name: "\uD83D\uDCB0 Estimate hosting costs", value: "cost" },
403
+ { name: "\u26A1 Performance profile", value: "benchmark" },
404
+ { name: "\uD83E\uDD16 AI stack recommendations", value: "ai" },
405
+ new Separator(),
406
+ { name: "\uD83D\uDCE6 Manage saved stacks", value: "stacks" },
407
+ { name: "\uD83D\uDDA5\uFE0F Runtime & services", value: "runtime" },
408
+ { name: "\u2699\uFE0F Settings & tools", value: "settings" },
409
+ new Separator(),
410
+ { name: "\uD83D\uDCD6 Show all commands", value: "commands" },
411
+ { name: "\u274C Exit", value: "exit" },
412
+ ],
413
+ });
414
+ }
415
+ catch (err) {
416
+ if (isExitSignal(err)) {
417
+ console.log(chalk.dim("\n Goodbye!\n"));
418
+ process.exit(0);
419
+ }
420
+ throw err;
421
+ }
422
+ if (choice === "exit") {
423
+ console.log(chalk.dim("\n Goodbye!\n"));
424
+ process.exit(0);
425
+ }
426
+ if (choice === "commands") {
427
+ printCommandList();
428
+ try {
429
+ await pressEnterToContinue();
430
+ }
431
+ catch (err) {
432
+ if (isExitSignal(err)) {
433
+ console.log(chalk.dim("\n Goodbye!\n"));
434
+ process.exit(0);
435
+ }
436
+ }
437
+ console.clear();
438
+ printLogo();
439
+ continue;
440
+ }
441
+ console.log("");
442
+ try {
443
+ switch (choice) {
444
+ case "init":
445
+ await run(["init"]);
446
+ break;
447
+ case "browse":
448
+ await run(["browse"]);
449
+ break;
450
+ case "analyze": {
451
+ const path = await input({ message: "Project path to analyze:", default: process.cwd() });
452
+ await run(["analyze", path]);
453
+ break;
454
+ }
455
+ case "doctor":
456
+ await run(["doctor"]);
457
+ break;
458
+ case "score": {
459
+ const techA = await input({ message: "First technology ID (e.g. react, nextjs):" });
460
+ const techB = await input({
461
+ message: "Second technology ID (optional, Enter to skip):",
462
+ });
463
+ const scoreArgs = ["score", techA.trim()];
464
+ if (techB.trim())
465
+ scoreArgs.push(techB.trim());
466
+ await run(scoreArgs);
467
+ break;
468
+ }
469
+ case "learn": {
470
+ const tech = await input({ message: "Technology ID (e.g. nextjs, react, docker):" });
471
+ if (tech.trim())
472
+ await run(["learn", tech.trim()]);
473
+ break;
474
+ }
475
+ case "migrate": {
476
+ const from = await input({ message: "Migrate FROM (technology ID):" });
477
+ const to = await input({ message: "Migrate TO (technology ID):" });
478
+ if (from.trim() && to.trim()) {
479
+ await run(["migrate", "--from", from.trim(), "--to", to.trim()]);
480
+ }
481
+ break;
482
+ }
483
+ case "cost": {
484
+ const stackId = await input({ message: "Stack ID to estimate costs:" });
485
+ if (stackId.trim())
486
+ await run(["cost", stackId.trim()]);
487
+ break;
488
+ }
489
+ case "benchmark": {
490
+ const stackId = await input({ message: "Stack ID to profile:" });
491
+ if (stackId.trim())
492
+ await run(["benchmark", stackId.trim()]);
493
+ break;
494
+ }
495
+ case "ai":
496
+ await run(["ai"]);
497
+ break;
498
+ case "stacks":
499
+ await stacksSubmenu();
500
+ break;
501
+ case "runtime":
502
+ await runtimeSubmenu();
503
+ break;
504
+ case "settings":
505
+ await settingsSubmenu();
506
+ break;
507
+ }
508
+ }
509
+ catch (err) {
510
+ if (isExitSignal(err)) {
511
+ console.log(chalk.dim("\n Goodbye!\n"));
512
+ process.exit(0);
513
+ }
514
+ console.error(chalk.red(`\n \u2716 ${err instanceof Error ? err.message : String(err)}\n`));
515
+ }
516
+ console.log("");
517
+ try {
518
+ await pressEnterToContinue();
519
+ }
520
+ catch (err) {
521
+ if (isExitSignal(err)) {
522
+ console.log(chalk.dim("\n Goodbye!\n"));
523
+ process.exit(0);
524
+ }
525
+ }
526
+ console.clear();
527
+ printLogo();
528
+ }
529
+ }
530
+ // ─── Entry Point ──────────────────────────────────────────
89
531
  if (process.argv.length <= 2) {
90
- console.log(banner(VERSION));
91
- console.log(chalk.bold(" Commands:"));
92
- console.log("");
93
- console.log(chalk.cyan(" Setup"));
94
- console.log(`${chalk.dim(" init ")}Create a new stack interactively`);
95
- console.log(`${chalk.dim(" generate ")}Scaffold a full project (one-shot)`);
96
- console.log(`${chalk.dim(" create ")}Scaffold from a stack or template`);
97
- console.log(`${chalk.dim(" doctor ")}Check system requirements`);
98
- console.log("");
99
- console.log(chalk.cyan(" Stacks"));
100
- console.log(`${chalk.dim(" list ")}List all saved stacks`);
101
- console.log(`${chalk.dim(" info <id> ")}Show stack or technology details`);
102
- console.log(`${chalk.dim(" browse ")}Browse technology catalog`);
103
- console.log(`${chalk.dim(" save ")}Save a version snapshot`);
104
- console.log(`${chalk.dim(" delete ")}Delete a saved stack`);
105
- console.log(`${chalk.dim(" clone ")}Duplicate a stack`);
106
- console.log(`${chalk.dim(" export/import ")}Export or import stack definitions`);
107
- console.log(`${chalk.dim(" share <id> ")}Generate a shareable URL for a stack`);
108
- console.log(`${chalk.dim(" import-url <url> ")}Import a stack from a share URL`);
109
- console.log(`${chalk.dim(" preview <id> ")}Preview docker-compose.yml for a stack`);
110
- console.log("");
111
- console.log(chalk.cyan(" Runtime"));
112
- console.log(`${chalk.dim(" up ")}Start Docker services`);
113
- console.log(`${chalk.dim(" down ")}Stop Docker services`);
114
- console.log(`${chalk.dim(" status ")}Show service status`);
115
- console.log(`${chalk.dim(" logs ")}Show service logs`);
116
- console.log("");
117
- console.log(chalk.cyan(" Analysis"));
118
- console.log(`${chalk.dim(" analyze [path] ")}Detect project stack automatically`);
119
- console.log(`${chalk.dim(" health [path] ")}Check project health and best practices`);
120
- console.log(`${chalk.dim(" compare <a> <b> ")}Compare two saved stacks`);
121
- console.log(`${chalk.dim(" env [sync|check]")} Sync .env files and check for issues`);
122
- console.log(`${chalk.dim(" score <a> [b] ")}Compatibility score between technologies`);
123
- console.log("");
124
- console.log(chalk.cyan(" Deploy & Standards"));
125
- console.log(`${chalk.dim(" deploy <id> ")}Generate infrastructure files (VPS/AWS/GCP)`);
126
- console.log(`${chalk.dim(" lint ")}Validate stack against team standards`);
127
- console.log(`${chalk.dim(" benchmark <id> ")}Show performance profile for a stack`);
128
- console.log(`${chalk.dim(" cost <id> ")}Estimate monthly hosting costs`);
129
- console.log("");
130
- console.log(chalk.cyan(" Plugins"));
131
- console.log(`${chalk.dim(" plugin list ")}List installed plugins`);
132
- console.log(`${chalk.dim(" plugin install ")}Install a plugin from local directory`);
133
- console.log(`${chalk.dim(" plugin remove ")}Remove an installed plugin`);
134
- console.log(`${chalk.dim(" plugin info ")}Show plugin details`);
135
- console.log("");
136
- console.log(chalk.cyan(" Migration & Learning"));
137
- console.log(`${chalk.dim(" migrate ")}Generate a migration plan between techs`);
138
- console.log(`${chalk.dim(" learn <tech> ")}Show learning resources for a technology`);
139
- console.log("");
140
- console.log(chalk.cyan(" Extras"));
141
- console.log(`${chalk.dim(" ai suggest ")}AI-powered stack suggestions`);
142
- console.log(`${chalk.dim(" template ")}Manage templates`);
143
- console.log(`${chalk.dim(" config ")}Manage preferences`);
144
- console.log(`${chalk.dim(" completion ")}Generate shell completions`);
145
- console.log("");
146
- console.log(chalk.dim(` Run ${chalk.white("stackweld <command> --help")} for detailed usage.`));
147
- console.log("");
148
- process.exit(0);
532
+ interactiveMenu().catch(() => process.exit(0));
149
533
  }
150
- program.parseAsync(process.argv).catch((err) => {
151
- if (err && err.code === "commander.unknownCommand") {
152
- const cmd = process.argv[2];
153
- console.error(chalk.red(`\u2716 Unknown command: "${cmd}"`));
154
- console.error(chalk.dim(` Run ${chalk.white("stackweld --help")} to see available commands.`));
534
+ else {
535
+ program.parseAsync(process.argv).catch((err) => {
536
+ if (err && err.code === "commander.unknownCommand") {
537
+ const cmd = process.argv[2];
538
+ console.error(chalk.red(`\u2716 Unknown command: "${cmd}"`));
539
+ console.error(chalk.dim(` Run ${chalk.white("stackweld --help")} to see available commands.`));
540
+ process.exit(1);
541
+ }
542
+ console.error(chalk.red(`\u2716 ${err instanceof Error ? err.message : String(err)}`));
155
543
  process.exit(1);
156
- }
157
- console.error(chalk.red(`\u2716 ${err instanceof Error ? err.message : String(err)}`));
158
- process.exit(1);
159
- });
544
+ });
545
+ }
160
546
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackweld/cli",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "The operating system for your dev stacks — define, validate, scaffold, and launch development environments from the terminal.",
5
5
  "license": "MIT",
6
6
  "author": "Orlando Fernandez <hello@xplustechnologies.com>",
@@ -10,7 +10,15 @@
10
10
  "url": "https://github.com/mundowise/Stackweld.git",
11
11
  "directory": "packages/cli"
12
12
  },
13
- "keywords": ["cli", "devtools", "scaffold", "stack", "docker", "developer-tools", "project-generator"],
13
+ "keywords": [
14
+ "cli",
15
+ "devtools",
16
+ "scaffold",
17
+ "stack",
18
+ "docker",
19
+ "developer-tools",
20
+ "project-generator"
21
+ ],
14
22
  "type": "module",
15
23
  "main": "./dist/index.js",
16
24
  "bin": {
@@ -25,28 +33,28 @@
25
33
  "engines": {
26
34
  "node": ">=22.0.0"
27
35
  },
28
- "scripts": {
29
- "build": "tsc -b",
30
- "dev": "tsc -b --watch",
31
- "test": "vitest run --passWithNoTests",
32
- "typecheck": "tsc --noEmit",
33
- "lint": "biome check src/",
34
- "clean": "rm -rf dist .turbo"
35
- },
36
36
  "dependencies": {
37
37
  "@anthropic-ai/sdk": "^0.80.0",
38
38
  "@inquirer/prompts": "^7.0.0",
39
- "@stackweld/core": "0.2.1",
40
- "@stackweld/registry": "0.2.1",
41
- "@stackweld/templates": "0.2.1",
42
39
  "chalk": "^5.4.0",
43
40
  "commander": "^13.0.0",
44
41
  "ora": "^8.0.0",
45
- "yaml": "^2.8.3"
42
+ "yaml": "^2.8.3",
43
+ "@stackweld/core": "0.2.1",
44
+ "@stackweld/registry": "0.2.1",
45
+ "@stackweld/templates": "0.2.1"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@biomejs/biome": "^2.0.0",
49
49
  "typescript": "^5.9.0",
50
50
  "vitest": "^4.1.2"
51
+ },
52
+ "scripts": {
53
+ "build": "tsc -b",
54
+ "dev": "tsc -b --watch",
55
+ "test": "vitest run --passWithNoTests",
56
+ "typecheck": "tsc --noEmit",
57
+ "lint": "biome check src/",
58
+ "clean": "rm -rf dist .turbo"
51
59
  }
52
- }
60
+ }