affaan-m/ECC · error · Error

Unknown argument: ${arg}

Error message

Unknown argument: ${arg}

What it means

Thrown by parseArgs in scripts/operator-readiness-dashboard.js when a `--` token matches none of the recognized flags. This dashboard has a much larger flag surface than observability-readiness (--json, --markdown, --write, --root, --repo, --skip-github, --allow-untracked, --max-open-prs, --max-open-issues, --max-dirty-files, --use-env-github-token, --generated-at, --exit-code, --help), but anything outside that set is still rejected.

Source

Thrown at scripts/operator-readiness-dashboard.js:214

    }

    if (arg === '--generated-at') {
      parsed.generatedAt = readValue(args, index, arg);
      index += 1;
      continue;
    }

    if (arg.startsWith('--generated-at=')) {
      parsed.generatedAt = arg.slice('--generated-at='.length);
      continue;
    }

    if (arg === '--exit-code') {
      parsed.exitCode = true;
      continue;
    }

    throw new Error(`Unknown argument: ${arg}`);
  }

  if (!['text', 'json', 'markdown'].includes(parsed.format)) {
    throw new Error(`Invalid format: ${parsed.format}. Use text, json, or markdown.`);
  }

  if (parsed.writePath && parsed.format === 'text') {
    throw new Error('--write requires --json, --markdown, or --format json|markdown');
  }

  parsed.allowUntracked = parsed.allowUntracked.map(normalizeRelativePrefix).filter(Boolean);

  return parsed;
}

function readText(rootDir, relativePath) {
  try {
    return fs.readFileSync(path.join(rootDir, relativePath), 'utf8');

View on GitHub (pinned to 01e15490f0)

Solutions

  1. Run `node scripts/operator-readiness-dashboard.js --help` to list accepted flags.
  2. For output format, use `--json`, `--markdown`, or `--format=json|markdown` rather than `--format text`.
  3. For multiple repos, repeat `--repo` (or use `--repo=`) rather than a plural `--repos`.

Example fix

// before
node scripts/operator-readiness-dashboard.js --repos owner/repo
// after
node scripts/operator-readiness-dashboard.js --repo owner/repo
Defensive patterns

Strategy: validation

Validate before calling

const DASH_FLAGS = new Set(['--json', '--markdown', '--write', '--root', '--repo', '--skip-github', '--allow-untracked', '--max-open-prs', '--max-open-issues', '--max-dirty-files', '--use-env-github-token', '--generated-at', '--exit-code', '--help', '-h']);
function assertKnownDashFlags(argv) {
  for (const a of argv) {
    if (a.startsWith('--') && !a.includes('=') && !DASH_FLAGS.has(a)) {
      throw new Error(`Unsupported flag for operator-readiness-dashboard: ${a}`);
    }
  }
}

Prevention

When it happens

Trigger: Typos like `--wrtie`, `--repos` (singular is `--repo`, repeatable); flags from the sibling observability-readiness.js that are not implemented here (e.g. `--format text` — use `--json`/`--markdown` instead, though `--format=` is also accepted); unsupported shorthand like `-q`.

Common situations: Mixing up the two readiness scripts' flag sets; an agent guessing flag names; documentation drift after a flag rename.

Related errors


AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13). Data as JSON: /api/errors/6b4946d14c78cee7. Report an issue: GitHub.