affaan-m/ECC · error

Unknown argument. Run guided install with --help to see vali

Error message

Unknown argument. Run guided install with --help to see valid options.

What it means

install-guided.js rejects any token that is not one of its known flags (--harness, --claude-scope, --claude-hooks, --profile, --all-harnesses, --yes/-y, --dry-run, --json, --help/-h). The error directs the user to --help rather than guessing intent.

Source

Thrown at scripts/install-guided.js:102

        throw new Error(`Value for ${argument} is too long.`);
      }
      const key = valueFlags.get(argument);
      options = key === 'harnesses'
        ? { ...options, harnesses: [...options.harnesses, value] }
        : { ...options, [key]: value };
      index += 1;
    } else if (argument === '--all-harnesses') {
      options = { ...options, allHarnesses: true };
    } else if (argument === '--yes' || argument === '-y') {
      options = { ...options, yes: true };
    } else if (argument === '--dry-run') {
      options = { ...options, dryRun: true };
    } else if (argument === '--json') {
      options = { ...options, json: true };
    } else if (argument === '--help' || argument === '-h') {
      options = { ...options, help: true };
    } else {
      throw new Error('Unknown argument. Run guided install with --help to see valid options.');
    }
  }
  if (options.allHarnesses && options.harnesses.length > 0) {
    throw new Error('--all-harnesses and --harness are mutually exclusive.');
  }
  return options;
}

function choicesText(values) {
  return values.join('|');
}

async function askChoice(terminal, output, prompt, values, defaultValue) {
  output.write(`\n${prompt}\n`);
  values.forEach((value, index) => output.write(`  ${index + 1}. ${value}\n`));
  while (true) {
    const question = defaultValue
      ? `Choose [Recommended: ${defaultValue}] (one option only): `

View on GitHub (pinned to 01e15490f0)

Solutions

  1. Run node scripts/install-guided.js --help to list valid options
  2. Remove the unsupported flag
  3. If you need --modules/--with/--target, use scripts/install-plan.js instead

Example fix

// before
node scripts/install-guided.js --modules core
// after
node scripts/install-guided.js --profile core
Defensive patterns

Strategy: validation

Validate before calling

const KNOWN = new Set(['--harness','--claude-scope','--claude-hooks','--profile','--all-harnesses','--yes','-y','--dry-run','--json','--help','-h']);
for (const a of argv) {
  if (a.startsWith('-') && !KNOWN.has(a)) throw new Error(`Unknown install-guided argument: ${a}`);
}

Type guard

function isKnownInstallGuidedArg(arg) {
  return ['--harness','--claude-scope','--claude-hooks','--profile','--all-harnesses','--yes','-y','--dry-run','--json','--help','-h'].includes(arg);
}

Try / catch

try { parseInstallGuidedArgs(argv); }
catch (err) {
  if (/^Unknown argument/.test(err.message)) {
    console.error(`${err.message}\nRun: node scripts/install-guided.js --help`);
    process.exit(2);
  }
  throw err;
}

Prevention

When it happens

Trigger: Passing --force, --target, --verbose, a typo like --harnes, or a flag that belongs to a different ECC command (e.g. --modules which is install-plan's flag).

Common situations: Mixing flags between install-guided and install-plan, using an outdated flag name, or a wrapper script passing the wrong option set.

Related errors


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