lipgloss

Lipgloss brings a CSS-like, declarative styling API to Go terminal apps, covering colors, borders, layout, and compositing for building polished TUIs.

Library
Go
vv1.1.0
11,771stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
75/100Good
Development Activity68
Maintenance72
Community60
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
82/100Excellent
Architecture85
Code Quality90
Innovation88
Learning Curve65

Lipgloss is a Go library from Charm for styling terminal output with an expressive, declarative API modeled on CSS. Instead of manually concatenating ANSI escape codes, developers chain methods on a Style value — Bold, Foreground, Padding, Border, Width — and call Render to produce correctly formatted terminal text.

Beyond simple text styling, Lipgloss ships layout primitives for joining and aligning blocks of text horizontally and vertically, a cell-based compositor for layering positioned content (with mouse hit-detection for interactive layers), and companion subpackages (table, list, tree) for structured terminal output. It automatically downsamples colors to match the terminal’s actual color profile, so the same style code renders correctly whether the terminal supports true color, 256 colors, ANSI 16, or no color at all.

Lipgloss is a foundational piece of the Charm terminal UI ecosystem, commonly paired with Bubble Tea for building full interactive TUI applications, but it works equally well standalone for CLI tools that just need attractive, portable formatted output.

What You Get

  • A fluent Style builder covering color (4-bit, 8-bit, and 24-bit true color), bold/italic/underline/strikethrough formatting, and clickable terminal hyperlinks
  • CSS-style shorthand for padding, margins, and borders, including custom border character sets and multi-color gradient borders
  • Layout utilities for joining and aligning multi-line text blocks horizontally or vertically along configurable axes
  • A cell-based compositor (layer.go, canvas.go) for layering positioned content with z-index ordering and mouse click detection
  • Companion table, list, and tree subpackages for rendering structured data without hand-rolled formatting
  • Automatic color profile detection and downsampling so the same style code works across true-color, 256-color, ANSI, and no-color terminals

Common Use Cases

  • Styling output for standalone CLI tools so status messages, headers, and tables look polished without manual ANSI code juggling
  • Building the visual layer of interactive terminal UIs, typically alongside Bubble Tea, for panels, dialogs, and layouts
  • Rendering structured data — configuration summaries, diffs, comparison tables — with the table and tree subpackages
  • Producing terminal output that degrades gracefully in CI logs or non-color terminals via automatic profile downsampling
  • Compositing layered terminal “canvases” for dashboards or games that need precisely positioned, z-ordered content

Under The Hood

Architecture Lipgloss centers on Style, an immutable value type in style.go whose properties are packed into a propKey bitmask, so styles can be copied, inherited, and partially overridden (Inherit, UnsetX) without pointer aliasing bugs. Rendering fans out through platform-specific ANSI handling (ansi_unix.go/ansi_windows.go) and the github.com/charmbracelet/x/ansi package, while layout concerns are cleanly separated into join.go, align.go, and position.go. A separate compositing layer (layer.go, canvas.go) provides z-indexed, positioned content layering with mouse-click hit testing, and the table, list, and tree directories are self-contained subpackages that build on the core Style API rather than reaching into its internals — a modular structure where each concern (styling, layout, compositing, structured rendering) can be understood and changed independently.

Tech Stack Written in pure Go (module charm.land/lipgloss/v2, targeting Go 1.25) with a deliberately small dependency set: charmbracelet/x/ansi and charmbracelet/colorprofile for terminal capability detection and ANSI sequence generation, charmbracelet/ultraviolet and x/term/x/termios for terminal I/O, lucasb-eyer/go-colorful for color-space math (blending, darkening/lightening), and clipperhouse/displaywidth/rivo/uniseg for correct Unicode cell-width measurement. No web framework or runtime dependencies — this is a leaf library meant to be imported directly.

Code Quality Test files sit alongside nearly every source file (style_test.go, borders_test.go, table_test.go, tree_test.go, and more, totaling over 2,000 lines of tests), several using golden-file comparisons via charmbracelet/x/exp/golden. CI runs a dedicated coverage workflow with the race detector and reports to Coveralls, plus separate build and lint workflows and automated dependabot-sync, indicating an actively maintained quality gate rather than ad hoc testing.

What Makes It Unique Few terminal libraries commit as fully to a CSS-inspired mental model — padding/margin shorthand syntax, inheritance with explicit unset semantics, and copy-by-assignment value styles that behave like CSS classes rather than mutable builders. The automatic color-profile downsampling removes a whole class of “looks broken in some terminals” bugs, and the cell-based compositor with mouse-aware layers goes beyond simple text styling into genuine terminal UI layout, which is why it underpins much of the wider Charm TUI ecosystem.

Used by 16 apps in this directory

Go
55%
Apache 2.0

Authgear

Authentication

2,014

Open-source, self-hostable authentication platform with passkeys, biometric login, SSO, MFA, and GraphQL admin API — a full Auth0/Clerk/Firebase alternative for SaaS and mobile apps.

View details
88
Repo Health
81
Technical
69
Dependency
Built with
Go55%
HTML25%
TypeScript17%
Updated 4 days ago
Go
75%
AGPL 3.0

Coder

Devops · Developer Tools · Code Editors

14,299

Self-hosted cloud development environments and AI coding agents — defined in Terraform, connected via WireGuard, automatically shut down when idle.

View details
93
Repo Health
90
Technical
69
Dependency
Built with
Go75%
TypeScript23%
Updated today
Go
31%
Apache 2.0

CubeSandbox

Developer Tools · Security · AI Agents

11,386

Instant, concurrent, hardware-isolated MicroVM sandboxes for AI agents — E2B-API compatible, sub-60ms cold starts, and a built-in zero-trust egress proxy, all self-hostable at scale.

View details
82
Repo Health
88
Technical
63
Dependency
Built with
Go31%
Rust28%
C23%
Updated 2 days ago
Go
73%
Other

Flipt

Devops · Developer Tools

4,884

Git-native feature flag platform that stores, versions, and deploys feature toggles directly in your own Git repositories with no external database required.

View details
89
Repo Health
83
Technical
70
Dependency
Built with
Go73%
TypeScript26%
Updated yesterday
TypeScript
49%
AGPL 3.0

Grafana

Monitoring · Analytics

76,498

The open-source observability platform that unifies metrics, logs, and traces from any data source into dynamic, queryable dashboards.

View details
95
Repo Health
91
Technical
65
Dependency
Built with
TypeScript49%
Go45%
Updated today
Go
84%
MIT

Hatchet

AI Development · Developer Tools · Automation

7,812

A Postgres-backed orchestration engine for background tasks, AI agents, and durable workflows that replaces Redis queues and multi-datastore durable execution platforms with a single self-hostable service.

View details
88
Repo Health
83
Technical
68
Dependency
Built with
Go84%
PLpgSQL11%
Updated today
Go
58%
MIT

hoop

Security · Monitoring

805

A wire-protocol gateway that enforces data masking, command blocking, approval workflows, and full session recording for engineers and AI agents accessing production infrastructure.

View details
85
Repo Health
80
Technical
65
Dependency
Built with
Go58%
Clojure19%
JavaScript14%
Updated 2 days ago
Go
99%
Apache 2.0

klaw

AI Agents · Devops

635

kubectl for AI Agents — manage, schedule, and scale your AI workforce with a single binary that deploys in seconds.

View details
39
Repo Health
74
Technical
83
Dependency
Built with
Go99%
Updated 5 months ago
Go
95%
MIT

cli

Developer Tools · Team Chat

16,854

The official Lark/Feishu CLI tool built for both humans and AI agents, delivering 200+ commands and 26 AI agent skills across 18 business domains from messaging and calendar to docs, sheets, and approvals.

View details
83
Repo Health
83
Technical
76
Dependency
Built with
Go95%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search