MCPcopy Create free account
hub / github.com/clawbot7/cli-gateway / formatCommandLine

Function formatCommandLine

src/gateway/toolAuth.ts:505–515  ·  view source on GitHub ↗
(commandRaw: unknown, argsRaw: unknown)

Source from the content-addressed store, hash-verified

503}
504
505function formatCommandLine(commandRaw: unknown, argsRaw: unknown): string | null {
506 if (typeof commandRaw !== 'string' || !commandRaw.trim()) return null;
507 const command = commandRaw.trim();
508
509 const args = Array.isArray(argsRaw)
510 ? argsRaw.filter((item): item is string => typeof item === 'string')
511 : [];
512
513 const full = args.length > 0 ? `${command} ${args.join(' ')}` : command;
514 return normalizeTextPrefix(full);
515}
516
517function extractTargetFromToolTitle(
518 toolKind: ToolKind,

Callers 1

extractMatchCandidatesFunction · 0.85

Calls 1

normalizeTextPrefixFunction · 0.85

Tested by

no test coverage detected