can1357/oh-my-pi · error · CliUsageError
--in-place and --out are mutually exclusive
Error message
--in-place and --out are mutually exclusive
What it means
omp compress can write results either back to the original files (--in-place) or to a path given by --out. Using both at once is ambiguous about the destination, so the command rejects the combination with a CliUsageError.
Source
Thrown at packages/coding-agent/src/commands/compress.ts:34
agents: Flags.integer({ char: "n", description: "Files compressed concurrently", default: 4 }),
model: Flags.string({ char: "m", description: "Model selector" }),
};
static examples = [
"omp compress prompts/tools/read.md",
"omp compress notes.md -o notes.compressed.md",
"omp compress 'src/prompts/**/*.md' -i",
"omp compress a.md b.md c.md -i -n 8",
"omp compress spec.md -r 5 -m opus",
];
async run(): Promise<void> {
const { args, flags } = await this.parse(Compress);
const files = args.files ?? [];
if (files.length === 0) throw new CliUsageError("compress requires at least one file or glob pattern");
if (flags.rounds <= 0) throw new CliUsageError("--rounds must be a positive integer");
if (flags.agents <= 0) throw new CliUsageError("--agents must be a positive integer");
if (flags.inPlace && flags.out) throw new CliUsageError("--in-place and --out are mutually exclusive");
const result = await runCompressCommand({
files,
model: flags.model,
maxRounds: flags.rounds,
concurrency: flags.agents,
output: flags.out,
inPlace: flags.inPlace,
});
await postmortem.quit(result.exitCode);
}
}
View on GitHub (pinned to 9690622007)
Solutions
- Pick one destination mode: drop --out to modify files in place, or drop --in-place to write to the --out path
- If the script needs both behaviors, branch on a mode flag instead of passing both
- Update wrapper scripts so they do not unconditionally inject --out
Example fix
// before omp compress spec.md --in-place --out result.md // after omp compress spec.md --in-place # or: omp compress spec.md --out result.md
Defensive patterns
Strategy: validation
Validate before calling
const flags = { inPlace: true, out: 'result.md' };
if (flags.inPlace && flags.out) {
throw new Error('choose one output mode: --in-place or --out, not both');
} Try / catch
try {
await Compress.run(rawArgs);
} catch (err) {
if (err instanceof CliUsageError && err.message.includes('mutually exclusive')) {
console.error('Use --in-place OR --out, not both.');
process.exitCode = 1;
} else throw err;
} Prevention
- Keep output mode in a single variable, not two independent flags
- Audit wrapper scripts that unconditionally append --out or --in-place
- Document the mutually exclusive pair in any internal tooling help
When it happens
Trigger: 'omp compress spec.md --in-place --out result.md'; wrappers that always append --out while a user also adds --in-place.
Common situations: Combining a personal alias/script default (--out always set) with a manually typed --in-place; migrating scripts where the output mode changed mid-flight.
Related errors
- --canary and --stable are mutually exclusive
- Choose either --user or --project, not both.
- --trusted-extension cannot be combined with --extension, -e,
- Usage: omp auth-broker import <file|dir> [--provider=<id>] [
- `omp auth-broker migrate` requires an explicit source. Pass
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/fdbaf9ac1c519e17.
Report an issue: GitHub.