affaan-m/ECC · error · Error
Unknown argument: ${arg}
Error message
Unknown argument: ${arg} What it means
Thrown by the argument parser in scripts/github-coordination.js when a token is not a recognized boolean flag, not a recognized value flag, does not start with '-' (so it is not handled as a positional), and falls through to the else branch. Wait — actually any token starting with '-' that is not in BOOL_FLAGS or VALUE_FLAGS triggers this. Non-dash tokens are treated as positionals.
Source
Thrown at scripts/github-coordination.js:106
validation: null, review: null, status: null, projectState: null,
positionals: [],
};
if (args.length > 0 && !args[0].startsWith('-')) {
parsed.command = args.shift();
}
for (let i = 0; i < args.length; i += 1) {
const arg = args[i];
if (BOOL_FLAGS.has(arg)) {
BOOL_FLAGS.get(arg)(parsed);
} else if (VALUE_FLAGS.has(arg)) {
VALUE_FLAGS.get(arg)(parsed, readValue(args, i, arg));
i += 1;
} else if (!arg.startsWith('-')) {
parsed.positionals.push(arg);
} else {
throw new Error(`Unknown argument: ${arg}`);
}
}
if (!parsed.command) parsed.command = 'sync';
if (!parsed.issueNumber && parsed.positionals.length > 0) {
parsed.issueNumber = normalizeIssueNumber(parsed.positionals[0]);
}
return parsed;
}
function dispatchCommand(options, ctx) {
const { store, policy, rootDir } = ctx;
const base = { configPath: options.configPath, dryRun: options.dryRun };
if (options.command === 'claim') {
if (!options.issueNumber) throw new Error('Missing issue number.');
return applyClaim(options.repo, options.issueNumber, {View on GitHub (pinned to 01e15490f0)
Solutions
- Run `node scripts/github-coordination.js --help` to see all accepted flags.
- Check for typos in flag names.
- Remove the unsupported flag from your command.
- If the flag should exist, verify you are running a compatible version of the script.
Example fix
// before node scripts/github-coordination.js sync --repo owner/repo --verbose // after node scripts/github-coordination.js sync --repo owner/repo
Defensive patterns
Strategy: validation
Validate before calling
const ALL_FLAGS = new Set([...BOOL_FLAGS.keys(), ...VALUE_FLAGS.keys()]);
const unknown = args.filter(a => a.startsWith('-') && !ALL_FLAGS.has(a) && !a.includes('='));
if (unknown.length > 0) {
console.error(`Unknown flag(s): ${unknown.join(', ')}. Run --help for usage.`);
process.exit(1);
} Type guard
function isKnownFlag(arg, boolFlags, valueFlags) {
return boolFlags.has(arg) || valueFlags.has(arg);
} Prevention
- Keep a help reference handy or use --help before running.
- Validate flags in wrapper scripts before passing them through.
- Use consistent flag naming and watch for typos.
When it happens
Trigger: Passing an unrecognized dash-prefixed flag such as `--verbose`, `--force`, or `-v` that is not registered in BOOL_FLAGS or VALUE_FLAGS. The parser iterates all args; unknown dash-flags hit the final else throw.
Common situations: Using a flag from documentation of a different tool, a typo in a flag name (e.g. `--isssue` instead of `--issue`), or a flag that was removed/renamed in a version update.
Related errors
- ${flagName} requires a value
- Unknown command: ${options.command}
- Unknown command: ${firstArg}
- Unknown command: ${resolution.command}
- Unknown argument: ${arg}
AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13).
Data as JSON: /api/errors/af812adaf3ba66ba.
Report an issue: GitHub.