{"record":{"id":"666967d01fb2ca5e","repo":"n8n-io/n8n","slug":"usage-tsx-evaluations-cli-compare-pairwise-ts-e","errorCode":null,"errorMessage":"Usage: tsx evaluations/cli/compare-pairwise.ts --ee-dir <path> --ia-dir <path> [--out <path>] [--ee-as-ia] [--ee-label <name>] [--ia-label <name>]","messagePattern":"Usage: tsx evaluations/cli/compare-pairwise\\.ts --ee-dir <path> --ia-dir <path> \\[--out <path>\\] \\[--ee-as-ia\\] \\[--ee-label <name>\\] \\[--ia-label <name>\\]","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@n8n/instance-ai/evaluations/cli/compare-pairwise.ts","lineNumber":1215,"sourceCode":"\tiaDir: string;\n\tout: string;\n\teeAsIa: boolean;\n\teeLabel?: string;\n\tiaLabel?: string;\n}\n\nfunction parseArgs(argv: string[]): CliArgs {\n\tconst get = (flag: string): string | undefined => {\n\t\tconst idx = argv.indexOf(flag);\n\t\tif (idx === -1) return undefined;\n\t\tconst value = argv[idx + 1];\n\t\treturn value && !value.startsWith('--') ? value : undefined;\n\t};\n\tconst has = (flag: string): boolean => argv.includes(flag);\n\tconst eeDir = get('--ee-dir');\n\tconst iaDir = get('--ia-dir');\n\tif (!eeDir || !iaDir) {\n\t\tthrow new Error(\n\t\t\t'Usage: tsx evaluations/cli/compare-pairwise.ts --ee-dir <path> --ia-dir <path> [--out <path>] [--ee-as-ia] [--ee-label <name>] [--ia-label <name>]',\n\t\t);\n\t}\n\tconst defaultOut = path.join(path.dirname(path.resolve(iaDir)), 'comparison.html');\n\tconst out = path.resolve(get('--out') ?? defaultOut);\n\treturn {\n\t\teeDir: path.resolve(eeDir),\n\t\tiaDir: path.resolve(iaDir),\n\t\tout,\n\t\teeAsIa: has('--ee-as-ia'),\n\t\teeLabel: get('--ee-label'),\n\t\tiaLabel: get('--ia-label'),\n\t};\n}\n\nasync function main(): Promise<void> {\n\tconst args = parseArgs(process.argv.slice(2));\n\tconst [ee, ia] = await Promise.all([","sourceCodeStart":1197,"sourceCodeEnd":1233,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/instance-ai/evaluations/cli/compare-pairwise.ts#L1197-L1233","documentation":"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.","triggerScenarios":"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 '--').","commonSituations":"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).","solutions":["Provide both --ee-dir and --ia-dir pointing to eval run output directories","Ensure the value after each flag exists and does not start with '--'","Check the exact flag names against the usage string in the error message"],"exampleFix":"# before\ntsx evaluations/cli/compare-pairwise.ts --ee-dir runs/ee\n\n# after\ntsx evaluations/cli/compare-pairwise.ts --ee-dir runs/ee --ia-dir runs/ia","handlingStrategy":"validation","validationCode":"// Validate required dirs before invoking compare-pairwise:\nconst required = ['--ee-dir', '--ia-dir'];\nfor (const flag of required) {\n  const idx = argv.indexOf(flag);\n  if (idx === -1 || !argv[idx + 1] || argv[idx + 1].startsWith('--')) {\n    throw new Error(`Missing required flag value: ${flag}`);\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always provide both --ee-dir and --ia-dir with valid directory paths","Read the usage string carefully on first use","Ensure flag values do not start with '--'"],"tags":["cli","validation","argument-parsing","compare-pairwise"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}