{"record":{"id":"6d8707a14547980e","repo":"Yeachan-Heo/oh-my-codex","slug":"missing-brief-text-pass-brief-brief-file","errorCode":null,"errorMessage":"Missing brief text. Pass --brief, --brief-file, --from-stdin, or positional text.","messagePattern":"Missing brief text\\. Pass --brief, --brief-file, --from-stdin, or positional text\\.","errorType":"exception","errorClass":"UltragoalError","httpStatus":null,"severity":"error","filePath":"src/cli/ultragoal.ts","lineNumber":385,"sourceCode":"  const json = hasFlag(rest, '--json');\n  const cwd = process.cwd();\n  const buildGoalInstruction = deps.buildCodexGoalInstruction ?? buildCodexGoalInstruction;\n\n  try {\n    if (command === 'help' || command === '--help' || command === '-h') {\n      console.log(ULTRAGOAL_HELP);\n      return;\n    }\n\n    assertUltragoalMutationAllowedFromCurrentProcess(command);\n\n    if (command === 'create' || command === 'create-goals') {\n      const briefFile = readValue(rest, '--brief-file');\n      const brief = readValue(rest, '--brief')\n        ?? (briefFile ? await readFile(briefFile, 'utf-8') : undefined)\n        ?? (hasFlag(rest, '--from-stdin') ? await readStdin() : undefined)\n        ?? positionalText(rest);\n      if (!brief.trim()) throw new UltragoalError('Missing brief text. Pass --brief, --brief-file, --from-stdin, or positional text.');\n      const goals = readRepeated(rest, '--goal').map(parseGoalArg);\n      const plan = await createUltragoalPlan(cwd, {\n        brief,\n        goals,\n        codexGoalMode: normalizeCodexGoalMode(readValue(rest, '--codex-goal-mode')),\n        force: hasFlag(rest, '--force'),\n      });\n      if (json) printJson({ ok: true, plan, summary: summarizeUltragoalPlan(plan) });\n      else {\n        console.log(`ultragoal plan created: ${plan.goals.length} goal(s)`);\n        console.log(`brief: ${plan.briefPath}`);\n        console.log(`goals: ${plan.goalsPath}`);\n        console.log(`ledger: ${plan.ledgerPath}`);\n      }\n      return;\n    }\n\n    if (command === 'status') {","sourceCodeStart":367,"sourceCodeEnd":403,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/ultragoal.ts#L367-L403","documentation":"The create/create-goals subcommand requires brief text and looks for it in order: --brief, --brief-file (file contents), --from-stdin (piped input), then positional text. If none yields non-whitespace text, it throws this error listing all four sources.","triggerScenarios":"Running `omx ultragoal create` with no brief flags; --brief-file pointing at an empty file (empty string fails the trim check); --from-stdin with empty stdin (no pipe attached); positional text being only whitespace.","commonSituations":"Forgetting the flag assuming a prompt appears; CI job with stdin closed so --from-stdin reads ''; wrong path making briefFile undefined; trailing-newline-only file.","solutions":["Pass `--brief \"...\"` directly, or `--brief-file brief.md` with a non-empty file, or pipe stdin with --from-stdin","Verify the file is non-empty: `wc -c brief.md` should be > 0","In CI, ensure stdin is provided (`echo b | omx ultragoal create --from-stdin`) or use a flag"],"exampleFix":"# before\nomx ultragoal create\n# Error: Missing brief text. Pass --brief, --brief-file, --from-stdin, or positional text.\n\n# after\nomx ultragoal create --brief \"Ship v2 API with auth and tests\"","handlingStrategy":"validation","validationCode":"const brief = flag('--brief') ?? (briefFile ? readFileSync(briefFile, 'utf-8') : '') ;\nif (!brief.trim()) { console.error('provide non-empty --brief/--brief-file or pipe stdin'); process.exit(2); }","typeGuard":"function hasBriefText(v: string | undefined): v is string {\n  return !!v && v.trim().length > 0;\n}","tryCatchPattern":null,"preventionTips":["Assert file size > 0 before using --brief-file","In CI pipe stdin explicitly or pass --brief","Fail fast in scripts on empty env vars feeding the brief"],"tags":["cli","ultragoal","missing-argument"],"backgroundTag":"missing-required-cli-flag","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}