affaan-m/ECC · error · Error

Unknown option "${argument}"; put the executable after --.

Error message

Unknown option "${argument}"; put the executable after --.

What it means

parseArgs has an allowlist of flags (--terminal, --cwd, --recover, --standalone, --detect, --launch, --dry-run, --json, --help/-h, and the -- separator). Any token before -- that is not recognized throws this error, naming the offending token. The executable and its arguments must come after --, so a bare token before -- is treated as an unknown option rather than the executable.

Source

Thrown at skills/terminal-opener/scripts/open-terminal.js:132

      const value = readValue(argv, index, argument);
      options[argument.slice(2)] = value;
      index += 1;
    } else if (argument === '--recover' || argument === '--standalone') {
      options.mode = 'recover';
    } else if (argument === '--detect') {
      options.detect = true;
    } else if (argument === '--launch') {
      launchRequested = true;
      options.dryRun = false;
    } else if (argument === '--dry-run') {
      dryRunRequested = true;
      options.dryRun = true;
    } else if (argument === '--json') {
      options.json = true;
    } else if (argument === '--help' || argument === '-h') {
      options.help = true;
    } else {
      throw new Error(`Unknown option "${argument}"; put the executable after --.`);
    }
  }

  if (launchRequested && dryRunRequested) {
    throw new Error('--launch and --dry-run are mutually exclusive.');
  }

  validateTerminalName(options.terminal);
  validateCwd(options.cwd);
  if (!options.help && !options.detect && !options.executable) {
    throw new Error('An executable is required after --.');
  }
  if (options.executable) validateExecutable(options.executable);
  validateArgv(options.argv);
  return options;
}

function unsupportedPlan(options) {

View on GitHub (pinned to 01e15490f0)

Solutions

  1. Put the executable and its args after a -- separator.
  2. Check `node open-terminal.js --help` for the supported flag list and spellings.
  3. Remove or correct the offending token.

Example fix

# before
node open-terminal.js echo hi

# after
node open-terminal.js -- echo hi
Defensive patterns

Strategy: validation

Validate before calling

const KNOWN_OPTIONS = new Set(['--', '--terminal', '--cwd', '--recover', '--standalone', '--detect', '--launch', '--dry-run', '--json', '--help', '-h']);
for (const tok of argv) {
  if (tok.startsWith('--') && !KNOWN_OPTIONS.has(tok) && tok !== '--') {
    throw new Error(`Unknown option ${tok}; put the executable after --`);
  }
}

Prevention

When it happens

Trigger: Passing a flag like --foo, or placing the executable before -- (so it looks like an unknown option). parseArgs hits the final else branch at line 131.

Common situations: Forgetting the -- separator before the executable; typo in a flag name; using a flag from a different/newer version of the tool; copy-pasting a command from docs that omitted --.

Related errors


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