From 481b351ec823e89ffa59ec9acb0e9878d2dc266a Mon Sep 17 00:00:00 2001 From: Jason Woltje Date: Sat, 14 Mar 2026 20:04:57 -0500 Subject: [PATCH] feat(cli): add prdy, quality-rails, and wizard subcommands Wires @mosaic/prdy, @mosaic/quality-rails, and @mosaic/mosaic into the unified CLI binary. The wizard subcommand uses dynamic import to avoid loading heavy wizard deps for other commands. Adds @types/node to cli devDependencies and guards @mosaic/mosaic index.ts program.parse() so the module is safely importable without auto-executing. Co-Authored-By: Claude Sonnet 4.6 --- packages/cli/package.json | 4 ++ packages/cli/src/cli.ts | 83 ++++++++++++++++++++++++++++++++++++ packages/mosaic/src/index.ts | 15 ++++++- pnpm-lock.yaml | 12 ++++++ 4 files changed, 112 insertions(+), 2 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 88d51dd..3883023 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -21,6 +21,9 @@ "test": "vitest run --passWithNoTests" }, "dependencies": { + "@mosaic/mosaic": "workspace:^", + "@mosaic/prdy": "workspace:^", + "@mosaic/quality-rails": "workspace:^", "ink": "^5.0.0", "ink-text-input": "^6.0.0", "ink-spinner": "^5.0.0", @@ -29,6 +32,7 @@ "commander": "^13.0.0" }, "devDependencies": { + "@types/node": "^22.0.0", "@types/react": "^18.3.0", "tsx": "^4.0.0", "typescript": "^5.8.0", diff --git a/packages/cli/src/cli.ts b/packages/cli/src/cli.ts index 44ec431..2833cf8 100644 --- a/packages/cli/src/cli.ts +++ b/packages/cli/src/cli.ts @@ -1,6 +1,8 @@ #!/usr/bin/env node import { Command } from 'commander'; +import { buildPrdyCli } from '@mosaic/prdy'; +import { createQualityRailsCli } from '@mosaic/quality-rails'; const program = new Command(); @@ -25,4 +27,85 @@ program ); }); +// prdy subcommand +// buildPrdyCli() returns a wrapper Command; extract the 'prdy' subcommand from it. +// Type cast is required because @mosaic/prdy uses commander@12 while @mosaic/cli uses commander@13. +const prdyWrapper = buildPrdyCli(); +const prdyCmd = prdyWrapper.commands.find((c) => c.name() === 'prdy'); +if (prdyCmd !== undefined) { + program.addCommand(prdyCmd as unknown as Command); +} + +// quality-rails subcommand +// createQualityRailsCli() returns a wrapper Command; extract the 'quality-rails' subcommand. +const qrWrapper = createQualityRailsCli(); +const qrCmd = qrWrapper.commands.find((c) => c.name() === 'quality-rails'); +if (qrCmd !== undefined) { + program.addCommand(qrCmd as unknown as Command); +} + +// wizard subcommand — wraps @mosaic/mosaic installation wizard +program + .command('wizard') + .description('Run the Mosaic installation wizard') + .option('--non-interactive', 'Run without prompts (uses defaults + flags)') + .option('--source-dir ', 'Source directory for framework files') + .option('--mosaic-home ', 'Target config directory') + .option('--name ', 'Agent name') + .option('--role ', 'Agent role description') + .option('--style