This skill provides comprehensive guidance for building beautiful, interactive command-line applications in Ruby using the charm-ruby ecosystem (bubbletea, lipgloss, bubbles, huh, glamour, harmonica, gum, bubblezone, ntcharts). It helps users design CLI tools with Bubble Tea's Model-View-Update architecture, style terminal output with Lipgloss, integrate pre-built Bubbles components, create interactive forms with Huh, add mouse support with Bubblezone, render terminal charts with ntcharts, and package CLI tools as Ruby gems for distribution on RubyGems.org.
Build beautiful, interactive terminal apps in Ruby using the charm-ruby ecosystem (Bubble Tea, Lipgloss, Bubbles, Huh). Use this when creating CLI tools with MVU architecture, styled terminal output, interactive forms, or terminal charts.
/plugin marketplace add lorismaz/charm-ruby-claude-plugin/plugin install lorismaz-charm-ruby@lorismaz/charm-ruby-claude-pluginThis skill inherits all available tools. When active, it can use any tool Claude has access to.
examples/interactive-form.rbexamples/progress-spinner.rbexamples/simple-counter.rbexamples/styled-list.rbreferences/bubble-tea-architecture.mdreferences/bubbles-components.mdreferences/bubblezone-mouse.mdreferences/gem-distribution.mdreferences/harmonica-animation.mdreferences/huh-forms.mdreferences/lipgloss-styling.mdreferences/ntcharts-visualization.mdThis skill provides comprehensive guidance for building beautiful, interactive command-line applications in Ruby using the charm-ruby ecosystem (bubbletea, lipgloss, bubbles, huh, glamour, harmonica, gum, bubblezone, ntcharts). It helps users design CLI tools with Bubble Tea's Model-View-Update architecture, style terminal output with Lipgloss, integrate pre-built Bubbles components, create interactive forms with Huh, add mouse support with Bubblezone, render terminal charts with ntcharts, and package CLI tools as Ruby gems for distribution on RubyGems.org.
Use this skill when the user asks about:
Note: The charm-ruby gems are Ruby ports of the original Go libraries from Charm.sh. While the API is similar, some Go-specific patterns (like Goroutine initialization) have been adapted for Ruby. If you encounter unexpected behavior, check that you're using the Ruby-specific patterns shown in this documentation.
Install the core charm-ruby gems:
# Gemfile
gem "bubbletea" # MVU architecture
gem "lipgloss" # Terminal styling
gem "bubbles" # Pre-built components
gem "glamour" # Markdown rendering
gem "harmonica" # Spring animations
gem "gum" # Shell script helpers
gem "bubblezone" # Mouse event zones
gem "ntcharts" # Terminal charts
# Huh requires GitHub install until gem name resolved
gem "huh", github: "marcoroth/huh-ruby"
Then run bundle install.
Bubble Tea implements the Elm-inspired MVU pattern for building interactive terminal applications. Every Bubble Tea app has three core methods:
require "bubbletea"
class MyModel
include Bubbletea::Model
def initialize
@count = 0
end
def init
nil # No initial command
end
def update(msg)
case msg
when Bubbletea::KeyMsg
case msg.string
when "q", "ctrl+c"
return self, Bubbletea.quit
when "up", "k"
@count += 1
when "down", "j"
@count -= 1
end
end
[self, nil]
end
def view
"Count: #{@count}\n\nPress up/down to change, q to quit"
end
end
Bubbletea.run(MyModel.new)
KeyMsg, MouseMsg, or custom messages from commandsupdate, don't mutate in placeFor detailed architecture patterns, see references/bubble-tea-architecture.md.
Lipgloss provides CSS-like styling for terminal output with support for colors, borders, padding, margins, and alignment.
require "lipgloss"
# Create a style with method chaining
style = Lipgloss::Style.new
.bold(true)
.foreground("#FAFAFA")
.background("#7D56F4")
.padding(1, 2)
.border(:rounded)
.border_foreground("#FF0000")
# Apply style to text
styled_text = style.render("Hello, World!")
puts styled_text
Lipgloss automatically adapts to terminal capabilities:
"#FF5733"# Adaptive color (light bg / dark bg)
style = Lipgloss::Style.new
.foreground(Lipgloss.adaptive_color("#000000", "#FFFFFF"))
# Padding: top, right, bottom, left (or single value for all)
style.padding(1, 2, 1, 2)
# Margins
style.margin(1, 2)
# Width and alignment
style.width(40).align(:center)
# Borders: :normal, :rounded, :double, :thick, :hidden
style.border(:rounded).border_foreground("#888888")
For complete styling reference, see references/lipgloss-styling.md.
Bubbles provides ready-to-use components that integrate with Bubble Tea's MVU architecture.
| Component | Purpose |
|---|---|
| Spinner | Animated loading indicators |
| TextInput | Single-line text input with cursor |
| TextArea | Multi-line text editing |
| List | Scrollable, selectable item list |
| Table | Formatted data tables |
| Progress | Progress bar with percentage |
| Viewport | Scrollable content area |
Components maintain their own state and expose update and view methods:
require "bubbles"
class MyModel
include Bubbletea::Model
def initialize
@spinner = Bubbles::Spinner.new
@spinner.style = :dots # :line, :dots, :minidots, :jump, etc.
@loading = true
end
def init
@spinner.tick # Start spinner animation
end
def update(msg)
if @loading
spinner, cmd = @spinner.update(msg)
@spinner = spinner
return [self, cmd]
end
[self, nil]
end
def view
if @loading
"Loading... #{@spinner.view}"
else
"Done!"
end
end
end
For all component patterns, see references/bubbles-components.md.
Huh simplifies building interactive forms with validation, styling, and multiple input types.
require "huh"
form = Huh::Form.new do |f|
f.group do |g|
g.input :name, title: "What's your name?", placeholder: "Enter name..."
g.select :color, title: "Favorite color?", options: %w[Red Green Blue]
g.confirm :agree, title: "Do you agree to the terms?"
end
end
result = form.run
puts "Name: #{result[:name]}"
puts "Color: #{result[:color]}"
puts "Agreed: #{result[:agree]}"
input: Single-line text with optional validationtext: Multi-line text areaselect: Single choice from optionsmulti_select: Multiple choicesconfirm: Yes/No questionf.input :email,
title: "Email address",
validate: ->(v) { v.include?("@") ? nil : "Invalid email" }
For complete form patterns, see references/huh-forms.md.
Gum provides a Ruby interface for creating interactive shell script prompts without building full Bubble Tea applications. Perfect for quick scripts and CLI utilities.
require "gum"
# Simple text input
name = Gum.input(placeholder: "Enter your name")
# With header and default value
email = Gum.input(
header: "Contact Information",
placeholder: "email@example.com",
value: ENV["USER_EMAIL"]
)
# Single selection
color = Gum.choose("Red", "Green", "Blue", header: "Pick a color")
# Multiple selection
features = Gum.choose(
"Authentication",
"Database",
"API",
"Testing",
header: "Select features to enable",
no_limit: true # Allow multiple selections
)
# Simple yes/no
if Gum.confirm("Delete all files?")
delete_files
end
# With custom prompt
proceed = Gum.confirm(
"Deploy to production?",
affirmative: "Yes, deploy",
negative: "No, cancel"
)
# Show spinner while executing a block
result = Gum.spin(title: "Installing dependencies...") do
system("bundle install")
end
# With custom spinner style
Gum.spin(title: "Building project...", spinner: :dots) do
system("rake build")
end
# Interactive fuzzy filter
selected = Gum.filter(
items,
placeholder: "Search...",
header: "Select a file"
)
# Print styled text
Gum.style("Success!", foreground: "#00FF00", bold: true)
# Create a styled box
Gum.style(
"Welcome to My CLI",
border: :rounded,
padding: "1 2",
foreground: "#FFFFFF",
background: "#7D56F4"
)
Larger applications compose multiple components and screens:
class App
include Bubbletea::Model
SCREEN_MENU = :menu
SCREEN_FORM = :form
SCREEN_RESULT = :result
def initialize
@screen = SCREEN_MENU
@menu = MenuModel.new
@form = FormModel.new
@result = nil
end
def update(msg)
case @screen
when SCREEN_MENU
@menu, cmd = @menu.update(msg)
if @menu.selected
@screen = SCREEN_FORM
end
when SCREEN_FORM
@form, cmd = @form.update(msg)
if @form.submitted
@result = process(@form.data)
@screen = SCREEN_RESULT
end
end
[self, cmd]
end
def view
case @screen
when SCREEN_MENU then @menu.view
when SCREEN_FORM then @form.view
when SCREEN_RESULT then render_result(@result)
end
end
end
view methods fast; avoid heavy computationupdate logic by calling with mock messagesPackage your CLI as a Ruby gem for easy installation via RubyGems.org.
my-cli/
├── Gemfile
├── my-cli.gemspec
├── bin/
│ └── my-cli # Executable
├── lib/
│ ├── my_cli.rb # Main entry
│ └── my_cli/
│ ├── version.rb
│ ├── cli.rb # CLI class
│ └── model.rb # Bubble Tea model
└── README.md
Gem::Specification.new do |spec|
spec.name = "my-cli"
spec.version = MyCli::VERSION
spec.authors = ["Your Name"]
spec.summary = "A beautiful CLI tool"
spec.executables = ["my-cli"]
spec.require_paths = ["lib"]
spec.add_dependency "bubbletea"
spec.add_dependency "lipgloss"
spec.add_dependency "bubbles"
spec.required_ruby_version = ">= 2.7.0"
end
For complete distribution guide, see references/gem-distribution.md.
Working code examples are available in the examples/ directory:
simple-counter.rb - Minimal Bubble Tea applicationinteractive-form.rb - Huh form with validationstyled-list.rb - Lipgloss-styled selectable listprogress-spinner.rb - Async operation with spinner feedbackFor advanced functionality, see the detailed reference guides:
references/ntcharts-visualization.md - Terminal charts (sparklines, bar charts, line charts, heatmaps)references/bubblezone-mouse.md - Mouse event handling and clickable zonesreferences/harmonica-animation.md - Spring physics animations with angular_frequency and damping_ratioCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.