affaan-m/ECC · error · Error
${flagName} requires a value
Error message
${flagName} requires a value What it means
Thrown by readValue() in scripts/github-coordination.js when a value-expecting flag (like --repo, --issue, --config, --limit, --home) is either the last argument or is followed by another flag (a token starting with '--'). The function checks that the next token exists and does not look like a flag name.
Source
Thrown at scripts/github-coordination.js:53
' --repo <owner/repo> GitHub repository',
' --issue <number> Issue number for actions that target one issue',
' --actor <login> Claim owner / coordination actor',
' --branch <name> Epic branch name to stamp into the coordination body',
' --config <path> Optional coordination policy config',
' --db <path> SQLite state store path',
' --home <dir> Override home directory used by the state store',
' --limit <n> Limit issues scanned by sync/unblock',
' --dry-run Preview changes without modifying GitHub or state',
' --json Emit machine-readable JSON',
' --help, -h Show this help',
].join('\n'));
process.exit(exitCode);
}
function readValue(args, index, flagName) {
const value = args[index + 1];
if (!value || value.startsWith('--')) {
throw new Error(`${flagName} requires a value`);
}
return value;
}
// Boolean flags: map flag string → setter(parsed)
const BOOL_FLAGS = new Map([
['--help', p => { p.help = true; }],
['-h', p => { p.help = true; }],
['--json', p => { p.json = true; }],
['--dry-run', p => { p.dryRun = true; }],
]);
// Value flags: map flag string → setter(parsed, value)
const VALUE_FLAGS = new Map([
['--repo', (p, v) => { p.repo = v; }],
['--actor', (p, v) => { p.actor = v; }],
['--branch', (p, v) => { p.branch = v; }],
['--config', (p, v) => { p.configPath = v; }],View on GitHub (pinned to 01e15490f0)
Solutions
- Provide a value immediately after the flag: `--repo owner/repo`.
- Reorder arguments so a value-expecting flag is never immediately followed by another flag.
- Check shell quoting: values with spaces or special characters should be quoted.
- Run with --help to see which flags require values.
Example fix
// before node scripts/github-coordination.js sync --repo --issue 5 // after node scripts/github-coordination.js sync --repo owner/repo --issue 5
Defensive patterns
Strategy: validation
Validate before calling
function safeReadValue(args, index, flagName) {
const value = args[index + 1];
if (!value || value.startsWith('--')) {
console.error(`${flagName} requires a value. Usage: ${flagName} <value>`);
process.exit(2);
}
return value;
} Type guard
function hasFlagValue(args, index) {
const next = args[index + 1];
return typeof next === 'string' && next.length > 0 && !next.startsWith('--');
} Prevention
- Construct CLI commands from validated argument lists in automation.
- Add shell completion that inserts placeholder values for value flags.
- Test commands with a dry-run or --help before executing in pipelines.
When it happens
Trigger: Running `node scripts/github-coordination.js --repo` (no value after flag), or `node scripts/github-coordination.js --repo --issue 5` (--repo followed by another flag). Any VALUE_FLAGS entry whose next arg is missing or starts with '--' triggers this.
Common situations: Forgetting to supply the value for a flag, accidentally putting flags in the wrong order, or a shell quoting issue that drops the value. Common with copy-pasted commands where a value was omitted.
Related errors
- Unknown argument: ${arg}
- 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/d5c646201e0286a9.
Report an issue: GitHub.