CLI Design Guide
Expert CLI design consultant specializing in creating exceptional command-line interfaces. Design, review, and improve CLI tools by applying comprehensive design principles and patterns.
When NOT to Use This Skill
Do not use this skill for:
- GUI/web interface design
- Backend API design (unless CLI tool interacts with it)
- General UX design outside command-line contexts
- Programming language design
Core Expertise
Core design principles to apply:
1. Reasonable Defaults, Easy Overrides
- Optimize for common use cases while providing customization options
- Use flags to modify default behaviors
- Consider what most users need most often
2. Maintain Brand Consistency
- Use platform-specific language and terminology
- Mirror web interface patterns where appropriate
- Apply consistent visual styling (colors, states, syntax)
- Use sentence case, not title case
3. Reduce Cognitive Load
- Include confirmation steps for risky operations
- Provide clear headers for context
- Maintain consistent command patterns
- Anticipate user mistakes and next actions
- Design for accessibility
4. Terminal-First with Web Integration
- Keep users in terminal when possible
- Provide easy paths to web interface when needed
- Include
--web flags for browser actions
- Output relevant URLs after operations
Command Structure Expertise
Ensure commands follow this consistent pattern:
| tool |
<command> |
<subcommand> |
[value] |
[flags] |
[value] |
| cli |
issue |
view |
234 |
--web |
- |
| cli |
pr |
create |
- |
--title |
"Title" |
| cli |
repo |
fork |
org/repo |
--clone |
false |
Components:
- Command: The object to interact with
- Subcommand: The action to take on that object
- Flag: Modifiers with long version (
--state) and often shorthand (-s)
- Values: IDs, owner/repo pairs, URLs, branch names, file names
Language Guidelines:
- Use unambiguous language that can't be confused
- Use shorter phrases when possible and appropriate
- Use flags for modifiers of actions, avoid making modifiers their own commands
- Use understood shorthands to save characters
Decision Frameworks
Use these when making CLI design choices:
Flag vs. Subcommand:
- Flag: modifies HOW a command runs (
--verbose, --format json, --dry-run)
- Subcommand: defines WHAT action to take (
issue create, pr merge)
- Rule: if it changes the action, it's a subcommand. If it changes the behavior, it's a flag.
Interactive vs. Non-interactive:
- Default to interactive when: user is exploring, multiple choices needed, destructive action requires confirmation
- Default to non-interactive when: command is commonly scripted, output is piped, CI/CD context
- Always: provide
--yes/-y to skip confirmations, --no-input to disable all prompts
Output Format:
- Human-readable (default): colors, tables, summaries when stdout is a TTY
- Machine-readable (piped): no colors, tab-delimited or JSON when stdout is not a TTY
- Explicit:
--format json|table|csv flag to override detection
Error Handling:
- Exit code 0: success
- Exit code 1: general error
- Exit code 2: usage error (wrong flags/args)
- Always: error message to stderr, suggested fix when possible
Visual Design System Knowledge
Typography
- Assume monospace fonts
- Use bold for emphasis and repository names
- Create hierarchy with spacing and weight
- No italics (unreliable support)
Color Usage
Apply the 8 basic ANSI colors:
- Green: Success, open states
- Red: Failure, closed states
- Yellow: Warnings, draft states
- Blue: Information, links
- Cyan: Branch names, special identifiers
- Magenta: Special highlights
- Gray: Secondary information, labels
- White/Default: Primary text
Guidelines:
- Only enhance meaning, never communicate meaning solely through color
- Consider users can customize terminal colors
- Some terminals don't support 256-color sequences reliably
For complete ANSI color codes and escape sequences, see ./references/ansi-color-reference.md.
Iconography
Use Unicode symbols consistently:
✓ Success
✗ Failure
! Alert
- Neutral
+ Changes requested
Consider varying Unicode font support across systems.
For a comprehensive list of CLI-friendly Unicode symbols, see ./references/unicode-symbols.md.
Component Pattern Expertise
Lists
- Use tabular format with headers
- Show state through color
- Include relevant contextual information
For a complete list view example, see ./references/examples/list-view-example.txt.
Detail Views
- Show comprehensive information
- Indent body content
- Include URLs at bottom
Prompts
- Yes/No: Default in caps, for confirmations
- Short text: Single-line input with autocomplete
- Long text: Multi-line with editor option
- Radio select: Choose one option
- Multi-select: Choose multiple options
- Always provide flag alternatives to prompts
For an interactive prompt example, see ./references/examples/interactive-prompt-example.txt.
Help Pages
Required sections: Usage, Core commands, Flags, Learn more, Inherited flags
Optional sections: Additional commands, Examples, Arguments, Feedback
For a complete help text example, see ./references/examples/help-text-example.txt.
Syntax Conventions
<required-args> in angle brackets
[optional-args] in square brackets
{mutually-exclusive} in braces
repeatable... with ellipsis
- Use dash-case for multi-word variables
Anti-patterns
Avoid these common CLI design mistakes:
| Anti-pattern |
Better Approach |
Deeply nested subcommands (tool group sub action) |
Max 2 levels: tool command [flags] |
Inconsistent flag naming (--no-color vs --disable-colors) |
Pick one convention and apply everywhere |
| Interactive prompts with no flag alternatives |
Every prompt must have a --flag equivalent |
| Cryptic error messages ("Error: 1") |
Include what went wrong, why, and how to fix |
| Silent failures (exit 0 on error) |
Non-zero exit codes for failures, stderr for errors |
Missing --help on subcommands |
Every command level should have help |
| Mixing stdout data with status messages |
Data to stdout, progress/status to stderr |
Technical Considerations
Script Automation Support
- Provide flags for all interactive elements
- Output machine-readable formats when piped
- Use tabs as delimiters for structured data
- Remove colors/formatting in non-terminal output
- Include exact timestamps and full data
Accessibility
- Use punctuation for screen reader pauses
- Don't rely solely on color for meaning
- Support high contrast and custom themes
- Design for cognitive accessibility
Success Criteria
Recommendations are successful when:
- Commands follow consistent patterns across the tool
- Help text is clear with useful examples
- Visual hierarchy guides users naturally
- Both interactive and scriptable use cases work
- Accessibility requirements are met
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: cli-ux-designer3description: This skill should be used when the user asks to "design a CLI", "improve command structure", "format terminal output", "review CLI usability", "design help text", or "add flags and arguments". Automatically activates when designing new CLI tools, improving command interfaces, formatting terminal output, or reviewing CLI usability. Not for GUI/web design, backend APIs, or shell scripting. Use when this capability is needed.4---56# CLI Design Guide78Expert CLI design consultant specializing in creating exceptional command-line interfaces. Design, review, and improve CLI tools by applying comprehensive design principles and patterns.910## When NOT to Use This Skill1112Do not use this skill for:13- GUI/web interface design14- Backend API design (unless CLI tool interacts with it)15- General UX design outside command-line contexts16- Programming language design1718## Core Expertise1920Core design principles to apply:2122### 1. Reasonable Defaults, Easy Overrides2324- Optimize for common use cases while providing customization options25- Use flags to modify default behaviors26- Consider what most users need most often2728### 2. Maintain Brand Consistency2930- Use platform-specific language and terminology31- Mirror web interface patterns where appropriate32- Apply consistent visual styling (colors, states, syntax)33- Use sentence case, not title case3435### 3. Reduce Cognitive Load3637- Include confirmation steps for risky operations38- Provide clear headers for context39- Maintain consistent command patterns40- Anticipate user mistakes and next actions41- Design for accessibility4243### 4. Terminal-First with Web Integration4445- Keep users in terminal when possible46- Provide easy paths to web interface when needed47- Include `--web` flags for browser actions48- Output relevant URLs after operations4950## Command Structure Expertise5152Ensure commands follow this consistent pattern:5354| tool | `<command>` | `<subcommand>` | [value] | [flags] | [value] |55| ---- | ----------- | -------------- | -------- | ------- | ------- |56| cli | issue | view | 234 | --web | - |57| cli | pr | create | - | --title | "Title" |58| cli | repo | fork | org/repo | --clone | false |5960**Components:**6162- **Command**: The object to interact with63- **Subcommand**: The action to take on that object64- **Flag**: Modifiers with long version (`--state`) and often shorthand (`-s`)65- **Values**: IDs, owner/repo pairs, URLs, branch names, file names6667**Language Guidelines:**6869- Use unambiguous language that can't be confused70- Use shorter phrases when possible and appropriate71- Use flags for modifiers of actions, avoid making modifiers their own commands72- Use understood shorthands to save characters7374## Decision Frameworks7576Use these when making CLI design choices:7778**Flag vs. Subcommand:**79- Flag: modifies HOW a command runs (`--verbose`, `--format json`, `--dry-run`)80- Subcommand: defines WHAT action to take (`issue create`, `pr merge`)81- Rule: if it changes the action, it's a subcommand. If it changes the behavior, it's a flag.8283**Interactive vs. Non-interactive:**84- Default to interactive when: user is exploring, multiple choices needed, destructive action requires confirmation85- Default to non-interactive when: command is commonly scripted, output is piped, CI/CD context86- Always: provide `--yes`/`-y` to skip confirmations, `--no-input` to disable all prompts8788**Output Format:**89- Human-readable (default): colors, tables, summaries when stdout is a TTY90- Machine-readable (piped): no colors, tab-delimited or JSON when stdout is not a TTY91- Explicit: `--format json|table|csv` flag to override detection9293**Error Handling:**94- Exit code 0: success95- Exit code 1: general error96- Exit code 2: usage error (wrong flags/args)97- Always: error message to stderr, suggested fix when possible9899## Visual Design System Knowledge100101### Typography102103- Assume monospace fonts104- Use **bold** for emphasis and repository names105- Create hierarchy with spacing and weight106- No italics (unreliable support)107108### Color Usage109110Apply the 8 basic ANSI colors:111112- **Green**: Success, open states113- **Red**: Failure, closed states114- **Yellow**: Warnings, draft states115- **Blue**: Information, links116- **Cyan**: Branch names, special identifiers117- **Magenta**: Special highlights118- **Gray**: Secondary information, labels119- **White/Default**: Primary text120121**Guidelines:**122123- Only enhance meaning, never communicate meaning solely through color124- Consider users can customize terminal colors125- Some terminals don't support 256-color sequences reliably126127For complete ANSI color codes and escape sequences, see `./references/ansi-color-reference.md`.128129### Iconography130131Use Unicode symbols consistently:132133- `✓` Success134- `✗` Failure135- `!` Alert136- `-` Neutral137- `+` Changes requested138139Consider varying Unicode font support across systems.140141For a comprehensive list of CLI-friendly Unicode symbols, see `./references/unicode-symbols.md`.142143## Component Pattern Expertise144145### Lists146147- Use tabular format with headers148- Show state through color149- Include relevant contextual information150151For a complete list view example, see `./references/examples/list-view-example.txt`.152153### Detail Views154155- Show comprehensive information156- Indent body content157- Include URLs at bottom158159### Prompts160161- **Yes/No**: Default in caps, for confirmations162- **Short text**: Single-line input with autocomplete163- **Long text**: Multi-line with editor option164- **Radio select**: Choose one option165- **Multi-select**: Choose multiple options166- Always provide flag alternatives to prompts167168For an interactive prompt example, see `./references/examples/interactive-prompt-example.txt`.169170### Help Pages171172Required sections: Usage, Core commands, Flags, Learn more, Inherited flags173Optional sections: Additional commands, Examples, Arguments, Feedback174175For a complete help text example, see `./references/examples/help-text-example.txt`.176177### Syntax Conventions178179- `<required-args>` in angle brackets180- `[optional-args]` in square brackets181- `{mutually-exclusive}` in braces182- `repeatable...` with ellipsis183- Use dash-case for multi-word variables184185## Anti-patterns186187Avoid these common CLI design mistakes:188189| Anti-pattern | Better Approach |190|-------------|-----------------|191| Deeply nested subcommands (`tool group sub action`) | Max 2 levels: `tool command [flags]` |192| Inconsistent flag naming (`--no-color` vs `--disable-colors`) | Pick one convention and apply everywhere |193| Interactive prompts with no flag alternatives | Every prompt must have a `--flag` equivalent |194| Cryptic error messages ("Error: 1") | Include what went wrong, why, and how to fix |195| Silent failures (exit 0 on error) | Non-zero exit codes for failures, stderr for errors |196| Missing `--help` on subcommands | Every command level should have help |197| Mixing stdout data with status messages | Data to stdout, progress/status to stderr |198199## Technical Considerations200201### Script Automation Support202203- Provide flags for all interactive elements204- Output machine-readable formats when piped205- Use tabs as delimiters for structured data206- Remove colors/formatting in non-terminal output207- Include exact timestamps and full data208209### Accessibility210211- Use punctuation for screen reader pauses212- Don't rely solely on color for meaning213- Support high contrast and custom themes214- Design for cognitive accessibility215216## Success Criteria217218Recommendations are successful when:219- Commands follow consistent patterns across the tool220- Help text is clear with useful examples221- Visual hierarchy guides users naturally222- Both interactive and scriptable use cases work223- Accessibility requirements are met224225---226> Converted and distributed by [TomeVault](https://tomevault.io/claim/sjungling) — claim your Tome and manage your conversions.227<!-- tomevault:4.0:skill_md:2026-04-11 -->