#!/usr/bin/env node
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const login_js_1 = require("./commands/login.js");
const clone_js_1 = require("./commands/clone.js");
const install_mcp_js_1 = require("./commands/install-mcp.js");
const install_mcp_all_js_1 = require("./commands/install-mcp-all.js");
const install_skills_js_1 = require("./commands/install-skills.js");
const license_js_1 = require("./commands/license.js");
const args = process.argv.slice(2);
const command = args[0];
async function main() {
    console.log('🚀 Craft CLI v1.0.3\n');
    switch (command) {
        case 'login':
            await (0, login_js_1.loginCommand)(args[1]);
            break;
        case 'logout':
            await (0, login_js_1.logoutCommand)();
            break;
        case 'new':
            await (0, clone_js_1.cloneCommand)();
            break;
        case 'setup':
            await handleSetup(args[1]);
            break;
        case 'license':
            await handleLicense(args[1]);
            break;
        case 'version':
        case '--version':
        case '-v':
            console.log('v1.0.3');
            break;
        case 'help':
        case '--help':
        case '-h':
        case undefined:
            showHelp();
            break;
        default:
            console.error(`❌ Unknown command: ${command}`);
            console.log('Run "craft help" for usage information.\n');
            process.exit(1);
    }
}
async function handleSetup(target) {
    switch (target) {
        case 'ai':
            await (0, install_mcp_all_js_1.installMcpAllCommand)();
            await (0, install_skills_js_1.installSkillsCommand)();
            break;
        case 'mcp':
            await (0, install_mcp_js_1.installMcpCommand)();
            break;
        case 'skills':
            await (0, install_skills_js_1.installSkillsCommand)();
            break;
        case undefined:
            console.log('Setup AI tooling for Craft\n');
            console.log('Available commands:');
            console.log('  craft setup ai      Setup everything (MCP servers + Skills)');
            console.log('  craft setup mcp     Setup MCP servers only');
            console.log('  craft setup skills  Setup Claude Code Skills only\n');
            break;
        default:
            console.error(`❌ Unknown setup target: ${target}`);
            console.log('Available targets: ai, mcp, skills');
    }
}
async function handleLicense(subcommand) {
    switch (subcommand) {
        case 'status':
        case undefined:
            await (0, license_js_1.statusCommand)();
            break;
        case 'activate':
            await (0, license_js_1.activateCommand)();
            break;
        case 'deactivate':
            await (0, license_js_1.deactivateCommand)();
            break;
        default:
            console.error(`❌ Unknown license command: ${subcommand}`);
            console.log('Available commands: status, activate, deactivate');
    }
}
function showHelp() {
    console.log('Usage: craft <command> [options]\n');
    console.log('Commands:');
    console.log('  new                      Create a new Craft project (free template, no login)');
    console.log('  login <license_key>      Activate your Pro license');
    console.log('  logout                   Remove stored license');
    console.log('  setup [ai|mcp|skills]    Setup AI tooling');
    console.log('  license [cmd]            Manage license (status, activate, deactivate)');
    console.log('  help                     Show this help message\n');
    console.log('License Tiers:');
    console.log('  🆓 Community (Free)  - Rapid Web (no login required)');
    console.log('  💎 Pro ($149)        - All levels, Web + Mobile');
    console.log('  🏢 Enterprise        - Custom pricing, custom features\n');
    console.log('Starter Kits:');
    console.log('  🚀 Rapid (Web / Web+Mobile)       - Ship fast, 1-2 devs');
    console.log('  ⚖️  Balanced (Web / Web+Mobile)    - Pragmatic quality, 3-10 devs');
    console.log('  🏆 Crafted (Web / Web+Mobile)     - Software craftsmanship, 10-200+ devs\n');
    console.log('Setup targets:');
    console.log('  ai         Setup MCP servers + Skills');
    console.log('  mcp        Setup MCP servers only');
    console.log('  skills     Setup Skills only\n');
    console.log('Examples:');
    console.log('  craft new');
    console.log('  craft login craft_abc123...');
    console.log('  craft license activate');
    console.log('  craft license status');
    console.log('  craft setup ai\n');
    console.log('Get started: https://getcraft.dev');
    console.log('Upgrade to Pro: https://getcraft.dev/pricing\n');
}
main().catch((error) => {
    console.error('❌ Error:', error.message);
    process.exit(1);
});
//# sourceMappingURL=index.js.map