hatch-surf/cmd
Riley Zhang ee24ab8aeb feat: implement Phase 3 CLI Polish - Error handling, output formatting, completions
Implements comprehensive CLI improvements for Hatch:

Error Handling:
- Add structured CLIError type with exit codes
- Add consistent exit codes (OK, GeneralError, UsageError, NetworkError, ServerError, ConfigError)
- Add colored error messages with details
- Add proper connection refused error handling

Output Formatting:
- Add ANSI color support with terminal detection
- Add colored success/error/warning messages
- Add compact output format option
- Add --output flag for json/table/compact formats

Shell Completions:
- Add bash completions with full command/flag support
- Add zsh completions with descriptions and subcommand handling
- Add fish completions with helper functions
- Add PowerShell completions with native argument completer
- Add hatch completions <shell> command

Configuration Support:
- Add config file support (XDG_CONFIG_HOME or ~/.config/hatch/config.json)
- Add environment variable overrides (HATCH_URL, HATCH_FORMAT, NO_COLOR)
- Add hatch config show/set/get/init commands
- Add configuration keys: server_url, format, no_color, timeout

Additional Improvements:
- Add version command with build-time version injection
- Add help command with colored usage output
- Add --output flag to all commands for format control
- Add request timeout support
- Improve error messages with actionable suggestions
- Add comprehensive test coverage

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-06-24 05:17:58 +02:00
..
hatch feat: implement Phase 3 CLI Polish - Error handling, output formatting, completions 2026-06-24 05:17:58 +02:00