feat(cli): add styled output with theme-aware colors#278
Merged
Conversation
Add a new styled_output module that provides human-friendly, colorful CLI messages that automatically adapt to terminal theme (light/dark) and respect the NO_COLOR environment variable. Changes: - Created styled_output.rs with print_success, print_error, print_warning, print_info, and print_dim functions - Messages use themed colors: success (green), error (red), warning (amber), info (blue) - Icons: ✓ for success, ✗ for error, ⚠ for warning, ℹ for info - Automatically detects light/dark theme via COLORFGBG and ITERM_PROFILE - Updated login.rs, main.rs, import_cmd.rs, run_cmd.rs, uninstall_cmd.rs, and github_cmd.rs to use the new styled output The messages are now more human-friendly with clear visual indicators and consistent styling across the CLI.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a new
styled_outputmodule that provides human-friendly, colorful CLI messages that automatically adapt to the terminal theme and respect the NO_COLOR environment variable.Changes
New Module:
styled_output.rsprint_success,print_error,print_warning,print_info, andprint_dimfunctionsUpdated Files
login.rs: Login, logout, and status messages now use styled outputmain.rs: Session resume, server status, and mDNS messages use styled outputimport_cmd.rs: Import success/warning messages use styled outputrun_cmd.rs: Session sharing and clipboard messages use styled outputuninstall_cmd.rs: Backup and cleanup messages use styled outputgithub_cmd.rs: GitHub status messages use styled outputBefore vs After
Before:
After:
The messages are now more human-friendly with clear visual indicators and consistent styling across the CLI.