{"record":{"id":"b39f3ac602d83104","repo":"n8n-io/n8n","slug":"unknown-flag-arg","errorCode":null,"errorMessage":"Unknown flag: ${arg}","messagePattern":"Unknown flag: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@n8n/instance-ai/evaluations/export-latest-verifier-request.ts","lineNumber":111,"sourceCode":"\t\t\t\t\t'data',\n\t\t\t\t\t'workflows',\n\t\t\t\t\t`${slug}.json`,\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase '--test-case-path': {\n\t\t\t\tconst rawPath = argv[++i];\n\t\t\t\tif (!rawPath) throw new Error('Missing value for --test-case-path');\n\t\t\t\ttestCasePath = path.resolve(process.cwd(), rawPath);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase '--scenario': {\n\t\t\t\tscenarioName = argv[++i];\n\t\t\t\tif (!scenarioName) throw new Error('Missing value for --scenario');\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\tif (arg.startsWith('--')) throw new Error(`Unknown flag: ${arg}`);\n\t\t\t\tif (!scenarioName) {\n\t\t\t\t\tscenarioName = arg;\n\t\t\t\t} else if (!testCasePath) {\n\t\t\t\t\ttestCasePath = path.join(\n\t\t\t\t\t\tinstanceAiRoot,\n\t\t\t\t\t\t'evaluations',\n\t\t\t\t\t\t'data',\n\t\t\t\t\t\t'workflows',\n\t\t\t\t\t\t`${arg}.json`,\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Error(`Unexpected positional argument: ${arg}`);\n\t\t\t\t}\n\t\t}\n\t}\n\n\treturn {\n\t\ttestCasePath:","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/instance-ai/evaluations/export-latest-verifier-request.ts#L93-L129","documentation":"Thrown by `parseCliArgs()` in export-latest-verifier-request.ts when an argv token starts with `--` but matches no case in the switch. This exporter CLI accepts a smaller flag set than the computer-use CLI: `--test-case`/`--slug`, `--test-case-path`, and `--scenario`. Any other `--token` is rejected. Distinct from error 420 which is the equivalent guard in a different CLI with a different accepted-flag set.","triggerScenarios":"Pass a computer-use CLI flag here by mistake (e.g. `--base-url`, `--filter`, `--verbose` — none are accepted). Typo a flag (`--scneario`). Carry over a flag from docs for a different eval tool. Pass `--help` (not implemented).","commonSituations":"Developers confuse the three eval CLIs and reuse flags across them. Copy-paste from a README for the wrong tool. A wrapper script shared across tools that injects a flag not understood by this one.","solutions":["Inspect the accepted flag set (parseCliArgs switch at export-latest-verifier-request.ts:85-109) and remove or correct the offending token.","If you meant to select a test case by slug, use `--slug <slug>` or `--test-case <slug>` or the first positional.","If you meant to point at a path, use `--test-case-path <path>`.","If you meant to select a scenario, use `--scenario <name>` or the second positional."],"exampleFix":"// before\n$ node export-latest-verifier-request.ts --filter slack\n// after\n$ node export-latest-verifier-request.ts --slug slack","handlingStrategy":"validation","validationCode":"const ACCEPTED = new Set(['--test-case','--slug','--test-case-path','--scenario']);\nfunction findUnknownFlags(argv: string[]): string[] {\n  return argv.filter((a) => a.startsWith('--') && !ACCEPTED.has(a));\n}\nconst unknown = findUnknownFlags(process.argv.slice(2));\nif (unknown.length) throw new Error(`Unknown flags: ${unknown.join(', ')}`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Don't share wrapper scripts verbatim across the three eval CLIs — each has its own accepted flag set.","Document the accepted flag set per CLI at the top of each script and in the README.","Centralize the accepted-flag set per CLI and derive `--help` and any pre-flight validator from it."],"tags":["cli","argument-parsing","verifier-export","configuration","developer-error"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}