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