affaan-m/ECC · error · Error
Unknown argument: ${arg}
Error message
Unknown argument: ${arg} What it means
Thrown at the end of skills-health.js parseArgs when a token is not one of the accepted flags (--json, --help, --runs-file <path>, --now <ts>, --dashboard, --panel <name>, --warn-threshold <n>, and their value forms). The parser has no fallback and rejects unrecognized tokens.
Source
Thrown at scripts/skills-health.js:104
if (arg === '--warn-threshold') {
options.warnThreshold = Number(requireValue(argv, index, '--warn-threshold'));
index += 1;
continue;
}
if (arg === '--dashboard') {
options.dashboard = true;
continue;
}
if (arg === '--panel') {
options.panel = requireValue(argv, index, '--panel');
index += 1;
continue;
}
throw new Error(`Unknown argument: ${arg}`);
}
return options;
}
function main() {
try {
const options = parseArgs(process.argv.slice(2));
if (options.help) {
showHelp();
process.exit(0);
}
if (options.dashboard || options.panel) {
const result = renderDashboard(options);
process.stdout.write(options.json ? `${JSON.stringify(result.data, null, 2)}\n` : result.text);
} else {View on GitHub (pinned to 01e15490f0)
Solutions
- Run `node scripts/skills-health.js --help` to list accepted flags.
- Correct typos and remove unsupported flags.
- Confirm --panel names are from the documented set (success-rate, failures, amendments, versions).
Example fix
# before node scripts/skills-health.js --pannel failures # after node scripts/skills-health.js --panel failures
Defensive patterns
Strategy: validation
Validate before calling
const ALLOWED = new Set(['--json', '--help', '--runs-file', '--now', '--dashboard', '--panel', '--warn-threshold']);
const bad = process.argv.slice(2).filter(a => a.startsWith('--') && !ALLOWED.has(a.split('=')[0]));
if (bad.length) { console.error('Unknown skills-health flag(s):', bad.join(' ')); process.exit(2); } Try / catch
try { parseArgs(process.argv.slice(2)); } catch (err) { console.error(err.message); process.exit(2); } Prevention
- Generate --help from the parser's allowlist so docs cannot drift.
- Lint wrapper invocations in CI against the documented flag set.
When it happens
Trigger: A typo (e.g. `--dashboardd`), a flag from another ECC script, or an unexpected positional argument.
Common situations: Mixing flags across ECC scripts; copy-pasting a stale command; using a long-form alias that is not supported.
Related errors
- Missing value for ${argName}
- --write requires a path
- Unknown argument: ${arg}
- Invalid ${flag}: expected a single cache path segment
- Unknown argument: ${arg}
AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13).
Data as JSON: /api/errors/60be04cdbd6a1a97.
Report an issue: GitHub.