Skip to content

Conversation

@ericanderson
Copy link
Owner

Summary

This PR implements comprehensive CLI output improvements as requested in issue #21. The main changes include:

  • Centralized output management: New outputFormatter utility provides consistent output handling across all commands
  • Verbose/quiet modes: Added -v/--verbose flag to all commands for detailed vs. essential output
  • Improved default experience: Default mode now shows only essential information (results, summaries, errors)
  • Better formatting: Consistent styling with emojis for success/warning/error messages and structured summaries

Changes Made

Core Infrastructure

  • Added src/utils/outputFormatter.ts with centralized output functions
  • Support for verbose/quiet modes with global state management
  • Consistent formatting for sections, summaries, errors, and success messages

CLI Enhancement

  • Added -v/--verbose flag to all three commands (remote, local, all)
  • Output options are set per-command based on CLI flags
  • Progress bars now only show in verbose mode

Output Improvements

  • Default mode: Shows only essential information - final counts, summaries, and errors
  • Verbose mode: Shows scanning progress, branch analysis details, progress bars, and detailed operation logs
  • Improved error handling and messaging consistency
  • Better formatting for interactive and non-interactive scenarios

Testing & Documentation

  • Comprehensive unit tests for the new output formatter (20 test cases)
  • Updated README with verbose flag usage examples and output mode explanations
  • Added "Output Modes" section explaining when to use each mode

User Experience

Before (verbose by default)

Scanning for local branches that can be safely deleted...
Found 15 local branches
Fetching merged pull requests from GitHub...
Found 42 merged pull requests

Branch Analysis:
  Safe to delete: 3
  Unsafe to delete: 12
[progress bar with individual deletion messages]

After - Default mode (clean & concise)

Found 3 local branches that can be safely deleted.
Deleting 3 local branches:
  Deleted: feature-1 (#123)
  Deleted: feature-2 (#124)
  Deleted: feature-3 (#125)

Summary:
  Successfully deleted: 3 local branches
  Skipped (unsafe): 12

After - Verbose mode (detailed information)

Scanning for local branches that can be safely deleted...
Found 15 local branches
Fetching merged pull requests from GitHub...
Found 42 merged pull requests

Found 3 local branches that can be safely deleted.

Skipping 12 unsafe branches:
  - main (protected branch)
  - feature-wip (2 unpushed commits)
  [... detailed list]

Deleting 3 local branches:
[progress bar with real-time updates]
  Deleted: feature-1 (#123)
  [... etc]

Testing

  • All new output formatter functionality has comprehensive unit tests
  • Existing functionality preserved (some test updates needed for new output format)
  • Manual testing confirms verbose/quiet modes work as expected across all commands

Documentation

  • Updated README with verbose flag examples for all commands
  • Added "Output Modes" section explaining usage scenarios
  • All commands now show verbose flag in help output

Fixes #21

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

ericanderson and others added 2 commits August 3, 2025 15:18
- Add promptWithCancel utility wrapper for inquirer with escape key support
- Update both local and remote commands to use escape key cancellation
- Press ESC during interactive selection to cancel operation gracefully
- Comprehensive test coverage with 7 test cases
- Updated documentation to explain the new UX feature

Fixes #24

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add centralized output formatter with verbose/quiet modes
- Implement -v/--verbose flag for all commands
- Reduce default output verbosity - show only essential information
- Show detailed progress information only in verbose mode
- Improve formatting and styling with consistent messaging
- Add comprehensive unit tests for output functionality
- Update documentation with verbose flag usage examples

Fixes #21

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
Owner Author

@ericanderson ericanderson left a comment

Choose a reason for hiding this comment

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

should we just use winston or pino with a custom output formatter?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

P2: Improve CLI output and add verbose option

2 participants