charmbracelet
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
charm.land/.../v2imports for the current v2 ecosystem. - 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
stderror files, not to the TUI surface. - 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 | references/bubbletea-core.md |
| Real app architecture, commands, child models, async patterns | references/bubbletea-patterns.md |
Reusable widgets like list, table, textinput, viewport, help |
references/bubbles.md |
| Forms, prompts, wizards, embedded form screens | references/huh.md |
| Styling, spacing, borders, color, layout composition | references/lipgloss.md |
| SSH-native TUI or remote CLI app | references/wish.md |
| Markdown help panes, docs, release notes, previews | references/glamour.md |
| Structured CLI logging and diagnostics | references/log.md |
| High-level library chooser and API map | references/api-surface.md |
| Concrete implementation recipes | references/common-use-cases.md |
| Migration issues and footguns | references/troubleshooting-workarounds.md |
| Upstream example shortlist | references/examples.md |
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
tea.Cmd, not directly inUpdateorView. - Handle resize with
tea.WindowSizeMsgand keep layouts responsive. - Request background color with
tea.RequestBackgroundColorwhen styles depend on light/dark mode. - In Bubble Tea v2, declare terminal behavior in
tea.Viewfields likeAltScreenandMouseMode. - 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
stderror a file, not to stdout.
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
references/bubbletea-core.mdfor Bubble Tea's model, commands, messages, and program lifecycle. - Read
references/bubbletea-patterns.mdfor app structure, async work, Cobra integration, and multi-model composition. - Read
references/troubleshooting-workarounds.mdbefore migrating old Charmbracelet code or mixing stale examples with v2 code.
More from aaronflorey/agent-skills
amber-lang
Write, debug, and explain Amber code, the `amber` language that compiles `.ab` files to Bash. Use this skill when the user asks to write an Amber script, convert Bash to Amber, compile Amber to Bash, debug Amber syntax or type errors, or asks about Amber 0.5.1-alpha syntax, functions, types, error handling, the standard library, or the `amber` CLI.
26go-cobra
Write, scaffold, and debug Go CLI applications with `github.com/spf13/cobra`. Use this skill whenever the user mentions Cobra, `cobra.Command`, a Go command-line app, subcommands, persistent or local flags, required flags, argument validation, shell completions, generated docs, or wants to build or refactor a cobra-based CLI.
24laravel-actions
Write, scaffold, explain, and refactor code using the `lorisleiva/laravel-actions` package. Use this skill whenever the user mentions Laravel Actions, `AsAction`, `php artisan make:action`, action classes, converting a controller, job, listener, or command into an action, dispatching an action as a job, using an action as a controller or listener, or adding validation, authorization, testing, or mocking around an action.
24num30-config
Write, debug, and explain Go configuration code using `github.com/num30/config`. Use this skill when the user mentions `num30/config`, wants config structs, file plus env plus CLI flag loading, validation, config watching, precedence rules, or asks how to integrate the num30/config package into a Go application.
22pelican-panel-plugins
Write, scaffold, explain, and debug plugins for the Pelican gaming panel. Use this skill whenever the user mentions Pelican plugins, extending Pelican, FilamentPHP resources or pages for Pelican, plugin service providers, custom permissions, plugin settings, routes, models, widgets, or asks how to add new functionality to the Pelican panel.
21go-viper
Write, debug, and explain Go configuration code with `github.com/spf13/viper`. Use this skill whenever the user mentions Viper, `viper`, config structs, reading config from files plus env vars plus flags, Cobra or `pflag` integration, unmarshaling into structs, env key replacers, config precedence, config watching, or a clean Viper bootstrap.
20