{"record":{"id":"debc0c71971954f7","repo":"charmbracelet/gum","slug":"no-input-provided-see-gum-style-help","errorCode":null,"errorMessage":"no input provided, see `gum style --help`","messagePattern":"no input provided, see `gum style --help`","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"style/command.go","lineNumber":25,"sourceCode":"\nimport (\n\t\"errors\"\n\t\"strings\"\n\n\t\"charm.land/gum/v2/internal/stdin\"\n\t\"charm.land/gum/v2/internal/tty\"\n)\n\n// Run provides a shell script interface for the Lip Gloss styling.\n// https://github.com/charmbracelet/lipgloss\nfunc (o Options) Run() error {\n\tvar text string\n\tif len(o.Text) > 0 {\n\t\ttext = strings.Join(o.Text, \"\\n\")\n\t} else {\n\t\ttext, _ = stdin.Read(stdin.StripANSI(o.StripANSI))\n\t\tif text == \"\" {\n\t\t\treturn errors.New(\"no input provided, see `gum style --help`\")\n\t\t}\n\t}\n\tif o.Trim {\n\t\tvar lines []string\n\t\tfor _, line := range strings.Split(text, \"\\n\") {\n\t\t\tlines = append(lines, strings.TrimSpace(line))\n\t\t}\n\t\ttext = strings.Join(lines, \"\\n\")\n\t}\n\ttty.Println(o.Style.ToLipgloss().Render(text))\n\treturn nil\n}\n","sourceCodeStart":7,"sourceCodeEnd":38,"githubUrl":"https://github.com/charmbracelet/gum/blob/4d089f95507708a71f64dacfe7ca513219dd5267/style/command.go#L7-L38","documentation":"gum style needs text to style: either positional `--text` arguments or piped stdin. When no arguments were given, Run reads stdin, and if that comes back empty it returns `no input provided, see \\`gum style --help\\``. The message also points at the command's help because empty input almost always means the arguments were wrong.","triggerScenarios":"Running `gum style` with no positional text and nothing (or only EOF) on stdin; piping an empty stream (`echo -n \"\" | gum style`); forgetting `--text` in scripted invocations.","commonSituations":"Scripts where an upstream command produced no output so the pipe into gum style is empty; typos in flags so the intended text was parsed as a flag value and Text stayed empty; calling gum style in CI with stdin closed (/dev/null).","solutions":["Pass the text explicitly: `gum style --text \"hello\"` or `gum style hello`.","Verify the upstream command actually emits output before piping into gum style.","Check flag spelling — a misparsed flag can swallow the text argument; run `gum style --help`.","Guard the pipeline: only call gum style if the variable/stream is non-empty."],"exampleFix":"// before\nresult=$(gum style) // no args, empty stdin -> error\n// after\nresult=$(gum style --text \"$MESSAGE\")","handlingStrategy":"validation","validationCode":"[ -n \"$MESSAGE\" ] || { echo \"no text to style\" >&2; exit 1; }\nresult=$(gum style --text \"$MESSAGE\")","typeGuard":null,"tryCatchPattern":"if ! result=$(gum style ${textargs:+--text \"$textargs\"}); then\n  echo \"gum style: ${result} — check arguments/stdin\" >&2\nfi","preventionTips":["Always pass text via --text or positional args in scripts.","Guard pipelines: only pipe into gum style when the upstream output is non-empty.","Run `gum style --help` to verify flag names before deploying scripts.","Remember stdin is read only when no text arguments are given."],"tags":["go","cli","missing-argument","stdin"],"backgroundTag":"missing-required-input","analyzedSha":"4d089f95507708a71f64dacfe7ca513219dd5267","analyzedAt":"2026-08-31T18:45:06.436Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}