n8n-io/n8n · error · Error

Unknown flag: ${arg.split('=', 1)[0]}

Error message

Unknown flag: ${arg.split('=', 1)[0]}

What it means

Thrown by the hand-written argument parser in the computer-use eval CLI (cli.ts) when an argv token starts with `--` but matches no case in the switch. The parser is a closed enum of known flags (--base-url, --email, --password, --verbose, --filter, --timeout-ms, --output-dir, --html, --no-auto-start-daemon, --daemon-sandbox-dir, --use-published-daemon, --keep-data); anything else is rejected before zod ever runs. The `arg.split('=', 1)[0]` form strips any `=value` suffix so the message reports the flag name, not its value.

Source

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

				break;
			case '--html':
				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. Run the CLI with no args or with `--help` equivalent (inspect parseArgs switch at cli.ts:71-107) to list accepted flags, then correct the offending token.
  2. If you meant the n8n base URL, use `--base-url <url>` (not `--port`, `--host`, or `--url`).
  3. If you intended a value-bearing flag written as `--flag=value`, confirm the flag name itself is in the accepted set; the parser accepts the `=` form only for known flags via the `next()` helper, not via the default branch.
  4. Check for stale shell history or a wrapper script that injects a flag removed in the current checkout.

Example fix

// before
$ node cli.ts --port 5678 --filter slack
// after
$ node cli.ts --base-url http://localhost:5678 --filter slack
Defensive patterns

Strategy: validation

Validate before calling

// Before invoking, intersect the intended argv against the accepted flag set.
const ACCEPTED = new Set([
  '--base-url','--email','--password','--verbose','--filter',
  '--timeout-ms','--output-dir','--html','--no-auto-start-daemon',
  '--daemon-sandbox-dir','--use-published-daemon','--keep-data',
]);
function findUnknownFlags(argv: string[]): string[] {
  return argv
    .filter((a) => a.startsWith('--'))
    .map((a) => a.split('=', 1)[0])
    .filter((a) => !ACCEPTED.has(a));
}
const unknown = findUnknownFlags(process.argv.slice(2));
if (unknown.length) throw new Error(`Unknown flags: ${unknown.join(', ')}`);

Prevention

When it happens

Trigger: Pass an unrecognized flag like `--port 5678` (the correct flag is `--base-url`), or carry over a flag from a sibling tool (e.g. `--source langtracer` belongs to the workflow/agent eval CLI, not this one). Also triggered by typos: `--verbsoe`, `--kepe-data`. Any `--foo=bar` form where `foo` is unknown hits the same branch.

Common situations: Developers copy a command from one eval tool's README into another; the three CLIs (computer-use/cli.ts, the workflow/agent eval entry, and export-latest-verifier-request.ts) share look-alike flags but not the same set. CI scripts upgraded after a flag rename (e.g. a flag renamed between versions) silently carry the old spelling. Shell history autocomplete picks a stale flag.

Related errors


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