UNPKG

@morodomi/ait3

Version:

AIT³ Development Platform - AI + Ticket + Test + Tool driven development methodology

42 lines (41 loc) 1.76 kB
#!/usr/bin/env node import { Command } from 'commander'; import { readFile } from 'fs/promises'; import { join, dirname } from 'path'; import { fileURLToPath } from 'url'; import { ticketCommand } from './commands/ticket/index.js'; import { flowCommand } from './commands/flow/index.js'; import { installCommand } from './commands/install/index.js'; import { analyzeCommand } from './commands/analyze/index.js'; import { initCommandGroup } from './commands/init/index.cli.js'; import { migrateCommandGroup } from './commands/migrate/index.cli.js'; import { createSetupCommand } from './commands/setup/index.js'; import { createServiceContainer } from './common/service-container.js'; const __dirname = dirname(fileURLToPath(import.meta.url)); const packageJsonPath = join(__dirname, '..', 'package.json'); const packageJson = JSON.parse(await readFile(packageJsonPath, 'utf-8')); const program = new Command(); program .name('ait3') .description('AIT³ Development Platform - AI + Ticket + Test + Tool driven development') .version(packageJson.version); // Initialize CLI asynchronously async function initializeCLI() { // Create services const services = await createServiceContainer({ cwd: process.cwd() }); // Add command groups program.addCommand(ticketCommand); program.addCommand(flowCommand); program.addCommand(installCommand); program.addCommand(analyzeCommand); program.addCommand(initCommandGroup); program.addCommand(migrateCommandGroup); program.addCommand(createSetupCommand(services)); // Future command groups will be added here: program.parse(); } // Start the CLI initializeCLI().catch((error) => { console.error('Failed to initialize CLI:', error); process.exit(1); });