{"record":{"id":"74fee924fd67c54d","repo":"Yeachan-Heo/oh-my-codex","slug":"shell-requires-a-command-string-sparkshell-us","errorCode":null,"errorMessage":"--shell requires a command string.\n${SPARKSHELL_USAGE}","messagePattern":"--shell requires a command string\\.\n(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/sparkshell.ts","lineNumber":308,"sourceCode":"      continue;\n    }\n    return [...args.slice(index)];\n  }\n  return [];\n}\n\nexport function parseSparkShellFallbackInvocation(\n  args: readonly string[],\n  options: ParseSparkShellFallbackOptions = {},\n): SparkShellFallbackInvocation {\n  args = stripSparkShellWrapperOptions(args);\n  if (args.length === 0) {\n    throw new Error(`Missing command to run.\\n${SPARKSHELL_USAGE}`);\n  }\n\n  if (args[0] === '--shell') {\n    const script = args[1];\n    if (!script) throw new Error(`--shell requires a command string.\\n${SPARKSHELL_USAGE}`);\n    if (args.length !== 2) throw new Error(`--shell does not accept additional arguments.\\n${SPARKSHELL_USAGE}`);\n    return { kind: 'command', argv: resolveFallbackShellArgv(script, options) };\n  }\n  if (args[0]?.startsWith('--shell=')) {\n    const script = args[0].slice('--shell='.length);\n    if (!script.trim()) throw new Error(`--shell requires a command string.\\n${SPARKSHELL_USAGE}`);\n    if (args.length !== 1) throw new Error(`--shell does not accept additional arguments.\\n${SPARKSHELL_USAGE}`);\n    return { kind: 'command', argv: resolveFallbackShellArgv(script, options) };\n  }\n\n  const paneStart = args.findIndex((arg) => arg === '--tmux-pane' || arg.startsWith('--tmux-pane='));\n  if (paneStart < 0) {\n    return { kind: 'command', argv: [...args] };\n  }\n\n  let paneId: string | undefined;\n  let tailLines = 200;\n  let sawTailLines = false;","sourceCodeStart":290,"sourceCodeEnd":326,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/sparkshell.ts#L290-L326","documentation":"`--shell` was passed as its own token but the next argument (the command string) is missing, so there is nothing to execute in the shell. Usage text is appended.","triggerScenarios":"`omx sparkshell --shell` as the last args, or `--shell` followed by nothing before end of args.","commonSituations":"Truncated command line, quoting mistakes that swallow the script argument, or dynamic arg construction dropping the script value.","solutions":["Provide the script: `--shell \"npm test\"`","Or use the `=` form: `--shell=\"npm test\"` which fails separately if the value is blank","Check shell quoting when the script itself contains quotes"],"exampleFix":"# before\nomx sparkshell --shell\n# after\nomx sparkshell --shell \"npm test\"","handlingStrategy":"validation","validationCode":"const i = args.indexOf('--shell');\nconst ok = i === -1 || (i + 1 < args.length && args[i + 1].trim().length > 0);","typeGuard":null,"tryCatchPattern":"catch (e) { if (String(e).startsWith('--shell requires a command string')) { printUsage(); } else throw e; }","preventionTips":["Use --shell=\"script\" with a non-empty literal","Check interpolated variables are non-empty before building args"],"tags":["cli","sparkshell","shell","usage"],"backgroundTag":"missing-cli-option-value","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}