{"record":{"id":"3dae175ff4cb0535","repo":"n8n-io/n8n","slug":"flag-flag-requires-a-value","errorCode":null,"errorMessage":"Flag ${flag} requires a value","messagePattern":"Flag (.+?) requires a value","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@n8n/ai-workflow-builder.ee/evaluations/cli/argument-parser.ts","lineNumber":398,"sourceCode":"\t\tlines.push('');\n\t}\n\n\tlines.push('Examples:');\n\tlines.push('  pnpm eval --verbose');\n\tlines.push('  pnpm eval --prompt \"Create a Slack notification workflow\"');\n\tlines.push('  pnpm eval --prompts-csv my-prompts.csv --max-examples 5');\n\tlines.push('  pnpm eval:langsmith --dataset \"workflow-builder-canvas-prompts\" --name \"test-run\"');\n\n\treturn lines.join('\\n');\n}\n\nexport function printHelp(): void {\n\tconsole.log(formatHelp());\n}\n\nfunction ensureValue(argv: string[], i: number, flag: string): string {\n\tconst value = argv[i + 1];\n\tif (value === undefined) throw new Error(`Flag ${flag} requires a value`);\n\treturn value;\n}\n\nfunction splitFlagToken(token: string): { flag: string; inlineValue?: string } {\n\tif (!token.startsWith('--')) return { flag: token };\n\tconst equalsIndex = token.indexOf('=');\n\tif (equalsIndex === -1) return { flag: token };\n\treturn { flag: token.slice(0, equalsIndex), inlineValue: token.slice(equalsIndex + 1) };\n}\n\nfunction isStringArray(value: unknown): value is string[] {\n\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} {","sourceCodeStart":380,"sourceCodeEnd":416,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/ai-workflow-builder.ee/evaluations/cli/argument-parser.ts#L380-L416","documentation":"CLI argument-parsing error from the ensureValue helper. It fires when a flag that takes a value (e.g. --prompt, --dataset) is the last token or is not followed by another token, so no value can be consumed. Generic guard shared by all value-taking flags in parseCli.","triggerScenarios":"Thrown at packages/@n8n/ai-workflow-builder.ee/evaluations/cli/argument-parser.ts:398 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide the value after the flag, e.g. --prompt \"...\" or --max-examples 5.","If the value starts with a dash, quote it or use the flag's inline form if supported.","Check the printed help for flags that require values."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","contentChangedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}