Skip to content

feat: add ANSI color output following GitHub CLI conventions#30

Merged
boneskull merged 2 commits intomainfrom
colors
Feb 6, 2026
Merged

feat: add ANSI color output following GitHub CLI conventions#30
boneskull merged 2 commits intomainfrom
colors

Conversation

@boneskull
Copy link
Owner

@boneskull boneskull commented Feb 6, 2026

Add colored terminal output to improve readability and user experience,
following the GitHub CLI Primer color guidelines.

  • Add internal/style package using mgutz/ansi for ANSI colors
  • Respect NO_COLOR, CLICOLOR, and TTY detection
  • Apply semantic colors: green (success), red (errors), yellow (warnings),
    cyan (branches), magenta (merged), gray (muted), bold (headers)
  • Add icons: ✓ (success), ✗ (failure), ! (warning)
  • Update all cmd files and tree formatting with color support
  • Add .claude/rules/colors.md documenting the color scheme

Copilot AI review requested due to automatic review settings February 6, 2026 21:00
@boneskull
Copy link
Owner Author

Stack


Managed by gh-stack

Add colored terminal output to improve readability and user experience,
following the GitHub CLI Primer color guidelines.

- Add `internal/style` package using `mgutz/ansi` for ANSI colors
- Respect `NO_COLOR`, `CLICOLOR`, and TTY detection
- Apply semantic colors: green (success), red (errors), yellow (warnings),
  cyan (branches), magenta (merged), gray (muted), bold (headers)
- Add icons: ✓ (success), ✗ (failure), ! (warning)
- Update all cmd files and tree formatting with color support
- Add `.claude/rules/colors.md` documenting the color scheme

Co-authored-by: Cursor <cursoragent@cursor.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a centralized terminal styling layer and applies it across command output to improve readability while respecting standard color/TTY conventions.

Changes:

  • Introduces internal/style with semantic styling helpers (success/error/warn/branch/merged/muted/bold) and ✓/✗/! icons.
  • Threads optional styling into tree formatting and updates most cmd/* user-facing output to use the new style helpers.
  • Documents the color/icon scheme in .claude/rules/colors.md.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
internal/tree/tree.go Adds optional *style.Style to FormatOptions and applies styling to branch display.
internal/style/style.go New package implementing semantic color + icon helpers with NO_COLOR/TTY behavior.
cmd/unlink.go Styles success output and branch name.
cmd/undo.go Styles undo flow output (muted, bold, branch, warning icon).
cmd/sync.go Styles warnings/success/dry-run output and threads style through helpers.
cmd/submit.go Styles submit phases, PR operations output, warnings, and prompts.
cmd/orphan.go Styles orphan success output and branch names.
cmd/log.go Styles porcelain/table output and threads style into tree formatting.
cmd/link.go Styles success output and branch name.
cmd/init.go Styles init output and trunk display.
cmd/create.go Styles create output and commit confirmation.
cmd/continue.go Styles continue output and completion messages.
cmd/cascade.go Styles cascade output, conflict output, and undo snapshot logging.
cmd/adopt.go Styles adopt success output and branch/parent display.
cmd/abort.go Styles abort warnings and completion output.
.claude/rules/colors.md Adds documentation for the color/icon conventions and environment behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Pass style instance to saveUndoSnapshotByName instead of creating new one
- Fix SuccessMessage newline placement in sync command
- Remove undocumented ℹ icon from init command

Co-authored-by: Cursor <cursoragent@cursor.com>
@boneskull boneskull merged commit dbfe73f into main Feb 6, 2026
7 checks passed
@boneskull boneskull deleted the colors branch February 6, 2026 21:16
@boneskull boneskull added the enhancement New feature or request label Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant