{"record":{"id":"116c5e4d86663323","repo":"n8n-io/n8n","slug":"unknown-flag-arg-split-1-0-use-help","errorCode":null,"errorMessage":"Unknown flag: ${arg.split('=', 1)[0]} (use --help)","messagePattern":"Unknown flag: (.+?) \\(use --help\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@n8n/instance-ai/evaluations/cli/build-mcp-manifest.ts","lineNumber":222,"sourceCode":"\t\t\tcase '--source': {\n\t\t\t\tconst value = nextArg(argv, i, arg);\n\t\t\t\tif (value !== 'disk' && value !== 'langtracer') {\n\t\t\t\t\tthrow new Error('--source must be \"disk\" or \"langtracer\"');\n\t\t\t\t}\n\t\t\t\tresult.source = value;\n\t\t\t\ti += 2;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase '--suite':\n\t\t\t\tresult.suite = nextArg(argv, i, arg);\n\t\t\t\ti += 2;\n\t\t\t\tbreak;\n\t\t\tcase '-h':\n\t\t\tcase '--help':\n\t\t\t\treturn { helpRequested: true };\n\t\t\tdefault:\n\t\t\t\tif (arg.startsWith('--')) {\n\t\t\t\t\tthrow new Error(`Unknown flag: ${arg.split('=', 1)[0]} (use --help)`);\n\t\t\t\t}\n\t\t\t\tresult.slugs.push(arg);\n\t\t\t\ti += 1;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (result.iterations < 1) throw new Error('--iterations must be >= 1');\n\tif (result.concurrency < 1) throw new Error('--concurrency must be >= 1');\n\tif (result.maxAttempts < 1) throw new Error('--max-attempts must be >= 1');\n\tif (result.source === 'langtracer' && !result.suite) {\n\t\tthrow new Error('--source langtracer requires --suite <slug>');\n\t}\n\n\tmkdirSync(result.outputDir, { recursive: true });\n\tif (!result.manifestPath) result.manifestPath = join(result.outputDir, 'manifest.json');\n\tif (!result.logDir) result.logDir = join(result.outputDir, 'logs');\n\tconst base = result.manifestPath.replace(/\\.json$/, '');","sourceCodeStart":204,"sourceCodeEnd":240,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/instance-ai/evaluations/cli/build-mcp-manifest.ts#L204-L240","documentation":"Thrown by the default case of parseArgs() (build-mcp-manifest.ts:222) when an argument starts with -- but matches no known flag case. The flag name is sanitized by splitting on '=' and taking the first segment before echoing, so any =value payload (which could contain a secret) is not leaked. The message directs the user to --help, which this CLI supports (unlike the eval CLI which has no --help).","triggerScenarios":"Passing any unrecognized long flag to build-mcp-manifest, e.g. --iterations-mode instead of --iterations, or a flag from a different tool (e.g. eval CLI flags like --build-via-mcp, which is not valid here). The flag name is stripped of any =value before reporting.","commonSituations":"Typo in a flag name, using a flag from the eval CLI (which has different flags), or referencing a renamed/removed flag. The error message points to --help for the canonical list.","solutions":["Run with --help to see the full flag list: iterations, concurrency, append, output-dir, manifest, log-dir, mcp-server, builder, model, max-attempts, mcp-timeout-ms, project-id, tier, workflow-dir, build-cwd, source, suite, help.","Correct the flag spelling or remove it.","Do not pass eval CLI flags (e.g. --build-via-mcp, --dataset) to this tool — they belong to eval:instance-ai."],"exampleFix":"// before\npnpm eval:build-mcp-manifest --bulder instance-mcp\n// after\npnpm eval:build-mcp-manifest --builder instance-mcp","handlingStrategy":"validation","validationCode":"const MANIFEST_FLAGS = new Set(['-n','--iterations','-j','--concurrency','--append','--output-dir','--manifest','--log-dir','--mcp-server','--builder','--model','--max-attempts','--mcp-timeout-ms','--project-id','--tier','--workflow-dir','--build-cwd','--source','--suite','-h','--help']);\nfunction validateManifestFlags(args: string[]): void {\n  for (const a of args) {\n    if (a.startsWith('--') && !MANIFEST_FLAGS.has(a.split('=',1)[0])) {\n      throw new Error(`Unknown flag: ${a.split('=',1)[0]}`);\n    }\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run with --help to get the canonical flag list.","Do not pass eval CLI flags (--build-via-mcp, --dataset) to build-mcp-manifest.","Validate flags in a wrapper script before exec."],"tags":["cli","argument-validation","security","instance-ai","mcp-manifest"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}