{"record":{"id":"e16c797a6d258780","repo":"n8n-io/n8n","slug":"unexpected-positional-argument-e16c79","errorCode":null,"errorMessage":"Unexpected positional argument","messagePattern":"Unexpected positional argument","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@n8n/instance-ai/evaluations/computer-use/cli.ts","lineNumber":112,"sourceCode":"\t\t\t\traw.html = true;\n\t\t\t\tbreak;\n\t\t\tcase '--no-auto-start-daemon':\n\t\t\t\traw.autoStartDaemon = false;\n\t\t\t\tbreak;\n\t\t\tcase '--daemon-sandbox-dir':\n\t\t\t\traw.daemonSandboxDir = next(argv, i++, arg);\n\t\t\t\tbreak;\n\t\t\tcase '--use-published-daemon':\n\t\t\t\traw.usePublishedDaemon = true;\n\t\t\t\tbreak;\n\t\t\tcase '--keep-data':\n\t\t\t\traw.keepData = true;\n\t\t\t\tbreak;\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]}`);\n\t\t\t\t}\n\t\t\t\tthrow new Error('Unexpected positional argument');\n\t\t}\n\t}\n\n\treturn argsSchema.parse(raw);\n}\n\nfunction next(argv: string[], idx: number, flag: string): string {\n\tconst value = argv[idx + 1];\n\tif (value === undefined || value.startsWith('--')) {\n\t\tthrow new Error(`Missing value for ${flag}`);\n\t}\n\treturn value;\n}\n\n// ---------------------------------------------------------------------------\n// Scenario discovery\n// ---------------------------------------------------------------------------\n","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/instance-ai/evaluations/computer-use/cli.ts#L94-L130","documentation":"Thrown by the same computer-use eval CLI parser when an argv token does NOT start with `--` and falls through to the `default` branch. Unlike export-latest-verifier-request.ts (which accepts positional slug/scenario args), this CLI accepts zero positional arguments — every input must be a named flag. The parser is deliberately strict so scenario discovery stays driven by the `data/` directory scan, not by CLI positionals.","triggerScenarios":"Run `node cli.ts slack-oauth` expecting to filter by scenario id (the correct form is `--filter slack-oauth`). Run `node cli.ts ./scenarios/foo.json` expecting to point at a scenario file (no such mode exists). Any bare token after a flag value also lands here, e.g. `--filter slack extra-token`.","commonSituations":"Developers used to the export-latest-verifier-request.ts positional style run this CLI the same way. Copy-paste from a sibling tool's docs. A shell glob that expanded to a bare filename instead of being quoted/flagged.","solutions":["Replace the bare token with the corresponding flag: scenario filtering uses `--filter <substring>`.","If you intended to point at a specific scenario file, note this CLI has no such option — it scans `evaluations/computer-use/data/*.json` automatically; add or remove files there instead.","Re-run with a single `--filter <id-substring>` to confirm the rest of the args parse, then re-add other flags."],"exampleFix":"// before\n$ node cli.ts slack-oauth\n// after\n$ node cli.ts --filter slack-oauth","handlingStrategy":"validation","validationCode":"// Reject any bare positional token before invoking.\nconst hasPositional = process.argv.slice(2).some((a) => !a.startsWith('--'));\nif (hasPositional) {\n  throw new Error('This CLI takes no positional args — use --filter <substring>');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Document that this CLI is flag-only at the top of the script and in the README.","If migrating to accept positionals, do so deliberately and update the parser's default branch rather than letting tokens silently through."],"tags":["cli","argument-parsing","configuration","developer-error"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}