yamadashy/repomix · error · RepomixError
${options[optionA].name} cannot be used with ${options[optio
Error message
${options[optionA].name} cannot be used with ${options[optionB].name}. ${message} What it means
validateConflictingOptions checks a table of mutually exclusive option pairs and throws this templated error when both flags in a pair are enabled, e.g. --skill-generate with --stdout (skill output must be written to the filesystem) or --skill-generate with --copy (a skill directory cannot go to the clipboard). It runs at the start of runDefaultAction so conflicts fail before any packing (src/cli/actions/defaultAction.ts:471).
Source
Thrown at src/cli/actions/defaultAction.ts:471
},
copy: {
enabled: config.output.copyToClipboard,
name: '--copy',
},
};
// Define conflicts: [optionA, optionB, errorMessage]
const conflicts: [keyof typeof options, keyof typeof options, string][] = [
['splitOutput', 'stdout', 'Split output requires writing to filesystem.'],
['splitOutput', 'skillGenerate', 'Skill output is a directory.'],
['splitOutput', 'copy', 'Split output generates multiple files.'],
['skillGenerate', 'stdout', 'Skill output requires writing to filesystem.'],
['skillGenerate', 'copy', 'Skill output is a directory and cannot be copied to clipboard.'],
];
for (const [optionA, optionB, message] of conflicts) {
if (options[optionA].enabled && options[optionB].enabled) {
throw new RepomixError(`${options[optionA].name} cannot be used with ${options[optionB].name}. ${message}`);
}
}
};
View on GitHub (pinned to f465ad9093)
Solutions
- Pick one output mode: keep --skill-generate and remove --stdout/--copy.
- If you need stdout or clipboard output, remove --skill-generate and pack normally.
- Inspect the resolved flags (echo the command, or run with minimal flags) to find which two conflicting flags are both being set, including flags inherited from wrapper scripts.
Example fix
# before repomix --skill-generate --skill-output ./skill --stdout # after repomix --skill-generate --skill-output ./skill
Defensive patterns
Strategy: validation
Validate before calling
const conflicts = [['--skill-generate', '--stdout'], ['--skill-generate', '--copy']];
for (const [a, b] of conflicts) {
if (args.includes(a) && args.includes(b)) throw new Error(`${a} and ${b} are mutually exclusive`);
} Try / catch
try {
await repomixRun(args);
} catch (e) {
const m = String(e.message).match(/^(.+) cannot be used with (.+)\./);
if (m) throw new Error(`Remove either ${m[1]} or ${m[2]} from the command`);
throw e;
} Prevention
- Decide on one output mode (skill dir, stdout, clipboard, file) per invocation.
- Avoid merging flag fragments from multiple example commands.
- When wrapping repomix in scripts, let callers pick an output mode and assert only one is set.
When it happens
Trigger: `repomix --skill-generate --stdout`; `repomix --skill-generate --copy`; any other pair in the conflicts table where options[optionA].enabled && options[optionB].enabled, including conflicts enabled indirectly via config or multiple flags (e.g. --stdout implied by other settings).
Common situations: Long command lines assembled from different examples where two output targets accumulate; CI configs merging shared flag fragments; users assuming skill output can also be piped or copied like normal pack output.
Related errors
- --skill-output can only be used with --skill-generate
- --force can only be used with --skill-generate
- --skill-project-name can only be used with --skill-generate
- --skill-output path cannot be empty
- --skill-project-name cannot be empty
AI-assisted analysis of yamadashy/repomix@f465ad9093 (2026-08-29).
Data as JSON: /api/errors/7a70189e7e46035a.
Report an issue: GitHub.