affaan-m/ECC · error
--all-harnesses and --harness are mutually exclusive.
Error message
--all-harnesses and --harness are mutually exclusive.
What it means
install-guided.js treats --all-harnesses and individual --harness selections as mutually exclusive. If both are present on the command line, it throws rather than trying to merge the two intents.
Source
Thrown at scripts/install-guided.js:106
? { ...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): `
: 'Choose one option: ';
const answer = (await terminal.question(question)).trim().toLowerCase();
if (!answer && defaultValue) return defaultValue;
const numeric = /^\d+$/.test(answer) ? values[Number(answer) - 1] : undefined;View on GitHub (pinned to 01e15490f0)
Solutions
- Use only --all-harnesses, or only one or more --harness flags
- Remove --all-harnesses from your wrapper when a specific harness is requested
- If you want a subset, drop --all-harnesses and list each harness explicitly
Example fix
// before node scripts/install-guided.js --all-harnesses --harness claude --yes // after node scripts/install-guided.js --harness claude --yes
Defensive patterns
Strategy: validation
Validate before calling
const hasAll = argv.includes('--all-harnesses');
const harnessCount = argv.filter(a => a === '--harness').length;
if (hasAll && harnessCount > 0) {
throw new Error('Use --all-harnesses OR --harness, not both');
} Type guard
function isExclusiveHarnessSelection(argv) {
const all = argv.includes('--all-harnesses');
const specific = argv.filter(a => a === '--harness').length;
return !(all && specific > 0);
} Try / catch
try { parseInstallGuidedArgs(argv); }
catch (err) {
if (/mutually exclusive/.test(err.message)) {
console.error(err.message);
process.exit(2);
}
throw err;
} Prevention
- Decide upfront between all-harnesses and explicit selection
- Audit base CI templates that always add --all-harnesses
- Document the chosen mode in the wrapper script
When it happens
Trigger: Running node scripts/install-guided.js --all-harnesses --harness claude, or a wrapper that always adds --all-harnesses while also forwarding user-selected harnesses.
Common situations: A CI template that sets --all-harnesses globally and a user override adding --harness; or copy-pasting a base command and appending a specific harness.
Related errors
- Missing value for ${argument}
- Value for ${argument} is too long.
- Unknown argument: ${arg}
- Unknown argument: ${arg}
- --timeout-ms must be a positive number
AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13).
Data as JSON: /api/errors/7053211ff8b28b32.
Report an issue: GitHub.