n8n-io/n8n · error · Error

Unexpected positional argument

Error message

Unexpected positional argument

What it means

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.

Source

Thrown at packages/@n8n/instance-ai/evaluations/computer-use/cli.ts:112

				raw.html = true;
				break;
			case '--no-auto-start-daemon':
				raw.autoStartDaemon = false;
				break;
			case '--daemon-sandbox-dir':
				raw.daemonSandboxDir = next(argv, i++, arg);
				break;
			case '--use-published-daemon':
				raw.usePublishedDaemon = true;
				break;
			case '--keep-data':
				raw.keepData = true;
				break;
			default:
				if (arg.startsWith('--')) {
					throw new Error(`Unknown flag: ${arg.split('=', 1)[0]}`);
				}
				throw new Error('Unexpected positional argument');
		}
	}

	return argsSchema.parse(raw);
}

function next(argv: string[], idx: number, flag: string): string {
	const value = argv[idx + 1];
	if (value === undefined || value.startsWith('--')) {
		throw new Error(`Missing value for ${flag}`);
	}
	return value;
}

// ---------------------------------------------------------------------------
// Scenario discovery
// ---------------------------------------------------------------------------

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Replace the bare token with the corresponding flag: scenario filtering uses `--filter <substring>`.
  2. 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.
  3. Re-run with a single `--filter <id-substring>` to confirm the rest of the args parse, then re-add other flags.

Example fix

// before
$ node cli.ts slack-oauth
// after
$ node cli.ts --filter slack-oauth
Defensive patterns

Strategy: validation

Validate before calling

// Reject any bare positional token before invoking.
const hasPositional = process.argv.slice(2).some((a) => !a.startsWith('--'));
if (hasPositional) {
  throw new Error('This CLI takes no positional args — use --filter <substring>');
}

Prevention

When it happens

Trigger: 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`.

Common situations: 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.

Related errors


AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12). Data as JSON: /api/errors/e16c797a6d258780. Report an issue: GitHub.