tinyhumansai/openhuman · error · Error

Unknown option: ${arg}

Error message

Unknown option: ${arg}

What it means

The release-notes script accepts exactly: --help/-h, --from <ref>, --to <ref>, --repo <owner/repo>, --model <name>, --output/-o <file>, --no-ai, and --dry-run. The parser's final else branch throws `Unknown option` for any other token, so a typo or an invented flag aborts before any git/gh/network work happens.

Source

Thrown at scripts/release/generate-release-notes.mjs:85

    if (arg === '--help' || arg === '-h') {
      return { ...options, help: true };
    }
    if (arg === '--from') {
      options.from = readValue(arg);
    } else if (arg === '--to') {
      options.to = readValue(arg);
    } else if (arg === '--repo') {
      options.repo = readValue(arg);
    } else if (arg === '--model') {
      options.model = readValue(arg);
    } else if (arg === '--output' || arg === '-o') {
      options.output = readValue(arg);
    } else if (arg === '--no-ai') {
      options.noAi = true;
    } else if (arg === '--dry-run') {
      options.dryRun = true;
    } else {
      throw new Error(`Unknown option: ${arg}`);
    }
  }

  return options;
}

function runGit(args, options = {}) {
  return execFileSync('git', args, {
    encoding: 'utf8',
    stdio: ['ignore', 'pipe', options.allowFailure ? 'pipe' : 'inherit'],
  }).trim();
}

function runGh(args, options = {}) {
  return execFileSync('gh', args, {
    encoding: 'utf8',
    stdio: ['ignore', 'pipe', options.allowFailure ? 'pipe' : 'inherit'],
  }).trim();

View on GitHub (pinned to a221052e0d)

Solutions

  1. Run with `--help` and copy the supported option list verbatim
  2. Fix the typo — the commonest are --output (not --out/--outpt) and --dry-run (not --dryrun)
  3. Drop flags that don't exist; behavior defaults are documented in --help

Example fix

# before
node scripts/release/generate-release-notes.mjs --outpt notes.md

# after
node scripts/release/generate-release-notes.mjs --output notes.md
Defensive patterns

Strategy: validation

Validate before calling

const KNOWN = new Set(['--help', '-h', '--from', '--to', '--repo', '--model', '--output', '-o', '--no-ai', '--dry-run']);
const bad = argv.filter(a => a.startsWith('-') && !KNOWN.has(a));
if (bad.length) { console.error(`Unknown options: ${bad.join(', ')}`); process.exit(2); }

Prevention

When it happens

Trigger: `--outpt notes.md` (typo for --output), `--verbose`, `--yes`; also an option value that starts with '-' can be misread as the next option and land here (see error 276).

Common situations: Typos in long option names; flags copied from a different changelog tool; assuming a global --verbose exists.

Related errors


AI-assisted analysis of tinyhumansai/openhuman@a221052e0d (2026-08-16). Data as JSON: /api/errors/e457f07377f2d599. Report an issue: GitHub.