{"record":{"id":"4c37be201a2021e0","repo":"paperclipai/paperclip","slug":"invalid-flag-raw-use-format","errorCode":null,"errorMessage":"Invalid ${flag} \"${raw}\". Use ${format}.","messagePattern":"Invalid (.+?) \"(.+?)\"\\. Use (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/client/teams.ts","lineNumber":518,"sourceCode":"function parseAdapterOverrides(\n  values: string[] | undefined,\n): CatalogTeamInstallOptions[\"adapterOverrides\"] | undefined {\n  if (!values || values.length === 0) return undefined;\n  const result: NonNullable<CatalogTeamInstallOptions[\"adapterOverrides\"]> = {};\n  for (const raw of values) {\n    const [slug, adapterType] = parseKeyValueOption(raw, \"--adapter-override\", \"slug=type\");\n    if (!slug || !adapterType) {\n      throw new Error(`Invalid --adapter-override \"${raw}\". Use slug=type.`);\n    }\n    result[slug] = { adapterType };\n  }\n  return result;\n}\n\nfunction parseKeyValueOption(raw: string, flag: string, format: string): [string, string] {\n  const separator = raw.indexOf(\"=\");\n  if (separator <= 0) {\n    throw new Error(`Invalid ${flag} \"${raw}\". Use ${format}.`);\n  }\n  return [raw.slice(0, separator).trim(), raw.slice(separator + 1).trim()];\n}\n\nfunction removeUndefined<T extends Record<string, unknown>>(input: T): T {\n  return Object.fromEntries(Object.entries(input).filter(([, value]) => value !== undefined)) as T;\n}\n\nfunction emptyStringToUndefined(value: string | undefined): string | undefined {\n  const trimmed = value?.trim();\n  return trimmed || undefined;\n}\n\nfunction collectOptionValue(value: string, previous: string[]): string[] {\n  return [...previous, value];\n}\n\nfunction appendQueryParam(params: URLSearchParams, key: string, value: string | undefined): void {","sourceCodeStart":500,"sourceCodeEnd":536,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/cli/src/commands/client/teams.ts#L500-L536","documentation":"Generic key=value parser error thrown by parseKeyValueOption in teams.ts. Fires when the input contains no '=' separator or the '=' is the first character (indexOf('=') <= 0), making a key unrecoverable. Used as the shared parser behind flags like --adapter-override.","triggerScenarios":"Passing `--adapter-override codex` (no '='), `--adapter-override \"=value\"` (leading '='), or any key=value flag value where the separator is missing or leading. The format hint passed in (--adapter-override → slug=type) is interpolated into the message.","commonSituations":"Using ':' or '-' instead of '=', a shell that swallowed the '=', or a value that was meant to be quoted but got split by the shell into separate argv entries.","solutions":["Add the '=' separator exactly once, e.g. slug=type.","Quote the argument so the shell does not split it: --adapter-override \"slug=type\".","Check the flag's documented format in the error message and match it character-for-character."],"exampleFix":"// before\n--adapter-override codex\n// after\n--adapter-override \"codex=claude\"","handlingStrategy":"validation","validationCode":"function parseKeyValue(raw: string, flag: string, format: string): [string, string] | null {\n  const sep = raw.indexOf(\"=\");\n  if (sep <= 0) {\n    console.error(`Invalid ${flag} \"${raw}\". Use ${format}.`);\n    return null;\n  }\n  return [raw.slice(0, sep).trim(), raw.slice(sep + 1).trim()];\n}","typeGuard":"function hasKeyValueSeparator(raw: string): boolean {\n  const sep = raw.indexOf(\"=\");\n  return sep > 0;\n}","tryCatchPattern":null,"preventionTips":["Always include exactly one '=' between key and value.","Quote the argument so the shell does not split on '='.","Run `--help` to see the documented format string for each key=value flag."],"tags":["cli","argument-validation","key-value-parser"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}