n8n-io/n8n · error · Error

Usage: tsx evaluations/cli/compare-pairwise.ts --ee-dir <pat

Error message

Usage: tsx evaluations/cli/compare-pairwise.ts --ee-dir <path> --ia-dir <path> [--out <path>] [--ee-as-ia] [--ee-label <name>] [--ia-label <name>]

What it means

The compare-pairwise CLI compares two eval run directories side by side and produces an HTML diff report. It requires both --ee-dir (Enterprise Edition run output) and --ia-dir (Instance AI run output) as mandatory inputs. If either is missing or its value is absent, parseArgs throws this usage message listing all accepted flags.

Source

Thrown at packages/@n8n/instance-ai/evaluations/cli/compare-pairwise.ts:1215

	iaDir: string;
	out: string;
	eeAsIa: boolean;
	eeLabel?: string;
	iaLabel?: string;
}

function parseArgs(argv: string[]): CliArgs {
	const get = (flag: string): string | undefined => {
		const idx = argv.indexOf(flag);
		if (idx === -1) return undefined;
		const value = argv[idx + 1];
		return value && !value.startsWith('--') ? value : undefined;
	};
	const has = (flag: string): boolean => argv.includes(flag);
	const eeDir = get('--ee-dir');
	const iaDir = get('--ia-dir');
	if (!eeDir || !iaDir) {
		throw new Error(
			'Usage: tsx evaluations/cli/compare-pairwise.ts --ee-dir <path> --ia-dir <path> [--out <path>] [--ee-as-ia] [--ee-label <name>] [--ia-label <name>]',
		);
	}
	const defaultOut = path.join(path.dirname(path.resolve(iaDir)), 'comparison.html');
	const out = path.resolve(get('--out') ?? defaultOut);
	return {
		eeDir: path.resolve(eeDir),
		iaDir: path.resolve(iaDir),
		out,
		eeAsIa: has('--ee-as-ia'),
		eeLabel: get('--ee-label'),
		iaLabel: get('--ia-label'),
	};
}

async function main(): Promise<void> {
	const args = parseArgs(process.argv.slice(2));
	const [ee, ia] = await Promise.all([

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Provide both --ee-dir and --ia-dir pointing to eval run output directories
  2. Ensure the value after each flag exists and does not start with '--'
  3. Check the exact flag names against the usage string in the error message

Example fix

# before
tsx evaluations/cli/compare-pairwise.ts --ee-dir runs/ee

# after
tsx evaluations/cli/compare-pairwise.ts --ee-dir runs/ee --ia-dir runs/ia
Defensive patterns

Strategy: validation

Validate before calling

// Validate required dirs before invoking compare-pairwise:
const required = ['--ee-dir', '--ia-dir'];
for (const flag of required) {
  const idx = argv.indexOf(flag);
  if (idx === -1 || !argv[idx + 1] || argv[idx + 1].startsWith('--')) {
    throw new Error(`Missing required flag value: ${flag}`);
  }
}

Prevention

When it happens

Trigger: Running `tsx evaluations/cli/compare-pairwise.ts` without --ee-dir or without --ia-dir. Also fires when a flag's value position is occupied by another flag (the get helper returns undefined when the next token starts with '--').

Common situations: First-time use without reading the help. Forgetting one of the two required directory arguments. Providing the flag but no value, or the value starting with '--'. Passing the wrong flag name (e.g. --ee instead of --ee-dir).

Related errors


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