Bubble Tea

Bubble Tea

Functional Go framework based on The Elm Architecture for building interactive, stateful terminal user interfaces (TUIs).

★ 45.9K

Build Polished Interactive Terminal Apps in Go With Bubble Tea

Writing terminal user interfaces from scratch usually dissolves into a tangle of ANSI escape codes, race conditions, and broken screen redraws. Bubble Tea by Charm brings the clean, predictable Elm Architecture (`Init`, `Update`, `View`) to Go so you can build stateful CLI apps that feel like modern desktop tools. With 45.9K GitHub stars, 1,900 forks, and over 18,000 applications built on it under the MIT license, it powers tools at AWS, Microsoft, NVIDIA, and Cockroach Labs.

Why CLI Builders Love Bubble Tea

  • Simple Model-Update-View Loop: Manage state cleanly in a Go struct while Bubble Tea handles event routing, diff rendering, and terminal cleanup automatically.
  • High-Performance Cell Renderer: Eliminates flicker with smart frame pacing, color profile downsampling, mouse tracking, focus events, and native clipboard support.
  • Rich Charm Ecosystem: Pair it with Bubbles for ready-made spinners, tables, and text inputs, plus Lip Gloss for expressive CSS-like terminal styling.
  • Inline or Full-Screen Flexibility: Build quick interactive prompts that live inline in scrollback or full-window dashboards that take over the screen.

Practical Caveats

Because Bubble Tea owns `stdin` and `stdout` while rendering, you must write debug logs to a file (`tea.LogToFile`) and attach Delve in headless mode when debugging. Long-running I/O must also be wrapped in `tea.Cmd` functions so you never block the UI event loop.

Quick Takeaway

If you are building a developer CLI or coding agent TUI in Go and want a fast, maintainable UI architecture, Bubble Tea is the undisputed standard.

Ready to try Bubble Tea?

Experience the full capabilities on their official website.

Visit Official Website