{"record":{"id":"5dd89aa4deec8b6b","repo":"Yeachan-Heo/oh-my-codex","slug":"unknown-adapt-argument-arg","errorCode":null,"errorMessage":"Unknown adapt argument: ${arg}","messagePattern":"Unknown adapt argument: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/adapt.ts","lineNumber":100,"sourceCode":"\t\t\tcontinue;\n\t\t}\n\t\tif (arg === \"--write\") {\n\t\t\twrite = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (arg === \"--help\" || arg === \"-h\" || arg === \"help\") {\n\t\t\twantsHelp = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (!target) {\n\t\t\ttarget = arg;\n\t\t\tcontinue;\n\t\t}\n\t\tif (!subcommand) {\n\t\t\tsubcommand = arg;\n\t\t\tcontinue;\n\t\t}\n\t\tthrow new Error(`Unknown adapt argument: ${arg}`);\n\t}\n\n\treturn { target, subcommand, json, write, wantsHelp };\n}\n\nfunction render(\n\tvalue: unknown,\n\tjson: boolean,\n\tstdout: (line: string) => void,\n): void {\n\tstdout(JSON.stringify(value, null, json ? 0 : 2));\n}\n\nexport interface AdaptCommandDependencies {\n\tcwd?: string;\n\tstdout?: (line: string) => void;\n}\n","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/adapt.ts#L82-L118","documentation":"The `omx adapt` CLI argument parser encountered a positional or flag token it cannot assign: the first positional becomes the target, the second the subcommand, and any further positional argument falls through to this error. It signals a malformed command line such as three positionals or an unrecognized trailing token.","triggerScenarios":"Running e.g. `omx adapt foo bar baz` (third positional), or passing an unknown flag/typo after the target and subcommand.","commonSituations":"Typos in subcommand names, copying a longer command from docs of a different version, or assuming a flag exists (e.g. --dry-run) that this CLI does not support.","solutions":["Run `omx adapt --help` (or no args) to see the expected `adapt <target> <subcommand>` form","Remove the extra positional or unsupported flag","Check spelling of target and subcommand against the help output"],"exampleFix":"# before\nomx adapt github init extra\n\n# after\nomx adapt github init","handlingStrategy":"validation","validationCode":"const valid = args.filter(a => !a.startsWith('-'));\nif (valid.length > 2) {\n  console.error('usage: omx adapt <target> [subcommand]');\n  process.exit(2);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Limit adapt invocations to at most two positional arguments","Consult `omx adapt --help` before scripting","Wrap CLI calls in scripts and validate exit codes"],"tags":["cli","argument-parsing","usage"],"backgroundTag":"invalid-command-line-argument","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}