MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / parseCommand

Function parseCommand

cli/src/commands/router-utils.ts:26–34  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

24 * parseCommand('logout') // => '' (not a slash command)
25 */
26export function parseCommand(input: string): string {
27 const trimmed = input.trim()
28 if (!trimmed.startsWith('/')) {
29 return ''
30 }
31 const normalized = trimmed.slice(1)
32 const firstWord = normalized.split(/\s+/)[0] || ''
33 return firstWord.toLowerCase()
34}
35
36/**
37 * Result of parsing a command-like input.

Callers 2

parseCommandInputFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected