Agent Skills
› NeverSight/learn-skills.dev
› charmbracelet
charmbracelet
GitHub用于构建现代Go终端应用和CLI,基于Charmbracelet生态。默认使用Bubble Tea处理状态和交互,结合Bubbles组件、Huh表单、Lip Gloss样式等库,提供TUI开发的最佳实践与代码模板。
Trigger Scenarios
用户请求构建Go终端用户界面(TUI)
需要交互式命令行工具(CLI)
询问Bubble Tea模型或更新视图代码
使用Bubbles组件、Huh表单或Lip Gloss样式
开发SSH终端应用(Wish)或Markdown渲染(Glamour)
Install
npx skills add NeverSight/learn-skills.dev --skill charmbracelet -g -y
SKILL.md
Frontmatter
{
"name": "charmbracelet",
"source": "local",
"license": "MIT",
"version": "1.0.0",
"description": "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."
}
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.
Version History
- e0220ca Current 2026-07-05 22:09


