affaan-m/ECC · error · Error

Kimi requires an explicit --profile choice in this mode.

Error message

Kimi requires an explicit --profile choice in this mode.

What it means

validateExecutionMode() requires an explicit --profile whenever the 'kimi' harness is selected in non-interactive or --json mode. Since no interactive prompt can choose the Kimi profile, the caller must pass --profile; otherwise the script throws to avoid installing Kimi with an unintended configuration.

Solutions

  1. Add --profile <value> to the command for the desired Kimi profile.
  2. Remove --harness kimi if Kimi installation is not intended.
  3. Ensure the PROFILE variable in wrapper scripts is non-empty before invoking.

Example fix

// before
node scripts/install-guided.js --harness kimi --yes
// after
node scripts/install-guided.js --harness kimi --profile default --yes
Defensive patterns

Strategy: validation

Validate before calling

if (harnesses.includes('kimi') && !profile) { throw new Error('kimi needs --profile'); }

Try / catch

try { main(); } catch (e) { if (/Kimi requires an explicit --profile/.test(e.message)) { console.error('Supply --profile <name> when kimi is selected'); process.exit(2); } throw e; }

Prevention

When it happens

Trigger: Non-interactive or JSON-mode run where options.harnesses includes 'kimi' and options.profile is falsy (--profile not provided).

Common situations: CI jobs adding kimi to the harness list; users copying a claude-only non-interactive command and appending --harness kimi without the profile flag; scripts where the profile variable is empty/unset.

Understand the failure class

Background: "Must pass :limit option" / "Missing required option" — required option errors explained — this error's family across 41 libraries.

Related errors


AI-assisted analysis of affaan-m/ECC@8321021c54 (2026-09-16). Data as JSON: /api/errors/159b334f4d5a9622. Report an issue: GitHub.

Appendix: source

Thrown at scripts/install-guided.js:196

}

function selectedHarnessIds(options) {
  if (options.allHarnesses) return normalizeHarnessSelection(['all']);
  if (options.harnesses.length === 0) return [];
  return normalizeHarnessSelection(options.harnesses);
}

function validateExecutionMode(options, interactive) {
  const harnesses = selectedHarnessIds(options);
  if (!interactive && harnesses.length === 0) {
    throw new Error('Non-interactive guided install requires at least one --harness.');
  }
  const requiresExplicit = !interactive || options.json;
  if (requiresExplicit && harnesses.includes('claude') && (!options.claudeScope || !options.claudeHooks)) {
    throw new Error('Claude requires explicit --claude-scope and --claude-hooks choices in this mode.');
  }
  if (requiresExplicit && harnesses.includes('kimi') && !options.profile) {
    throw new Error('Kimi requires an explicit --profile choice in this mode.');
  }
  if ((!interactive || options.json) && !options.yes && !options.dryRun) {
    throw new Error('Non-interactive and JSON mutations require --yes.');
  }
}

function printPlan(plan, output) {
  output.write('\nECC guided install preview\n\n');
  output.write('Harness       Channel           Destination\n');
  for (const entry of plan.harnesses) {
    const harness = getHarnessCapability(entry.id);
    output.write(`${harness.label.padEnd(13)} ${entry.channel.padEnd(17)} ${harness.destination}\n`);
  }
  if (plan.request.harnesses.includes('kimi')) {
    output.write('\nKimi note: ECC hooks are not configured; model, provider, and authentication settings are unchanged.\n');
  }
  if (plan.request.harnesses.includes('claude') && plan.request.claudeHooks && plan.request.claudeHooks !== 'off') {
    output.write(

View on GitHub (pinned to 8321021c54)