charmbracelet/gum · warning
no data provided
Error message
no data provided
What it means
Gum table requires tabular data: either via --file or piped through stdin. When neither is provided (stdin is empty), Run returns 'no data provided' before attempting to render.
Source
Thrown at table/command.go:33
"charm.land/lipgloss/v2"
ltable "charm.land/lipgloss/v2/table"
"golang.org/x/text/encoding"
"golang.org/x/text/encoding/unicode"
"golang.org/x/text/transform"
)
// Run provides a shell script interface for rendering tabular data (CSV).
func (o Options) Run() error {
var input *os.File
if o.File != "" {
var err error
input, err = os.Open(o.File)
if err != nil {
return fmt.Errorf("could not render file: %w", err)
}
} else {
if stdin.IsEmpty() {
return fmt.Errorf("no data provided")
}
input = os.Stdin
}
defer input.Close() //nolint: errcheck
transformer := unicode.BOMOverride(encoding.Nop.NewDecoder())
reader := csv.NewReader(transform.NewReader(input, transformer))
reader.LazyQuotes = o.LazyQuotes
reader.FieldsPerRecord = o.FieldsPerRecord
separatorRunes := []rune(o.Separator)
if len(separatorRunes) != 1 {
return fmt.Errorf("separator must be single character")
}
reader.Comma = separatorRunes[0]
writer := csv.NewWriter(os.Stdout)
writer.Comma = separatorRunes[0]
View on GitHub (pinned to 4d089f9550)
Solutions
- Pipe CSV data: `cat data.csv | gum table`.
- Use --file: `gum table --file data.csv`.
- Guard the pipeline: check the upstream output is non-empty before calling gum table.
- In scripts, verify `[ ! -s input.csv ]` conditions before invoking.
Example fix
// before grep "failed" report.csv | gum table # may be empty // after out=$(grep "failed" report.csv); [ -n "$out" ] && echo "$out" | gum table
Defensive patterns
Strategy: validation
Validate before calling
if [ ! -s data.csv ]; then echo "no data" >&2; exit 0; fi gum table --file data.csv
Try / catch
if ! out=$(cat data.csv | gum table); then echo "no/invalid data" >&2; fi
Prevention
- Verify input is non-empty ([ -s file ]) before piping
- Guard pipelines where upstream filters may match nothing
- Provide --file as an alternative to stdin
When it happens
Trigger: Running bare `gum table` with no piped input; an upstream command in a pipeline produced empty output (`grep nomatch data.csv | gum table`); feeding /dev/null.
Common situations: Scripting pipelines where a filter matched nothing; forgetting to redirect a file into stdin; automation running gum table non-interactively with no input attached.
Related errors
- provide some content to display
- no options provided, see `gum choose --help`
- no options provided, see `gum filter --help`
- separator must be single character
- nothing selected
AI-assisted analysis of charmbracelet/gum@4d089f9550 (2026-08-31).
Data as JSON: /api/errors/aa5e1ea9708d2ed2.
Report an issue: GitHub.