Configs2026年4月12日·1 分钟阅读

Bubble Tea — Powerful TUI Framework for Go

Bubble Tea is a powerful little TUI framework for Go based on The Elm Architecture. Build terminal applications with composable components, events, and commands. Part of the Charm ecosystem (Lip Gloss, Gum, Wish, Huh). Powers lazygit, soft-serve, and many CLI tools.

介绍

Bubble Tea is a Go framework for building terminal user interfaces based on The Elm Architecture (Model-Update-View). Part of the Charm ecosystem that also includes Lip Gloss (styling), Bubbles (components), Gum (CLI scripting), and Huh (forms). Used in lazygit, soft-serve, glow, and many Go CLI tools.

What Bubble Tea Does

  • Elm Architecture — Model, Update, View pattern
  • Components — via Bubbles library (text input, spinner, table, list, paginator)
  • Styling — via Lip Gloss (colors, borders, alignment)
  • Mouse support — click and scroll events
  • Async commands — Cmd pattern for side effects
  • Sub-programs — compose multiple TUI programs
  • Renderer — efficient diff-based terminal rendering
  • Cross-platform — Windows, macOS, Linux

Comparison

TUI Framework Language Architecture
Bubble Tea Go Elm (MVU)
Ratatui Rust Immediate mode
Textual Python Widget tree
Ink TypeScript React-like
cursive Rust Callback

FAQ

Q: What is the Elm Architecture? A: Unidirectional data flow: Model (state) → View (render) → Update (handle messages) → new Model. Concise and testable.

Q: Relationship with other Charm tools? A: Bubble Tea is the core framework; Bubbles provides prebuilt components; Lip Gloss handles styling; Gum lets you use Charm components in shell scripts; Huh is a form library.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产