"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.listCommand = listCommand;
const chalk_1 = __importDefault(require("chalk"));
const registry_1 = require("../utils/registry");
async function listCommand() {
    try {
        const components = await (0, registry_1.getComponentList)();
        if (components.length === 0) {
            console.log(chalk_1.default.yellow('No components available.'));
            return;
        }
        console.log(chalk_1.default.blue.bold('\n📦 Available Components:\n'));
        components.forEach((component) => {
            console.log(chalk_1.default.green(`• ${component.name}`));
            console.log(chalk_1.default.gray(`  Files: ${component.files.length}`));
            if (component.dependencies.length > 0) {
                console.log(chalk_1.default.gray(`  Dependencies: ${component.dependencies.join(', ')}`));
            }
            if (component.internalDependencies.length > 0) {
                console.log(chalk_1.default.gray(`  Internal deps: ${component.internalDependencies.join(', ')}`));
            }
            console.log('');
        });
        console.log(chalk_1.default.blue('Usage:'));
        console.log(chalk_1.default.gray('  npx @cloudwick-formick/cli add <component-name>'));
        console.log(chalk_1.default.gray('  Example: npx @cloudwick-formick/cli add form-builder\n'));
    }
    catch (error) {
        console.error(chalk_1.default.red('Error fetching components:'), error);
        process.exit(1);
    }
}
//# sourceMappingURL=list.js.map