{"record":{"id":"ab73150912268b82","repo":"Yeachan-Heo/oh-my-codex","slug":"write-is-only-supported-with-omx-adapt-target","errorCode":null,"errorMessage":"--write is only supported with omx adapt <target> init","messagePattern":"--write is only supported with omx adapt <target> init","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/adapt.ts","lineNumber":162,"sourceCode":"\tif (!descriptor) {\n\t\tthrow new Error(\n\t\t\t`Unknown adapt target: ${target}. Supported targets: ${supportedAdaptTargets().join(\", \")}`,\n\t\t);\n\t}\n\n\tif (!subcommand) {\n\t\tstdout(targetHelp(descriptor.target));\n\t\treturn;\n\t}\n\n\tif (!ADAPT_SUBCOMMANDS.includes(subcommand as AdaptSubcommand)) {\n\t\tthrow new Error(\n\t\t\t`Unknown adapt subcommand: ${subcommand}. Supported subcommands: ${ADAPT_SUBCOMMANDS.join(\", \")}`,\n\t\t);\n\t}\n\n\tif (write && subcommand !== \"init\") {\n\t\tthrow new Error(\"--write is only supported with omx adapt <target> init\");\n\t}\n\n\tswitch (subcommand as AdaptSubcommand) {\n\t\tcase \"probe\":\n\t\t\trender(\n\t\t\t\tawait buildAdaptProbeReportForTarget(cwd, descriptor.target),\n\t\t\t\tjson,\n\t\t\t\tstdout,\n\t\t\t);\n\t\t\treturn;\n\t\tcase \"status\":\n\t\t\trender(\n\t\t\t\tawait buildAdaptStatusReportForTarget(cwd, descriptor.target),\n\t\t\t\tjson,\n\t\t\t\tstdout,\n\t\t\t);\n\t\t\treturn;\n\t\tcase \"init\":","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/adapt.ts#L144-L180","documentation":"The `--write` flag is only meaningful for `omx adapt <target> init`, which materializes files. Passing it with any other subcommand (e.g. probe) is rejected because there is nothing to write. This is a usage guard, not a runtime failure.","triggerScenarios":"Running `omx adapt github probe --write` or combining --write with any non-init subcommand.","commonSituations":"Copy-pasting a full command including --write, or assuming all subcommands support dry-run/write modes.","solutions":["Remove --write when using non-init subcommands","If you intended to write files, use the init subcommand"],"exampleFix":"# before\nomx adapt github probe --write\n\n# after\nomx adapt github probe\n# or, to write files:\nomx adapt github init --write","handlingStrategy":"validation","validationCode":"if (write && subcommand !== 'init') {\n  console.error('--write is only valid with init');\n  process.exit(2);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Reserve --write for init invocations","Parameterize scripts so flags are attached to the right subcommand"],"tags":["cli","adapt","flag-misuse","usage"],"backgroundTag":"invalid-flag-combination","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}