"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.showHelp = void 0;
const ui_1 = require("../../utils/ui");
async function showHelp() {
    await (0, ui_1.initUI)();
    console.log('');
    console.log((0, ui_1.header)('Docker Deployment'));
    console.log('');
    console.log((0, ui_1.subheader)('Usage:'));
    console.log(`  ${(0, ui_1.color)('ccs docker', 'command')} <command> [options]`);
    console.log('');
    const sections = [
        [
            'Commands:',
            [
                ['up', 'Build and start the integrated CCS + CLIProxy stack'],
                ['down', 'Stop and remove the integrated stack'],
                ['status', 'Show docker compose and supervisor status'],
                ['update', 'Update CCS and CLIProxy inside the running container'],
                ['logs', 'Show or follow container log output'],
                ['config', 'Show bundled asset paths and deployment defaults'],
                ['show-key', 'Show the Docker CLIProxy API key masked by default'],
                ['finalize-key-rotation', 'End the legacy Docker API key grace period'],
            ],
        ],
        [
            'Common Options:',
            [
                ['--host <target>', 'Run command on a remote host over SSH (single target or SSH alias)'],
                ['--help, -h', 'Show this help message'],
            ],
        ],
        [
            'Per-Command Options:',
            [
                ['up --port <port>', 'Publish dashboard on a custom host port'],
                ['up --proxy-port <port>', 'Publish CLIProxy on a custom host port'],
                ['logs --follow', 'Stream logs continuously'],
                ['logs --service <name>', 'Filter logs to ccs or cliproxy'],
                ['show-key --full', 'Reveal the full Docker CLIProxy API key'],
            ],
        ],
        [
            'Examples:',
            [
                ['ccs docker up', 'Start the stack locally on ports 3000 and 8317'],
                ['ccs docker up --port 4000 --proxy-port 9317', 'Start locally with custom ports'],
                ['ccs docker --host my-box status', 'Use the documented common-option ordering'],
                ['ccs docker up --host my-box', 'Stage assets to ~/.ccs/docker and deploy remotely'],
                ['ccs docker logs --follow --service ccs', 'Tail dashboard logs only'],
                ['ccs docker show-key', 'Print the masked CLIProxy API key from the container'],
                ['ccs docker show-key --full', 'Reveal the full CLIProxy API key'],
                ['ccs docker finalize-key-rotation', 'Remove the legacy key immediately'],
                ['ccs docker update --host my-box', 'Update the running remote stack in place'],
            ],
        ],
    ];
    for (const [title, rows] of sections) {
        console.log((0, ui_1.subheader)(title));
        const width = Math.max(...rows.map(([command]) => command.length));
        for (const [command, description] of rows) {
            console.log(`  ${(0, ui_1.color)(command.padEnd(width + 2), 'command')} ${description}`);
        }
        console.log('');
    }
    console.log((0, ui_1.dim)('  Remote deployments use ~/.ccs/docker on the target host to avoid root-only paths.'));
    console.log('');
}
exports.showHelp = showHelp;
//# sourceMappingURL=help-subcommand.js.map