MCPcopy
hub / github.com/cursor/cookbook / getSlashCommand

Function getSlashCommand

sdk/coding-agent-cli/src/commands.ts:27–30  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

25const commandNames = new Set<string>(slashCommands.map((command) => command.name))
26
27export function getSlashCommand(input: string): SlashCommandName | undefined {
28 const [command] = input.trim().split(/\s+/, 1)
29 return commandNames.has(command) ? (command as SlashCommandName) : undefined
30}
31
32export function formatSlashCommandHelp() {
33 return slashCommands

Callers 1

runCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected