Skip to main content
Glama
CommandRegistry.ts1.26 kB
import { CLIHandler } from './CLIHandler.js'; import { ScanCommand } from './commands/ScanCommand.js'; import { StartCommand } from './commands/StartCommand.js'; import { StatusCommand } from './commands/StatusCommand.js'; import { LogsCommand } from './commands/LogsCommand.js'; import { StopCommand } from './commands/StopCommand.js'; import { RestartCommand } from './commands/RestartCommand.js'; export class CommandRegistry { private handler: CLIHandler; constructor() { this.handler = new CLIHandler(); this.registerAllCommands(); } private registerAllCommands(): void { // Register all CLI commands this.handler.registerCommand(new ScanCommand()); this.handler.registerCommand(new StartCommand()); this.handler.registerCommand(new StatusCommand()); this.handler.registerCommand(new LogsCommand()); this.handler.registerCommand(new StopCommand()); this.handler.registerCommand(new RestartCommand()); } getHandler(): CLIHandler { return this.handler; } async executeCommand(args: string[]): Promise<void> { // Filter out the --mcp flag if present (handled at higher level) const filteredArgs = args.filter(arg => arg !== '--mcp'); await this.handler.execute(filteredArgs); } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/masamunet/npm-dev-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server