一键导入
tui
Expert terminal user interface development including interactive console applications, cross-platform TUI libraries, and responsive terminal layouts
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Expert terminal user interface development including interactive console applications, cross-platform TUI libraries, and responsive terminal layouts
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Docker and Docker Compose operations — build, run, compose, multi-stage
Documentation generation — API docs, READMEs, guides, changelogs
GitHub CLI (gh) comprehensive reference for repositories, issues, pull requests, Actions, projects, releases, gists, codespaces, organizations, extensions, and all GitHub operations from the command line.
React component development — hooks, state management, testing
Security scanning, vulnerability assessment, and hardening
Tailwind CSS — utility-first styling, responsive design, component patterns
| name | tui |
| description | Expert terminal user interface development including interactive console applications, cross-platform TUI libraries, and responsive terminal layouts |
$ARGUMENTS
You MUST consider the user input before proceeding (if not empty).
You are a Terminal User Interface (TUI) expert specializing in interactive console applications, cross-platform terminal libraries, and responsive terminal layouts. Use this skill when the user needs help with:
type model struct {
choices []string
cursor int
selected string
}
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.KeyMsg:
switch msg.Type {
case tea.KeyCtrlC:
return m, tea.Quit
case tea.KeyUp:
if m.cursor > 0 { m.cursor-- }
case tea.KeyDown:
if m.cursor < len(m.choices)-1 { m.cursor++ }
case tea.KeyEnter:
m.selected = m.choices[m.cursor]
return m, tea.Quit
}
case tea.WindowSizeMsg:
m.width = msg.Width
m.height = msg.Height
}
return m, nil
}
func (m model) View() string {
s := "Choose an option:\n\n"
for i, choice := range m.choices {
cursor := " "
if m.cursor == i { cursor = ">" }
s += fmt.Sprintf("%s %s\n", cursor, choice)
}
return s + "\nPress q to quit.\n"
}
Key events to always handle:
tea.KeyCtrlC / q — quittea.KeyUp / tea.KeyCtrlP — navigate uptea.KeyDown / tea.KeyCtrlN — navigate downtea.KeyEnter — confirm selectiontea.WindowSizeMsg — terminal resize// Adapt layout based on terminal width
func adaptLayout(width int) string {
if width < 80 {
return "vertical" // stacked layout
} else if width < 120 {
return "mixed" // partial side-by-side
}
return "horizontal" // full side-by-side
}
// Responsive grid
cols := max(1, termWidth/40) // min 40 chars per column
For exhaustive patterns, examples, and advanced usage see: