charmbracelet/bubbletea
Developer ToolsA Go framework for building interactive terminal apps with the Elm Architecture, suitable for both simple and complex TUIs.
What it is
Bubble Tea is a Go framework for building terminal user interfaces, modeled on The Elm Architecture. Applications are built around a model that holds state plus three methods: Init returns an optional startup command, Update reacts to incoming messages and returns the changed model, and View renders the UI as a tea.View. The runtime owns redrawing, so you describe the whole view rather than patching the screen.
The framework targets both inline and full-window terminal programs and ships a cell-based renderer, color downsampling, declarative views, keyboard and mouse handling, and native clipboard support. It is the base layer of the Charm stack; common widgets live in Bubbles, while Lip Gloss handles styling and layout.
Quick start
You need a working Go toolchain and basic Go knowledge. Add the v2 module to a project with:
go get charm.land/bubbletea/v2@latest
Then mirror the shopping-list structure from the basic tutorial source: define a model struct, an initialModel() constructor, and the three methods. Update switches on tea.KeyPressMsg and returns tea.Quit for ctrl+c or q; View builds a string and returns tea.NewView(s). Finally start the program:
p := tea.NewProgram(initialModel())
if _, err := p.Run(); err != nil {
// handle error
}
Running the binary shows an interactive list where j/k or the arrow keys move the cursor, space toggles selection, and q exits. I/O commands, timers and server responses are covered in the commands tutorial, and runnable programs are in the examples directory.
Constraints and practical notes
- The API described here is v2 (
charm.land/bubbletea/v2). Projects on v1 should read the v2 upgrade guide before migrating. - Because the app owns stdin and stdout, ordinary logging to stdout does not work; use
tea.LogToFileand tail the log file instead. Debugging with Delve requires headless mode plus a separate client connection, as documented in the README. - License is MIT. Terminal UIs are portable across platforms and SSH sessions, but image display and screen-reader support in complex layouts remain weak spots, as HN commenters noted in the 2022 discussion (source:12).
HotRepo's take
The repository has a weekly Go-list snapshot dated 2026-12-04 showing 46,027 stars, 1,829 forks and 157 stars gained that week, at position 16 on that language list. No all-language daily rank or star-curve samples are recorded, so the available data supports only that weekly Go-list placement, not a broader trend. Discussion around the framework also includes recurring requests for bindings outside Go (source:13), which is consistent with it being a Go-first tool rather than a language-neutral one.
Written by AI from the project's public information and HotRepo's records, updated . The project's own docs are the source of truth.
Hacker News
You might also like
- ratatui/ratatuiA Rust library for building interactive terminal user interfaces, dashboard and console apps.
- unstablebuild/runeA GPU-accelerated IDE and terminal multiplexer with a peer network for remote workspaces and coding agents.
- vuejs/vueProgressive JavaScript framework for building user interfaces, now in end-of-life Vue 2.
- 1jehuang/jcodeA Rust terminal coding agent optimized for running many parallel agents in one repo with low memory and fast startup.
- vercel/eveA filesystem-first TypeScript framework for building durable AI agents with tools, skills, channels and schedules.