Learn-skills.dev charmbracelet
Build Go terminal user interfaces and interactive CLIs with the Charmbracelet ecosystem, especially Bubble Tea, Bubbles, Huh, Lip Gloss, Wish, Glamour, and Log. Use this skill when the user asks for a TUI, terminal UI, interactive CLI, Bubble Tea model/update/view code, Bubbles widgets, Huh forms, Lip Gloss layout or styling, Wish SSH apps, Glamour markdown rendering, or a polished Go terminal app.
install
source · Clone the upstream repo
git clone https://github.com/NeverSight/learn-skills.dev
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/NeverSight/learn-skills.dev "$T" && mkdir -p ~/.claude/skills && cp -r "$T/data/skills-md/aaronflorey/agent-skills/charmbracelet" ~/.claude/skills/neversight-learn-skills-dev-charmbracelet && rm -rf "$T"
manifest:
data/skills-md/aaronflorey/agent-skills/charmbracelet/SKILL.mdsource content
Use this skill to build modern Go CLIs with the Charmbracelet stack. Default to Bubble Tea for any stateful TUI or interactive terminal flow, then layer in Bubbles, Huh, Lip Gloss, Wish, Glamour, and Log as needed.
Start Here
- Use
imports for the current v2 ecosystem.charm.land/.../v2 - Treat Bubble Tea as the app runtime and state machine.
- Treat Bubbles as reusable widgets, not the app shell.
- Treat Lip Gloss as layout and styling.
- Treat Huh as the fastest way to build forms and wizards.
- Treat Glamour as markdown-to-ANSI rendering.
- Treat Log as diagnostics to
or files, not to the TUI surface.stderr - Treat Wish as the SSH transport layer for remote terminal apps.
When To Reach For Which Library
| Need | Use |
|---|---|
| Full TUI, app state, key handling, message loop | |
| Real app architecture, commands, child models, async patterns | |
Reusable widgets like , , , , | |
| Forms, prompts, wizards, embedded form screens | |
| Styling, spacing, borders, color, layout composition | |
| SSH-native TUI or remote CLI app | |
| Markdown help panes, docs, release notes, previews | |
| Structured CLI logging and diagnostics | |
| High-level library chooser and API map | |
| Concrete implementation recipes | |
| Migration issues and footguns | |
| Upstream example shortlist | |
Default Build Strategy
- Start with Bubble Tea when the user asks for a TUI, terminal UI, dashboard, picker, wizard, or interactive CLI.
- Add Bubbles instead of rebuilding common widgets by hand.
- Add Lip Gloss once layout or visual hierarchy matters.
- Add Huh when the interaction is form-heavy.
- Add Glamour when the app renders markdown content.
- Add Log for diagnostics, background jobs, or server logs.
- Add Wish only when the app should run over SSH.
Core Rules
- Keep business logic separate from the Bubble Tea model.
- Do I/O in
, not directly intea.Cmd
orUpdate
.View - Handle resize with
and keep layouts responsive.tea.WindowSizeMsg - Request background color with
when styles depend on light/dark mode.tea.RequestBackgroundColor - In Bubble Tea v2, declare terminal behavior in
fields liketea.View
andAltScreen
.MouseMode - In standalone Lip Gloss or Glamour output, print with Lip Gloss writers so color downsampling works.
- In Wish apps, remember middleware runs in reverse declaration order.
- In Bubble Tea apps, write logs to
or a file, not to stdout.stderr
Bubble Tea First Skeleton
package main import tea "charm.land/bubbletea/v2" type model struct{} func (m model) Init() tea.Cmd { return nil } func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { switch msg := msg.(type) { case tea.KeyPressMsg: switch msg.String() { case "q", "ctrl+c": return m, tea.Quit } } return m, nil } func (m model) View() tea.View { v := tea.NewView("Hello from Bubble Tea") return v }
Read These Next
- Read
for Bubble Tea's model, commands, messages, and program lifecycle.references/bubbletea-core.md - Read
for app structure, async work, Cobra integration, and multi-model composition.references/bubbletea-patterns.md - Read
before migrating old Charmbracelet code or mixing stale examples with v2 code.references/troubleshooting-workarounds.md