Download packages/cli/src/acp/commands/commandRegistry.ts from SaylorTwift/gemini-cli: direct link, hf CLI and curl.
- Browser
- Download file 779 Bytes
-
https://huggingface.co/SaylorTwift/gemini-cli/resolve/main/packages/cli/src/acp/commands/commandRegistry.ts
- Command line
-
hf download hf://SaylorTwift/gemini-cli/packages/cli/src/acp/commands/commandRegistry.ts
-
curl -L -o commandRegistry.ts https://huggingface.co/SaylorTwift/gemini-cli/resolve/main/packages/cli/src/acp/commands/commandRegistry.ts
779 Bytes
| /** | |
| * @license | |
| * Copyright 2026 Google LLC | |
| * SPDX-License-Identifier: Apache-2.0 | |
| */ | |
| import { debugLogger } from '@google/gemini-cli-core'; | |
| import type { Command } from './types.js'; | |
| export class CommandRegistry { | |
| private readonly commands = new Map<string, Command>(); | |
| register(command: 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: string): Command | undefined { | |
| return this.commands.get(commandName); | |
| } | |
| getAllCommands(): Command[] { | |
| return [...this.commands.values()]; | |
| } | |
| } | |