Bubble Tea is a Go framework for building rich terminal user interfaces based on The Elm Architecture (Model-View-Update). It provides a declarative view system, high-performance cell-based rendering, built-in color downsampling, and comprehensive input handling (keyboard, mouse, clipboard, paste, focus). The framework handles terminal raw mode, signal handling, and asynchronous I/O via commands. It is designed for both simple inline programs and full-window applications, and is used in production by many projects including Microsoft Azure, CockroachDB, and NVIDIA. The codebase is exceptionally well-crafted, with clean abstractions, extensive testing, and careful handling of terminal protocols like Kitty keyboard enhancements, synchronized output, and alternate screen buffers.
Freeze is a CLI tool written in Go that generates high-quality images (PNG, SVG, WebP) of source code or terminal output. It uses syntax highlighting via Chroma, supports ANSI escape sequence rendering, and provides extensive customization options including themes, fonts, shadows, borders, and interactive configuration via a TUI. The architecture is a single binary with a well-structured codebase: main.go orchestrates parsing, lexing, and rendering; config.go handles configuration loading from JSON files or flags; ansi.go implements a custom ANSI dispatcher to build SVG text elements; svg/svg.go provides reusable SVG decoration helpers. The tool can execute shell commands and capture their output for screenshots. It follows modern Go practices, has comprehensive golden-file tests, and is actively maintained by Charmbracelet. The code is highly modular and contains several components that could be reused independently, such as the ANSI dispatcher and SVG manipulation utilities.
Fang is a Go library that provides a batteries-included CLI starter kit built on top of the Cobra command-line framework. It extends Cobra with beautifully styled help output, error handling, and automatic versioning, completions, and manpage generation. The package offers a single high-level `Execute` function that wraps a Cobra root command and applies a rich set of default behaviors: full-color styled help and error pages with adaptive color schemes (including automatic terminal background detection), automatic `--version` derived from build info or explicitly set, hidden `man` and `completion` subcommands, and silent usage output (no help after a user error). It supports Windows VT processing for ANSI escape codes and color downsampling for terminals with limited color support. Architecturally, Fang is a library with a clear separation of concerns. The `fang.go` file defines the public API (`Execute`, `Option` functions, `ColorSchemeFunc`) and orchestrates the setup of the Cobra command. `help.go` contains the custom help and error rendering logic, including a usage error detector. `theme.go` defines the theming system with a `ColorScheme` struct, multiple built-in themes (default, ANSI), and a `Styles` struct that applies these colors to lipgloss styles. Platform-specific code for Windows VT processing is isolated in `fang_windows.go`. The library depends on Cobra, lipgloss v2 for styling, colorprofile for terminal color detection, and mango for manpage generation. It includes an example CLI application in `example/main.go` that showcases all features. Fang is designed for Go developers who want a production-ready, beautiful CLI experience without manually wiring up help formatting, version flags, completions, and error styling. Its theme system is extensible: users can provide their own color scheme functions that adapt to light/dark terminals. The project is actively maintained by Charmbracelet and follows modern Go conventions (e.g., `iter.Seq2` from Go 1.23).