{"record":{"id":"1a2ef816513d3100","repo":"Yeachan-Heo/oh-my-codex","slug":"missing-value-after-codex-home","errorCode":null,"errorMessage":"Missing value after --codex-home.","messagePattern":"Missing value after --codex-home\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/index.ts","lineNumber":1258,"sourceCode":"\nexport interface ResumeCodexHomeSelection {\n  args: string[];\n  explicitCodexHome?: string;\n  projectOnly: boolean;\n}\n\nexport function parseResumeCodexHomeSelection(args: string[]): ResumeCodexHomeSelection {\n  const { omxArgs, suffix } = splitOmxArgsAtEndOfOptions(args);\n  const nextArgs: string[] = [];\n  let explicitCodexHome: string | undefined;\n  let projectOnly = false;\n\n  for (let index = 0; index < omxArgs.length; index += 1) {\n    const arg = omxArgs[index];\n    if (arg === \"--codex-home\") {\n      const value = omxArgs[index + 1];\n      if (!value || value.startsWith(\"-\")) {\n        throw new Error(\"Missing value after --codex-home.\");\n      }\n      explicitCodexHome = value;\n      index += 1;\n      continue;\n    }\n    if (arg.startsWith(\"--codex-home=\")) {\n      explicitCodexHome = arg.slice(\"--codex-home=\".length);\n      if (explicitCodexHome.trim() === \"\") {\n        throw new Error(\"Missing value after --codex-home.\");\n      }\n      continue;\n    }\n    if (arg === \"--project\") {\n      projectOnly = true;\n      continue;\n    }\n    nextArgs.push(arg);\n  }","sourceCodeStart":1240,"sourceCodeEnd":1276,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/index.ts#L1240-L1276","documentation":"--codex-home requires a path value as the next token. Thrown when --codex-home is last in omxArgs or the next token starts with `-`.","triggerScenarios":"`omx --codex-home` at end of args, or `--codex-home --project`.","commonSituations":"Scripts passing an unset env var that expands to empty; quoting mistakes.","solutions":["Append the path: `--codex-home /custom/path`","Use `--codex-home=/custom/path` inline form","Ensure the variable holding the path is non-empty"],"exampleFix":"# before\nomx --codex-home \"$CODEX_HOME\"\n# after\nCODEX_HOME=${CODEX_HOME:-$HOME/.codex} omx --codex-home=\"$CODEX_HOME\"","handlingStrategy":"validation","validationCode":"const i = args.indexOf('--codex-home');\nconst v = args[i + 1];\nif (!v || v.startsWith('-')) throw new Error('missing --codex-home value');","typeGuard":"const isNonFlagValue = (v: string | undefined): v is string => !!v && !v.startsWith('-') && v.trim() !== '';","tryCatchPattern":null,"preventionTips":["Default empty env vars: --codex-home=\"${CODEX_HOME:-$HOME/.codex}\""],"tags":["cli","missing-argument","codex-home","path"],"backgroundTag":"missing-cli-argument-value","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}