MCPcopy Index your code
hub / github.com/liuup/claude-code-analysis / getCommand

Function getCommand

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

Source from the content-addressed store, hash-verified

702}
703
704export function getCommand(commandName: string, commands: Command[]): Command {
705 const command = findCommand(commandName, commands)
706 if (!command) {
707 throw ReferenceError(
708 `Command ${commandName} not found. Available commands: ${commands
709 .map(_ => {
710 const name = getCommandName(_)
711 return _.aliases ? `${name} (aliases: ${_.aliases.join(', ')})` : name
712 })
713 .sort((a, b) => a.localeCompare(b))
714 .join(', ')}`,
715 )
716 }
717
718 return command
719}
720
721/**
722 * 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