MCPcopy
hub / github.com/codeaashu/claude-code / getCommand

Function getCommand

src/commands.ts:706–721  ·  view source on GitHub ↗
(commandName: string, commands: Command[])

Source from the content-addressed store, hash-verified

704}
705
706export function getCommand(commandName: string, commands: Command[]): Command {
707 const command = findCommand(commandName, commands)
708 if (!command) {
709 throw ReferenceError(
710 `Command ${commandName} not found. Available commands: ${commands
711 .map(_ => {
712 const name = getCommandName(_)
713 return _.aliases ? `${name} (aliases: ${_.aliases.join(', ')})` : name
714 })
715 .sort((a, b) => a.localeCompare(b))
716 .join(', ')}`,
717 )
718 }
719
720 return command
721}
722
723/**
724 * Formats a command's description with its source annotation for user-facing UI.

Callers 3

runAgentFunction · 0.85
applyCommandSuggestionFunction · 0.85

Calls 2

findCommandFunction · 0.85
getCommandNameFunction · 0.50

Tested by

no test coverage detected