/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
import { debugLogger } from '@google/gemini-cli-core';
export class CommandRegistry {
    commands = new Map();
    register(command) {
        if (this.commands.has(command.name)) {
            debugLogger.warn(`Command ${command.name} already registered. Skipping.`);
            return;
        }
        this.commands.set(command.name, command);
        for (const subCommand of command.subCommands ?? []) {
            this.register(subCommand);
        }
    }
    get(commandName) {
        return this.commands.get(commandName);
    }
    getAllCommands() {
        return [...this.commands.values()];
    }
}
//# sourceMappingURL=commandRegistry.js.map