{"record":{"id":"fdbaf9ac1c519e17","repo":"can1357/oh-my-pi","slug":"in-place-and-out-are-mutually-exclusive","errorCode":null,"errorMessage":"--in-place and --out are mutually exclusive","messagePattern":"--in-place and --out are mutually exclusive","errorType":"validation","errorClass":"CliUsageError","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/commands/compress.ts","lineNumber":34,"sourceCode":"\t\tagents: Flags.integer({ char: \"n\", description: \"Files compressed concurrently\", default: 4 }),\n\t\tmodel: Flags.string({ char: \"m\", description: \"Model selector\" }),\n\t};\n\n\tstatic examples = [\n\t\t\"omp compress prompts/tools/read.md\",\n\t\t\"omp compress notes.md -o notes.compressed.md\",\n\t\t\"omp compress 'src/prompts/**/*.md' -i\",\n\t\t\"omp compress a.md b.md c.md -i -n 8\",\n\t\t\"omp compress spec.md -r 5 -m opus\",\n\t];\n\n\tasync run(): Promise<void> {\n\t\tconst { args, flags } = await this.parse(Compress);\n\t\tconst files = args.files ?? [];\n\t\tif (files.length === 0) throw new CliUsageError(\"compress requires at least one file or glob pattern\");\n\t\tif (flags.rounds <= 0) throw new CliUsageError(\"--rounds must be a positive integer\");\n\t\tif (flags.agents <= 0) throw new CliUsageError(\"--agents must be a positive integer\");\n\t\tif (flags.inPlace && flags.out) throw new CliUsageError(\"--in-place and --out are mutually exclusive\");\n\t\tconst result = await runCompressCommand({\n\t\t\tfiles,\n\t\t\tmodel: flags.model,\n\t\t\tmaxRounds: flags.rounds,\n\t\t\tconcurrency: flags.agents,\n\t\t\toutput: flags.out,\n\t\t\tinPlace: flags.inPlace,\n\t\t});\n\t\tawait postmortem.quit(result.exitCode);\n\t}\n}\n","sourceCodeStart":16,"sourceCodeEnd":46,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/commands/compress.ts#L16-L46","documentation":"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.","triggerScenarios":"'omp compress spec.md --in-place --out result.md'; wrappers that always append --out while a user also adds --in-place.","commonSituations":"Combining a personal alias/script default (--out always set) with a manually typed --in-place; migrating scripts where the output mode changed mid-flight.","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"],"exampleFix":"// before\nomp compress spec.md --in-place --out result.md\n// after\nomp compress spec.md --in-place   # or: omp compress spec.md --out result.md","handlingStrategy":"validation","validationCode":"const flags = { inPlace: true, out: 'result.md' };\nif (flags.inPlace && flags.out) {\n  throw new Error('choose one output mode: --in-place or --out, not both');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await Compress.run(rawArgs);\n} catch (err) {\n  if (err instanceof CliUsageError && err.message.includes('mutually exclusive')) {\n    console.error('Use --in-place OR --out, not both.');\n    process.exitCode = 1;\n  } else throw err;\n}","preventionTips":["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"],"tags":["cli","usage","conflicting-flags"],"backgroundTag":"mutually-exclusive-flags","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}