charmbracelet/gum · warning

no input provided, see `gum style --help`

Error message

no input provided, see `gum style --help`

What it means

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.

Source

Thrown at style/command.go:25

import (
	"errors"
	"strings"

	"charm.land/gum/v2/internal/stdin"
	"charm.land/gum/v2/internal/tty"
)

// Run provides a shell script interface for the Lip Gloss styling.
// https://github.com/charmbracelet/lipgloss
func (o Options) Run() error {
	var text string
	if len(o.Text) > 0 {
		text = strings.Join(o.Text, "\n")
	} else {
		text, _ = stdin.Read(stdin.StripANSI(o.StripANSI))
		if text == "" {
			return errors.New("no input provided, see `gum style --help`")
		}
	}
	if o.Trim {
		var lines []string
		for _, line := range strings.Split(text, "\n") {
			lines = append(lines, strings.TrimSpace(line))
		}
		text = strings.Join(lines, "\n")
	}
	tty.Println(o.Style.ToLipgloss().Render(text))
	return nil
}

View on GitHub (pinned to 4d089f9550)

Solutions

  1. Pass the text explicitly: `gum style --text "hello"` or `gum style hello`.
  2. Verify the upstream command actually emits output before piping into gum style.
  3. Check flag spelling — a misparsed flag can swallow the text argument; run `gum style --help`.
  4. Guard the pipeline: only call gum style if the variable/stream is non-empty.

Example fix

// before
result=$(gum style) // no args, empty stdin -> error
// after
result=$(gum style --text "$MESSAGE")
Defensive patterns

Strategy: validation

Validate before calling

[ -n "$MESSAGE" ] || { echo "no text to style" >&2; exit 1; }
result=$(gum style --text "$MESSAGE")

Try / catch

if ! result=$(gum style ${textargs:+--text "$textargs"}); then
  echo "gum style: ${result} — check arguments/stdin" >&2
fi

Prevention

When it happens

Trigger: 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.

Common situations: 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).

Related errors


AI-assisted analysis of charmbracelet/gum@4d089f9550 (2026-08-31). Data as JSON: /api/errors/debc0c71971954f7. Report an issue: GitHub.