{"record":{"id":"b59f083e3048001e","repo":"Yeachan-Heo/oh-my-codex","slug":"missing-path-value-after-input-file","errorCode":null,"errorMessage":"Missing path value after --input-file","messagePattern":"Missing path value after --input-file","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/state.ts","lineNumber":117,"sourceCode":"      continue;\n    }\n    if (arg === '--input') {\n      const next = args[index + 1];\n      if (!next) {\n        throw new Error('Missing JSON value after --input');\n      }\n      inputValue = next;\n      index += 1;\n      continue;\n    }\n    if (arg.startsWith('--input=')) {\n      inputValue = arg.slice('--input='.length);\n      continue;\n    }\n    if (arg === '--input-file') {\n      const next = args[index + 1];\n      if (!next) {\n        throw new Error('Missing path value after --input-file');\n      }\n      inputFileValue = next;\n      index += 1;\n      continue;\n    }\n    if (arg.startsWith('--input-file=')) {\n      inputFileValue = arg.slice('--input-file='.length);\n      continue;\n    }\n    if (arg === '--mode') {\n      const next = args[index + 1];\n      if (!next) {\n        throw new Error('Missing value after --mode');\n      }\n      modeValue = next;\n      index += 1;\n      continue;\n    }","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/state.ts#L99-L135","documentation":"The --input-file flag was the last token: no path followed it, so the state command cannot read the JSON file. This mirrors the --input check for the file-based variant.","triggerScenarios":"`state set --input-file` at end of args, e.g. `state set --input-file \"$PATH_TO_JSON\"` with an unset variable.","commonSituations":"Unset environment variables expanding to nothing; script loops generating the command with an empty filename on the last iteration.","solutions":["Supply the path: `state set --input-file ./state.json`","Check the variable is set and the file exists before running: `[ -f \"$F\" ] || exit 1`"],"exampleFix":"# before\nstate set --input-file  # $F unset\n# after\nF=./state.json\nstate set --input-file \"$F\"","handlingStrategy":"validation","validationCode":"import { existsSync } from 'node:fs';\nif (!file || !existsSync(file)) throw new Error(`input file missing: ${file}`);\nspawn('state', ['set', '--input-file', file]);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Assert `[ -f \"$F\" ]` before building the command","Prefer --input-file over --input to dodge shell quoting issues"],"tags":["cli","json","file","argument-validation"],"backgroundTag":"missing-cli-argument","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}