{"record":{"id":"f3c4393d2288cd3e","repo":"Yeachan-Heo/oh-my-codex","slug":"missing-path-after-prompt-file","errorCode":null,"errorMessage":"Missing path after --prompt-file","messagePattern":"Missing path after --prompt-file","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"src/exec/followup.ts","lineNumber":383,"sourceCode":"  if (!sessionId) throw new Error(\"Usage: omx exec inject <session-id> --prompt <text> [--actor <name>] [--json]\");\n\n  let prompt = \"\";\n  let actor: string | undefined;\n  let json = false;\n  for (let i = 0; i < rest.length; i += 1) {\n    const arg = rest[i]!;\n    if (arg === \"--json\") {\n      json = true;\n    } else if (arg === \"--prompt\") {\n      const value = rest[i + 1];\n      if (!value) throw new Error(\"Missing value after --prompt\");\n      prompt = value;\n      i += 1;\n    } else if (arg.startsWith(\"--prompt=\")) {\n      prompt = arg.slice(\"--prompt=\".length);\n    } else if (arg === \"--prompt-file\") {\n      const value = rest[i + 1];\n      if (!value) throw new Error(\"Missing path after --prompt-file\");\n      prompt = readFileSyncForCli(value);\n      i += 1;\n    } else if (arg.startsWith(\"--prompt-file=\")) {\n      prompt = readFileSyncForCli(arg.slice(\"--prompt-file=\".length));\n    } else if (arg === \"--actor\") {\n      const value = rest[i + 1];\n      if (!value) throw new Error(\"Missing value after --actor\");\n      actor = value;\n      i += 1;\n    } else if (arg.startsWith(\"--actor=\")) {\n      actor = arg.slice(\"--actor=\".length);\n    } else if (!arg.startsWith(\"-\") && !prompt) {\n      prompt = [arg, ...rest.slice(i + 1)].join(\" \");\n      break;\n    } else {\n      throw new Error(`Unknown exec inject argument: ${arg}`);\n    }\n  }","sourceCodeStart":365,"sourceCodeEnd":401,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/exec/followup.ts#L365-L401","documentation":"Usage error from parseExecInjectArgs when `--prompt-file` appears as the final token and no path follows. The parser expects the next argument to be a file path to read the prompt from and throws when it is absent.","triggerScenarios":"Ending the command with a bare `--prompt-file`; a script passing `--prompt-file \"$FILE\"` where FILE is unset so no token follows; the path being consumed by an earlier flag leaving --prompt-file valueless.","commonSituations":"Prompt file path stored in an unset variable; CI step references an artifact path that wasn't produced; typo where the path is on the wrong side of a line continuation.","solutions":["Provide the path: `--prompt-file ./prompt.txt` or `--prompt-file=./prompt.txt`.","Assert the variable/file first: `[ -f \"$PROMPT_FILE\" ] || { echo \"missing prompt file\"; exit 1; }`.","Use the --prompt-file= form for explicitness.","If the file content may be empty, remember the prompt still must be non-empty after read or error missing_prompt applies."],"exampleFix":"# before\nomx exec inject \"$SESSION_ID\" --prompt-file\n\n# after\nomx exec inject \"$SESSION_ID\" --prompt-file ./followup-prompt.txt","handlingStrategy":"validation","validationCode":"if (!promptFile || !existsSync(promptFile)) throw new Error('prompt file path required and must exist');\nrunCli(['exec', 'inject', sessionId, '--prompt-file', promptFile]);","typeGuard":null,"tryCatchPattern":"catch (e) { if (e instanceof Error && e.message === 'Missing path after --prompt-file') { console.error('usage: --prompt-file <path>'); process.exit(2); } throw e; }","preventionTips":["Validate the file path variable and file existence before invoking.","Use --prompt-file=path form to avoid token-splitting issues."],"tags":["cli","usage-error","argument-parsing","file-input"],"backgroundTag":"missing-cli-option-value","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}