{"record":{"id":"8aea6e89a7bb97e7","repo":"n8n-io/n8n","slug":"unknown-flag-flag-valid-flags-formatvali","errorCode":null,"errorMessage":"Unknown flag: ${flag}\n\nValid flags:\n  ${formatValidFlags()}","messagePattern":"Unknown flag: (.+?)\n\nValid flags:\n  (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@n8n/ai-workflow-builder.ee/evaluations/cli/argument-parser.ts","lineNumber":428,"sourceCode":"\treturn Array.isArray(value) && value.every((v): v is string => typeof v === 'string');\n}\n\nfunction parseCli(argv: string[]): {\n\tvalues: Partial<Record<CliKey, unknown>>;\n\tseenKeys: Set<CliKey>;\n} {\n\tconst values: Partial<Record<CliKey, unknown>> = {};\n\tconst seenKeys = new Set<CliKey>();\n\n\tfor (let i = 0; i < argv.length; i++) {\n\t\tconst token = argv[i];\n\t\tif (!token.startsWith('-')) continue;\n\n\t\tconst { flag, inlineValue } = splitFlagToken(token);\n\t\tconst def = FLAG_TO_KEY[flag];\n\n\t\tif (!def) {\n\t\t\tthrow new Error(`Unknown flag: ${flag}\\n\\nValid flags:\\n  ${formatValidFlags()}`);\n\t\t}\n\n\t\tseenKeys.add(def.key);\n\n\t\tif (def.kind === 'boolean') {\n\t\t\tvalues[def.key] = true;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst value = inlineValue ?? ensureValue(argv, i, flag);\n\t\tif (inlineValue === undefined) i++;\n\n\t\tif (def.key === 'filter') {\n\t\t\tconst existing = values.filter;\n\t\t\tvalues.filter = isStringArray(existing) ? [...existing, value] : [value];\n\t\t\tcontinue;\n\t\t}\n","sourceCodeStart":410,"sourceCodeEnd":446,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/ai-workflow-builder.ee/evaluations/cli/argument-parser.ts#L410-L446","documentation":"Error \"Unknown flag: ${flag}\n\nValid flags:\n  ${formatValidFlags()}\" thrown in n8n-io/n8n.","triggerScenarios":"Thrown at packages/@n8n/ai-workflow-builder.ee/evaluations/cli/argument-parser.ts:428 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}