Skip to content

feat(output): add colored output to CLI and fetch/prune commands#215

Merged
avihut merged 1 commit intomasterfrom
daft-204/gwtfetch-colored
Feb 16, 2026
Merged

feat(output): add colored output to CLI and fetch/prune commands#215
avihut merged 1 commit intomasterfrom
daft-204/gwtfetch-colored

Conversation

@avihut
Copy link
Owner

@avihut avihut commented Feb 16, 2026

Summary

  • Add TTY-aware color support with NO_COLOR compliance to daft's own CLI output, resolving the visual mismatch between plain daft output and git's native colored output
  • Color CliOutput methods: success (green), warning (yellow prefix), error (red prefix), result (bold), step/debug (dim), detail (bold key)
  • Color inline status tags in fetch ([fetched] green, [skipped] yellow, [failed] red, [dry run] dim) and prune ([pruned] green)

Fixes #204

Test plan

  • mise run fmt -- clean
  • mise run clippy -- zero warnings
  • mise run test-unit -- 306 passed
  • mise run test-integration -- 175 passed (both default and gitoxide backends)
  • Manual: run gwtfetch --all in a terminal and verify colored output
  • Manual: run gwtfetch --all | cat and verify NO colors when piped
  • Manual: NO_COLOR=1 gwtfetch --all and verify NO colors

🤖 Generated with Claude Code

Add TTY-aware color support with NO_COLOR compliance to daft's own
output, matching the colored output that git already produces via
Stdio::inherit(). Colors are automatically disabled when piped.

- Add colors_enabled()/colors_enabled_stderr() with OnceLock caching
- Color CliOutput methods: success (green), warning (yellow prefix),
  error (red prefix), result (bold), step/debug (dim), detail (bold key)
- Color fetch status tags: [fetched] green, [skipped] yellow,
  [failed] red, [dry run] dim
- Color prune [pruned] tags green
- Use output.result() for headers, output.success() for summaries

Fixes #204

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@avihut avihut modified the milestone: v1.1.0 Feb 16, 2026
@avihut avihut added feat New feature labels Feb 16, 2026
@avihut avihut self-assigned this Feb 16, 2026
@avihut avihut merged commit c7eb95c into master Feb 16, 2026
4 checks passed
@avihut avihut deleted the daft-204/gwtfetch-colored branch February 16, 2026 15:23
This was referenced Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add gwtfetch colored output

1 participant