# charmbracelet/bubbletea

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/charmbracelet-bubbletea).**

39,656 stars · 1,094 forks · Go · mit

## Links

- GitHub: https://github.com/charmbracelet/bubbletea
- awesome-repositories: https://awesome-repositories.com/repository/charmbracelet-bubbletea.md

## Topics

`cli` `elm-architecture` `framework` `functional` `go` `golang` `hacktoberfest` `tui`

## Description

This framework provides a functional architecture for building interactive command-line applications. It utilizes a reactive runtime engine that synchronizes application state, user input, and visual output through a central event-driven message loop. By employing a unidirectional data flow pattern, the framework separates the definition of application state from the logic that processes updates and the declarative rendering process that transforms state into terminal-ready output.

The framework distinguishes itself through its approach to side-effect management and terminal environment adaptation. It encapsulates asynchronous tasks as discrete commands that execute outside the main loop, allowing for non-blocking orchestration of background operations like network requests or file system access. To ensure consistent behavior across diverse environments, it includes a normalization layer that queries terminal capabilities, monitors window dimensions for responsive layouts, and handles complex input streams including mouse and keyboard events.

Beyond its core runtime, the framework supports a broad range of operational requirements, including timed event scheduling, command batching, and persistent output rendering for status updates. It offers flexible initialization through functional configuration patterns and provides diagnostic utilities such as file-based logging to assist in debugging interfaces that occupy the standard output stream.

## Tags

### Development Tools & Productivity

- [Terminal User Interfaces](https://awesome-repositories.com/f/development-tools-productivity/terminal-user-interfaces.md) — Building interactive command line applications that respond to user input and update their visual state in real time.
- [Terminal Application Frameworks](https://awesome-repositories.com/f/development-tools-productivity/terminal-application-frameworks.md) — A functional architecture for building interactive command-line applications that manage state, handle asynchronous events, and render dynamic terminal output.
- [Event-Driven Terminal Engines](https://awesome-repositories.com/f/development-tools-productivity/event-driven-terminal-engines.md) — A core loop that processes system signals, user inputs, and asynchronous tasks to maintain a responsive and synchronized terminal display.
- [Terminal Layout Engines](https://awesome-repositories.com/f/development-tools-productivity/terminal-layout-engines.md) — Designing command line interfaces that dynamically adjust their visual structure and content based on changing window dimensions and terminal capabilities.
- [Keyboard Input Handlers](https://awesome-repositories.com/f/development-tools-productivity/keyboard-input-handlers.md) — Captures and processes keyboard events in real time within the application update loop. ([source](https://pkg.go.dev/charm.land/bubbletea/v2?tab=doc))
- [Asynchronous Task Runners](https://awesome-repositories.com/f/development-tools-productivity/asynchronous-task-runners.md) — The framework enables running asynchronous input and output operations by returning functions that perform tasks like network requests and return a message upon completion. ([source](https://pkg.go.dev/charm.land/bubbletea/v2?tab=doc))
- [Terminal Abstractions](https://awesome-repositories.com/f/development-tools-productivity/terminal-abstractions.md) — A layer that detects and normalizes terminal features to ensure consistent input handling and output rendering across different emulator environments.
- [Mouse Input Handlers](https://awesome-repositories.com/f/development-tools-productivity/mouse-input-handlers.md) — Enables interactive features by processing mouse clicks, motion, and wheel movements. ([source](https://pkg.go.dev/charm.land/bubbletea/v2?tab=doc))
- [Task Schedulers](https://awesome-repositories.com/f/development-tools-productivity/task-schedulers.md) — The framework allows triggering time-based events synchronized with the system clock by providing a duration and a callback function that returns a message after the interval. ([source](https://pkg.go.dev/charm.land/bubbletea/v2?tab=doc))

### Programming Languages & Runtimes

- [Concurrency Models](https://awesome-repositories.com/f/programming-languages-runtimes/language-features-paradigms/concurrency-models.md) — A central runtime loop that processes incoming system events and user inputs to trigger state transitions and command execution.
- [Language Features](https://awesome-repositories.com/f/programming-languages-runtimes/language-features-paradigms/language-features.md) — The framework allows applying functional options during initialization to control input streams, output rendering, environment variables, signal handling, and the overall execution context. ([source](https://pkg.go.dev/charm.land/bubbletea/v2?tab=doc))

### Software Engineering & Architecture

- [Unidirectional State Management](https://awesome-repositories.com/f/software-engineering-architecture/unidirectional-state-management.md) — A unidirectional data flow pattern where state updates are handled by pure functions that return new state and side-effect commands.
- [Asynchronous Task Managers](https://awesome-repositories.com/f/software-engineering-architecture/asynchronous-task-managers.md) — Managing concurrent background operations like network requests or file system access within a single threaded application execution loop.
- [Side Effect Handlers](https://awesome-repositories.com/f/software-engineering-architecture/side-effect-handlers.md) — A system where asynchronous tasks are encapsulated as functions that execute outside the main loop and return messages upon completion.
- [Model-View-Update Runtimes](https://awesome-repositories.com/f/software-engineering-architecture/model-view-update-runtimes.md) — A reactive programming pattern that separates application state, visual representation, and message-driven logic to ensure predictable interface updates.
- [Configuration Patterns](https://awesome-repositories.com/f/software-engineering-architecture/configuration-patterns.md) — A pattern for initializing complex components by passing a series of functions that modify the configuration of the runtime environment.

### User Interface & Experience

- [Terminal Rendering Engines](https://awesome-repositories.com/f/user-interface-experience/terminal-rendering-engines.md) — Transforms application state into responsive terminal interfaces with automated redrawing logic. ([source](https://cdn.jsdelivr.net/gh/charmbracelet/bubbletea@main/README.md))
- [Terminal Rendering Utilities](https://awesome-repositories.com/f/user-interface-experience/terminal-rendering-utilities.md) — The framework provides a mechanism to display formatted text above the active interface, ensuring output remains visible across screen renders independently of the internal application state. ([source](https://pkg.go.dev/charm.land/bubbletea/v2?tab=doc))

### Web Development

- [State Management Models](https://awesome-repositories.com/f/web-development/state-management-models.md) — Provides a structured approach to defining application state models that react to user input and system events. ([source](https://cdn.jsdelivr.net/gh/charmbracelet/bubbletea@main/README.md))
- [State Update Handlers](https://awesome-repositories.com/f/web-development/state-update-handlers.md) — Processes incoming messages and events to modify application state and execute runtime commands. ([source](https://cdn.jsdelivr.net/gh/charmbracelet/bubbletea@main/README.md))

### Operating Systems & Systems Programming

- [Systems Programming](https://awesome-repositories.com/f/operating-systems-systems-programming/systems-programming.md) — Creating reactive software that processes system signals and hardware events to trigger state changes and interface updates automatically.

### System Administration & Monitoring

- [Window Size Monitors](https://awesome-repositories.com/f/system-administration-monitoring/window-size-monitors.md) — Tracks terminal window dimensions to allow dynamic layout adjustments during resize events. ([source](https://pkg.go.dev/charm.land/bubbletea/v2?tab=doc))
