terminal-ui-design

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Terminal UI Design

终端UI设计

Create distinctive, production-grade terminal interfaces with intentional aesthetics. Don't just print text—craft an experience.
打造风格独特、生产级的终端界面,兼具精心设计的美学效果。不要只是打印文本——要打磨出完整的使用体验。

Quick Start

快速开始

Before coding, choose a bold aesthetic direction:
StyleVibeColorsBorders
CyberpunkNeon, futuristicHot pink #ff00ff, cyan #00ffff, purple #1a0a2eBlock █▀▄
Amber TerminalVintage CRT#ffb000 on blackDouble ╔═╗
Minimalist ZenClean, focusedNord palette, cool bluesRounded ╭─╮
Retro MainframeCorporate, formalGreen on blackASCII-only +-+
Synthwave80s nostalgiaPurple, pink gradientsHeavy ┏━┓
Monochrome BrutalistStark, boldSingle color + intensityHeavy ┏━┓
Pick ONE direction and execute it with precision.
编码之前,先选择一个鲜明的美学方向
风格氛围配色边框
赛博朋克霓虹、未来感亮粉色 #ff00ff、青色 #00ffff、紫色 #1a0a2e方块 █▀▄
琥珀终端复古CRT感黑色背景配 #ffb000双线 ╔═╗
极简禅风干净、聚焦Nord配色、冷调蓝色圆角 ╭─╮
复古大型机正式、企业感黑底绿字纯ASCII +-+
合成波80年代怀旧感紫粉渐变粗线 ┏━┓
单色野兽派硬朗、鲜明单色+明暗变化粗线 ┏━┓
选择一个方向并精准落地。

Design Thinking Checklist

设计思维检查清单

QuestionDecision Point
PurposeWhat problem? Who uses it? What workflow?
TonePick extreme: cyberpunk, zen, retro, maximalist, playful
ConstraintsPython Rich, Go bubbletea, Rust ratatui, ANSI codes?
DifferentiationWhat makes this UNFORGETTABLE?
问题决策点
核心用途解决什么问题?目标用户是谁?适配什么工作流?
整体调性选择极致风格:赛博朋克、禅风、复古、极繁、 playful
技术约束用Python Rich、Go bubbletea、Rust ratatui还是原生ANSI码?
差异化什么特性会让这个工具让人过目不忘?

Box Drawing & Borders

框绘字符与边框

Choose borders that match your aesthetic:
Single:     ┌─────┐ │   └─────┘  Clean, modern
Double:     ╔═════╗ ║   ╚═════╝  Bold, formal, retro
Rounded:    ╭─────╮ │   ╰─────╯  Soft, friendly
Heavy:      ┏─────┓ ┃   ┗─────┛  Strong, industrial
Dashed:     ┄┄┄┄┄┄ ┆              Light, airy
ASCII:      +-----+ |   +-----+  Retro, universal
Block:      █▀▀▀▀█ ▄   ▀▀▀▀▀    Chunky, brutalist
Pro tip: Use decorative corners: ◆ ◈ ✦ ⬡ ◢◣◤◥
选择和美学风格匹配的边框:
Single:     ┌─────┐ │   └─────┘  Clean, modern
Double:     ╔═════╗ ║   ╚═════╝  Bold, formal, retro
Rounded:    ╭─────╮ │   ╰─────╯  Soft, friendly
Heavy:      ┏─────┓ ┃   ┗─────┛  Strong, industrial
Dashed:     ┄┄┄┄┄┄ ┆              Light, airy
ASCII:      +-----+ |   +-----+  Retro, universal
Block:      █▀▀▀▀█ ▄   ▀▀▀▀▀    Chunky, brutalist
专业提示:可以使用装饰性角标:◆ ◈ ✦ ⬡ ◢◣◤◥

Color Strategies

配色策略

StrategyWhen to UseTechnique
ANSI 16Universal compatibilityClassic palette, craft unique combos
256-colorRich but portableGradients, subtle variations
True colorModern terminalsFull spectrum, smooth transitions
MonochromeElegant constraintSingle color, vary intensity
Create atmosphere:
  • Background color blocks for sections
  • Gradient fills: ░▒▓█
  • Semantic color (avoid cliché red=bad, green=good)
  • Reverse video for emphasis
  • Dim for secondary, bold for primary
策略适用场景技巧
ANSI 16色需要全兼容性经典配色,打造独特组合
256色兼顾丰富度和可移植性渐变、细微色差
真彩色现代终端全色域、平滑过渡
单色优雅的约束感单种颜色,通过明暗变化区分层级
营造氛围技巧
  • 区块使用背景色块区分
  • 渐变填充:░▒▓█
  • 语义化配色(避免俗套的红=错误、绿=正常)
  • 反色高亮强调
  • 次要信息变暗、主要信息加粗

Typography

排版

The terminal is ALL typography:
TechniqueEffectExample
ASCII art headersDramatic intro
figlet
style banners
Text weightHierarchyBold, dim, normal
DecorationEmphasisUnderline, italic, strikethrough
Letter spacingHeadersH E A D E R
CaseVoiceALL CAPS headers, lowercase body
Unicode symbolsRichness→ • ◆ ★ ⚡ λ ∴ ≡ ⌘ ✓ ✗
Custom bulletsPersonality▸ ◉ ✓ ⬢ › instead of
-
Block:    ███████╗██╗██╗     ███████╗
Slant:    /___  / / // /     / ____/
Small:    ╔═╗┌─┐┌─┐
Minimal:  [ HEADER ]
终端的所有内容都属于排版范畴:
技巧效果示例
ASCII艺术标题极具冲击力的开场
figlet
风格横幅
字重变化层级区分加粗、变暗、常规
装饰效果强调内容下划线、斜体、删除线
字间距调整标题效果H E A D E R
大小写传递语气全大写标题、小写正文
Unicode符号丰富表现力→ • ◆ ★ ⚡ λ ∴ ≡ ⌘ ✓ ✗
自定义项目符号凸显个性用 ▸ ◉ ✓ ⬢ › 代替
-
Block:    ███████╗██╗██╗     ███████╗
Slant:    /___  / / // /     / ____/
Small:    ╔═╗┌─┐┌─┐
Minimal:  [ HEADER ]

Layout & Spatial Composition

布局与空间构成

Break free from single-column output:
ElementUsage
Panels & WindowsDistinct regions with borders
ColumnsSide-by-side information
TablesAligned data, Unicode table chars
WhitespaceGenerous padding, breathing room
DensityMatch purpose—dense dashboards, sparse wizards
HierarchyVisual distinction: primary, secondary, chrome
AsymmetryOff-center titles, weighted layouts
摆脱单栏输出的限制:
元素用法
面板与窗口带边框的独立区域
多栏布局并排展示信息
表格对齐展示数据,使用Unicode表格字符
留白充足的内边距,留出呼吸空间
信息密度匹配使用场景:高密度仪表盘、低密度引导流程
层级视觉区分:主要内容、次要内容、框架元素
非对称布局偏置标题、权重倾斜的布局

Motion & Animation

动效与动画

ElementExamples
Spinners⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏, ⣾⣽⣻⢿⡿⣟⣯⣷
Progress bars▓░, █▒, [=====> ], ◐◓◑◒
Typing effectsCharacter-by-character reveal
TransitionsWipe effects, fade with color intensity
Live updatesStreaming data, real-time charts
元素示例
加载动画⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏, ⣾⣽⣻⢿⡿⣟⣯⣷
进度条▓░, █▒, [=====> ], ◐◓◑◒
打字效果逐字符显示内容
转场效果擦除效果、通过颜色明暗实现淡入淡出
实时更新流式数据、实时图表

Data Display

数据展示

TypeTechnique
Sparklines▁▂▃▄▅▆▇█ inline mini-charts
Bar chartsHorizontal bars with block chars
TablesSmart sizing, alternating rows, aligned nums
Trees├── └── │ hierarchies
Status● green, ○ empty, ◐ partial, ✓ complete
Gauges[████████░░] with percentage
类型技巧
迷你走势图▁▂▃▄▅▆▇█ 行内迷你图表
条形图用块字符实现的横向条形
表格智能适配宽度、隔行变色、数值右对齐
树形结构├── └── │ 层级结构
状态标识 ● 绿色(正常)、○ 空置、◐ 部分完成、✓ 完成
仪表盘[████████░░] 搭配百分比

Decorative Elements

装饰元素

Dividers:   ───── ═════ •••••• ░░░░░░ ≋≋≋≋≋≋
Sections:   ▶ SECTION, [ SECTION ], ─── SECTION ───, ◆ SECTION
Textures:   · ∙ ░ patterns for backgrounds
Icons:       (if Nerd Fonts available)
Dividers:   ───── ═════ •••••• ░░░░░░ ≋≋≋≋≋≋
Sections:   ▶ SECTION, [ SECTION ], ─── SECTION ───, ◆ SECTION
Textures:   · ∙ ░ patterns for backgrounds
Icons:       (if Nerd Fonts available)

Anti-Patterns to Avoid

需要避免的反模式

❌ Avoid✅ Instead
Plain unformatted textStyled output with intent
Default colorsCohesive palette
Generic [INFO] prefixesStyled prefixes with icons
Simple ---- dividersUnicode dividers ───── ═════
Walls of textStructured panels and sections
Generic progressCreative spinners and bars
Boring helpFormatted, aligned help text
Inconsistent spacingPrecise alignment
❌ 避免✅ 推荐做法
无格式的纯文本输出有明确设计意图的样式化输出
默认配色统一协调的调色板
通用的 [INFO] 前缀带图标的样式化前缀
简单的 ---- 分隔线Unicode分隔线 ───── ═════
大段无结构文本结构化的面板和区块
通用进度提示有创意的加载动画和进度条
枯燥的帮助信息格式化、对齐的帮助文本
不一致的间距精准的对齐

Library Quick Reference

库快速参考

LanguageLibraries
PythonRich, Textual, curses, prompt_toolkit
GoBubbletea, Lipgloss
RustRatatui
Node.jsInk, Blessed, cliui
PureANSI escape codes
语言相关库
PythonRich, Textual, curses, prompt_toolkit
GoBubbletea, Lipgloss
RustRatatui
Node.jsInk, Blessed, cliui
原生实现ANSI转义码

ANSI Escape Codes

ANSI转义码

\x1b[1m       Bold
\x1b[3m       Italic
\x1b[4m       Underline
\x1b[31m      Red foreground
\x1b[38;2;R;G;Bm  True color (RGB)
\x1b[2J       Clear screen
\x1b[H        Cursor home
\x1b[1m       Bold
\x1b[3m       Italic
\x1b[4m       Underline
\x1b[31m      Red foreground
\x1b[38;2;R;G;Bm  True color (RGB)
\x1b[2J       Clear screen
\x1b[H        Cursor home

Implementation Pattern

实现模式

  1. Choose aesthetic first (cyberpunk, zen, retro, etc.)
  2. Define palette (2-3 colors + background)
  3. Select border style (single, double, rounded, block)
  4. Create reusable components (panel, table, status)
  5. Apply consistently across all output
  1. 首先确定美学风格(赛博朋克、禅风、复古等)
  2. 定义调色板(2-3种主色+背景色)
  3. 选择边框样式(单线、双线、圆角、块边框)
  4. 创建可复用组件(面板、表格、状态提示)
  5. 在所有输出中保持风格一致

Resources

资源

FileWhen to Load
references/box-drawing.mdNeed border character reference
references/ansi-codes.mdNeed escape code reference
references/color-palettes.mdNeed pre-defined palettes
文件加载场景
references/box-drawing.md需要框绘字符参考时
references/ansi-codes.md需要转义码参考时
references/color-palettes.md需要预定义调色板时

Exit Criteria (Code Verified)

退出标准(代码已验证)

  • Output has intentional aesthetic (not generic)
  • Cohesive color palette used throughout
  • Borders and typography match chosen style
  • No plain text without formatting
  • Anti-patterns avoided
  • 输出有明确的美学设计(不是通用默认样式)
  • 全程使用统一协调的调色板
  • 边框和排版和选定的风格匹配
  • 没有无格式的纯文本内容
  • 规避了所有反模式