tinyhumansai/openhuman · error · Error
unknown arg: ${a}
Error message
unknown arg: ${a} What it means
Strict argument parsing in scripts/rabbit/cli.mjs: after the subcommand (default `run`), only --dry-run, --max <n>, --pr <n>, --grace <sec> and -h/--help are recognized. Any other token throws `unknown arg` immediately.
Source
Thrown at scripts/rabbit/cli.mjs:71
function parseArgs(argv) {
const out = {
cmd: argv[0] ?? "run",
max: 5,
dryRun: false,
pr: null,
graceSec: 30,
};
for (let i = 1; i < argv.length; i++) {
const a = argv[i];
if (a === "--dry-run") out.dryRun = true;
else if (a === "--max") out.max = Number(argv[++i]);
else if (a === "--pr") out.pr = Number(argv[++i]);
else if (a === "--grace") out.graceSec = Number(argv[++i]);
else if (a === "-h" || a === "--help") {
out.cmd = "help";
} else {
throw new Error(`unknown arg: ${a}`);
}
}
return out;
}
// Convert "1 hour and 5 minutes and 30 seconds" / "46 seconds" / "5 minutes"
// to seconds. CR uses `**46 seconds**` style — strip markdown asterisks first.
function parseWaitSeconds(body) {
const m = body.match(/Please wait\s+([^.<]+?)\s+before requesting/i);
if (!m) return null;
const raw = m[1].replace(/\*+/g, "").trim();
const parts = raw.split(/\s*(?:,|and)\s*/i);
let total = 0;
for (const part of parts) {
const pm = part.match(/^(\d+)\s*(second|minute|hour)s?$/i);
if (!pm) return null;
const n = Number(pm[1]);
const unit = pm[2].toLowerCase();View on GitHub (pinned to a221052e0d)
Solutions
- Run `node scripts/rabbit/cli.mjs -h` (or `help`) to list accepted args
- Map guesses to real flags: use `--max` for a count, `--pr` to target one PR, `--grace` for the wait override
- Remove unsupported flags — there is no --force/--yes in this CLI; safety is expressed via --dry-run
Example fix
# before node scripts/rabbit/cli.mjs run --limit 3 --force # after node scripts/rabbit/cli.mjs run --max 3 --dry-run
Defensive patterns
Strategy: validation
Validate before calling
const KNOWN = new Set(['--dry-run', '--max', '--pr', '--grace', '-h', '--help']);
const unknown = argv.filter(a => a.startsWith('--') && !KNOWN.has(a));
if (unknown.length) {
console.error(`Unknown args: ${unknown.join(', ')} — allowed: --dry-run --max N --pr N --grace N -h/--help`);
process.exit(2);
} Prevention
- Run the subcommand with -h before scripting it in CI; the parser is strict and rejects invented flags
- Copy the flag list verbatim from help output into pipeline definitions
When it happens
Trigger: Passing `--limit 10` (should be `--max 10`), `--force`, or abbreviations the parser does not support; also a flag whose expected value is missing silently consumes the next token, which can surface as a confusing unknown-arg one position later.
Common situations: Guessing flag names by analogy with gh/other repo CLIs; copy-pasting a command from an older revision of the script.
Related errors
- Failed to parse service CLI output as JSON: parsed value doe
- paths must be repo-relative, not absolute (got "${p}")
- must be an array
- ${label} must be a positive integer
- ${label} must be a positive integer
AI-assisted analysis of tinyhumansai/openhuman@a221052e0d (2026-08-16).
Data as JSON: /api/errors/487e9822644b7442.
Report an issue: GitHub.