n8n-io/n8n · error · Error
Unknown flag: ${arg.split('=', 1)[0]} (use --help)
Error message
Unknown flag: ${arg.split('=', 1)[0]} (use --help) What it means
Thrown by the default case of parseArgs() (build-mcp-manifest.ts:222) when an argument starts with -- but matches no known flag case. The flag name is sanitized by splitting on '=' and taking the first segment before echoing, so any =value payload (which could contain a secret) is not leaked. The message directs the user to --help, which this CLI supports (unlike the eval CLI which has no --help).
Source
Thrown at packages/@n8n/instance-ai/evaluations/cli/build-mcp-manifest.ts:222
case '--source': {
const value = nextArg(argv, i, arg);
if (value !== 'disk' && value !== 'langtracer') {
throw new Error('--source must be "disk" or "langtracer"');
}
result.source = value;
i += 2;
break;
}
case '--suite':
result.suite = nextArg(argv, i, arg);
i += 2;
break;
case '-h':
case '--help':
return { helpRequested: true };
default:
if (arg.startsWith('--')) {
throw new Error(`Unknown flag: ${arg.split('=', 1)[0]} (use --help)`);
}
result.slugs.push(arg);
i += 1;
break;
}
}
if (result.iterations < 1) throw new Error('--iterations must be >= 1');
if (result.concurrency < 1) throw new Error('--concurrency must be >= 1');
if (result.maxAttempts < 1) throw new Error('--max-attempts must be >= 1');
if (result.source === 'langtracer' && !result.suite) {
throw new Error('--source langtracer requires --suite <slug>');
}
mkdirSync(result.outputDir, { recursive: true });
if (!result.manifestPath) result.manifestPath = join(result.outputDir, 'manifest.json');
if (!result.logDir) result.logDir = join(result.outputDir, 'logs');
const base = result.manifestPath.replace(/\.json$/, '');View on GitHub (pinned to 5ac6606e81)
Solutions
- Run with --help to see the full flag list: iterations, concurrency, append, output-dir, manifest, log-dir, mcp-server, builder, model, max-attempts, mcp-timeout-ms, project-id, tier, workflow-dir, build-cwd, source, suite, help.
- Correct the flag spelling or remove it.
- Do not pass eval CLI flags (e.g. --build-via-mcp, --dataset) to this tool — they belong to eval:instance-ai.
Example fix
// before pnpm eval:build-mcp-manifest --bulder instance-mcp // after pnpm eval:build-mcp-manifest --builder instance-mcp
Defensive patterns
Strategy: validation
Validate before calling
const MANIFEST_FLAGS = new Set(['-n','--iterations','-j','--concurrency','--append','--output-dir','--manifest','--log-dir','--mcp-server','--builder','--model','--max-attempts','--mcp-timeout-ms','--project-id','--tier','--workflow-dir','--build-cwd','--source','--suite','-h','--help']);
function validateManifestFlags(args: string[]): void {
for (const a of args) {
if (a.startsWith('--') && !MANIFEST_FLAGS.has(a.split('=',1)[0])) {
throw new Error(`Unknown flag: ${a.split('=',1)[0]}`);
}
}
} Prevention
- Run with --help to get the canonical flag list.
- Do not pass eval CLI flags (--build-via-mcp, --dataset) to build-mcp-manifest.
- Validate flags in a wrapper script before exec.
When it happens
Trigger: Passing any unrecognized long flag to build-mcp-manifest, e.g. --iterations-mode instead of --iterations, or a flag from a different tool (e.g. eval CLI flags like --build-via-mcp, which is not valid here). The flag name is stripped of any =value before reporting.
Common situations: Typo in a flag name, using a flag from the eval CLI (which has different flags), or referencing a renamed/removed flag. The error message points to --help for the canonical list.
Related errors
- Unknown flag: ${flagName}
- Unexpected positional argument
- Invalid integer for ${flagName}
- --source must be "disk" or "langtracer"
- --iterations must be >= 1
AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12).
Data as JSON: /api/errors/116c5e4d86663323.
Report an issue: GitHub.