#!/usr/bin/env node
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const commander_1 = require("commander");
const chalk_1 = __importDefault(require("chalk"));
const add_1 = require("./commands/add");
const init_1 = require("./commands/init");
const list_1 = require("./commands/list");
const program = new commander_1.Command();
program
    .name('cloudwick-ui')
    .description('CLI for installing Cloudwick Form Builder components')
    .version('1.0.0');
program
    .command('init')
    .description('Initialize cloudwick-ui in your project')
    .option('-y, --yes', 'Skip confirmation prompts')
    .action(init_1.initCommand);
program
    .command('add')
    .description('Add components to your project')
    .argument('[components...]', 'Components to add')
    .option('-y, --yes', 'Skip confirmation prompts')
    .option('-o, --overwrite', 'Overwrite existing files')
    .option('-c, --cwd <cwd>', 'The working directory')
    .option('-p, --path <path>', 'The path to add the component to')
    .option('-d, --dry-run', 'Show what would be installed without actually installing')
    .action(add_1.addCommand);
program
    .command('list')
    .description('List all available components')
    .action(list_1.listCommand);
program
    .command('cleanup')
    .description('Clean up duplicate CSS imports in main entry file')
    .option('-c, --cwd <cwd>', 'The working directory')
    .action(async (options) => {
    try {
        const cwd = options.cwd || process.cwd();
        console.log(chalk_1.default.blue('🧹 Cleaning up duplicate CSS imports...'));
        await (0, init_1.cleanupDuplicateImports)(cwd);
    }
    catch (error) {
        console.error(chalk_1.default.red('❌ Failed to cleanup duplicates:'), error);
        process.exit(1);
    }
});
program.parse();
//# sourceMappingURL=index.js.map