golang-tui

Implements terminal user interfaces in Go using Bubble Tea, Lip Gloss, and Bubbles.

1|Updated Mar 27, 2026
One-click install
npx skills add https://github.com/lrstanley/skills --skill golang-tui-lrstanley
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: golang-tui
Source: https://github.com/lrstanley/skills/tree/main/golang-tui
Command: npx skills add https://github.com/lrstanley/skills --skill golang-tui-lrstanley

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building terminal user interfaces in Go requires deep knowledge of the Elm Architecture, Charm library APIs, terminal capability detection, and layout math, and mistakes like blocking in Update or miscounting ANSI string widths cause frozen or broken UIs. ## Core Features & Use Cases - Elm Architecture Guidance: Enforces correct Init/Update/View patterns, command-based async I/O, and non-blocking Update loops for Bubble Tea v2 applications. - Component & Layout Patterns: Provides child model composition, dialog overlays, focus routing, weight-based layouts, and border-aware width calculations using Lip Gloss. - Terminal Compatibility & Testing: Covers color profile detection, bracketed paste, Kitty keyboard, clipboard via OSC 52, and snapshot testing with teatest, go-snaps, and golden files. - Use Case: When building a Go CLI dashboard with lists, spinners, and dialogs, load this skill to scaffold the project structure, wire keymaps centrally, and avoid common rendering and performance pitfalls. ## Quick Start Use the golang-tui skill to build a fullscreen Bubble Tea v2 app with a list component, centralized keybindings, and theme-aware styling.

Frequently Asked Questions about golang-tui

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a TUI in Go with Bubble Tea?▼

Define a model struct, implement Init, Update, and View methods following the Elm Architecture, then run it with tea.NewProgram. Handle tea.WindowSizeMsg for dimensions and wrap all I/O in tea.Cmd functions so Update never blocks.

How do I style terminal output with Lip Gloss?▼

Define lipgloss.Style values at package level and apply them with Render, using Width, borders, padding, and JoinHorizontal or JoinVertical for layout. Use lipgloss.Width or ansi.StringWidth instead of len() to measure styled strings correctly.

Why does my Bubble Tea app freeze or show a blank screen?▼

Freezing usually means blocking I/O or time.Sleep inside Update; move that work into a tea.Cmd. A blank screen typically means WindowSizeMsg was not handled, leaving components with zero dimensions.

How do I test Bubble Tea components with snapshot testing?▼

Use teatest for integration tests and go-snaps or go-snap with golden files for snapshot testing of rendered output. Pin TERM and color profile in tests so ANSI sequences stay deterministic across runs.

Does Bubble Tea support clipboard copy and paste?▼

Yes, tea.SetClipboard writes via OSC 52 and tea.PasteMsg delivers bracketed paste content. For wider coverage, combine OSC 52 with a native clipboard library like atotto/clipboard as a fallback.

When should I not use Bubble Tea for a terminal app?▼

Avoid it for simple one-shot scripts where plain stdout output suffices, or when targeting environments that strip escape sequences like old multiplexers without passthrough. Heavy raster image rendering may also hurt frame time in latency-sensitive TUIs.