Repolode
charmbracelet

charmbracelet/bubbletea

A Go framework for building terminal user interfaces using The Elm Architecture's model-update-view pattern.

Stars
45,471
Forks
4,035
Open issues
272
Last commit
12 days ago

What is it?

Bubble Tea is a Go framework for building terminal applications, from small interactive tools to larger full-screen programs. It follows The Elm Architecture: an application is a model that holds state, an Update function that handles messages such as key presses, and a View function that renders the interface from that state. The runtime takes care of redrawing, so developers describe the UI rather than managing terminal output manually.

The framework supports inline, full-window, and mixed layouts. It includes a cell-based renderer, color downsampling for terminals with limited palettes, declarative views that can set options like alternate screen mode and mouse tracking, keyboard and mouse input handling, and clipboard support. Commands let programs perform I/O such as timers or network requests without blocking the interface.

Bubble Tea is commonly paired with sibling libraries from the same project: Bubbles for ready-made components like text inputs and viewports, Lip Gloss for styling and layout, and Harmonica for animation.

Key features

  • 01Implements The Elm Architecture with Init, Update, and View methods on a model.
  • 02Provides a cell-based renderer and built-in color downsampling.
  • 03Supports inline, full-window, and mixed terminal layouts.
  • 04Handles keyboard and mouse input, plus native clipboard access.
  • 05Offers a command system for asynchronous I/O such as timers and requests.

Use cases

  • Building interactive command-line tools with forms, lists, or menus in Go.
  • Creating full-screen terminal dashboards or file managers.
  • Writing terminal games or visualizations that respond to input events.

Quick start

  1. 1

    Import the Bubble Tea v2 package in your Go code

  2. 2

    Download bubbletea and its dependencies

    go mod tidy

Things to know

  • Written in Go, so you need working knowledge of Go to use it.
  • Upgrading from v1 requires following a separate upgrade guide, since v2 changes the API.

Topics

FAQ

What is bubbletea?
A Go framework for building terminal user interfaces using The Elm Architecture's model-update-view pattern. Bubble Tea is a Go framework for building terminal applications, from small interactive tools to larger full-screen programs. It follows The Elm Architecture: an application is a model that holds state, an Update function that handles messages such as key presses, and a View function that renders the interface from that state. The runtime takes care of redrawing, so developers describe the UI rather than managing terminal output manually.
Is bubbletea free to use? What license does it have?
bubbletea is open source under the MIT license. Check the license terms before using it in commercial products.
Is bubbletea still maintained?
Actively maintained. The last commit to bubbletea was on Oct 8, 2026.
What can I use bubbletea for?
Building interactive command-line tools with forms, lists, or menus in Go. Creating full-screen terminal dashboards or file managers. Writing terminal games or visualizations that respond to input events.
How do I install bubbletea?
Import the Bubble Tea v2 package in your Go code Download bubbletea and its dependencies: go mod tidy
Where can I get bubbletea?
The source code and installation instructions are on GitHub: https://github.com/charmbracelet/bubbletea

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects