Bringing Glamour to Ruby: Charm Terminal Libraries Ported for Ruby 4.0
Share this article
Ruby's 30th anniversary milestone release—Ruby 4.0—arrives with significant upgrades like the experimental Ruby::Box isolation and ZJIT compiler. To mark the occasion, developer Marco Roth has unveiled a suite of Ruby ports bringing Charmbracelet's acclaimed terminal libraries to the ecosystem, declaring: "Ruby developers deserve glamorous terminals too."
Why Charm Resonates with Rubyists
Charmbracelet's philosophy—"We make the command line glamorous"—aligns with Ruby's emphasis on developer happiness and craftsmanship. Their Go-based libraries (Lipgloss, Bubble Tea, Glamour) revolutionized terminal UX through:
- CSS-like styling via Lipgloss for colors, borders, and layouts
- Elm-inspired architecture (Bubble Tea) for state management
- Pre-built components like spinners and forms (Bubbles, Huh?)
- Physics-based animations (Harmonica)
Roth argues these tools fill a gap in Ruby's CLI toolkit: "We've lacked cohesive ecosystems for building rich, interactive terminal applications that prioritize aesthetics alongside functionality."
The Ported Ecosystem
Each library serves a distinct purpose:
Lipgloss provides styling primitives:
style = Lipgloss::Style.new
.background("#7D56F4")
.border(:rounded)
.padding(1, 2)
puts style.render("Styled Ruby")
Bubble Tea offers Model-View-Update architecture:
class Counter
include Bubbletea::Model
def update(msg)
@count += 1 if msg == :increment
end
def view
"Count: #{@count}"
end
end
Glamour renders Markdown elegantly:
Glamour.render("# Hello **World**", style: "dark")
Huh? simplifies interactive forms:
Huh.form(
Huh.input.key(:name).title("Your name?"),
Huh.select.key(:color).options(["Red", "Blue"])
)
Broader Ruby Renaissance
This work aligns with Ruby's growing investment in developer experience:
- Standardized foundations (Prism parser, RBS types)
- Protocol-driven tooling (LSP, DAP, MCP)
- Modernized core tools (debug, IRB, RDoc)
Roth observes: "Strategic standardization enables innovation—just as Rails standardized web conventions, shared protocols let us build richer terminal tooling."
Availability and Future
Most gems (lipgloss, bubbletea, glamour) are on RubyGems. Future plans include:
- Making APIs more Ruby-idiomatic
- Expanding component libraries
- Resolving Goroutine quirks in Go-based bindings
Early experiments include a Minitest TUI runner and Herb ERB playground. As Roth challenges the community: "Imagine upgrading Rails generators, test runners, or Bundler with elegant interactions. The terminal doesn't have to be utilitarian—let's make it delightful."
Source: Glamorous Christmas: Bringing Charm to Ruby by Marco Roth