Add pterm UI library and modernize help command#570
Open
Conversation
- Replace basic help system with pterm-based terminal UI - Add colored, icon-enhanced help displays with responsive layouts - Update all commands to use new CreateHelp helper function - Improve visual hierarchy and readability of CLI output 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add pterm-styled help for all commands with beautiful formatting - Fix namespace commands showing duplicate/broken help output - Implement help request interception to bypass CLI framework issues - Add complete command map with proper descriptions matching original help - Support proper word wrapping and responsive terminal layouts - Clean up description parsing to prevent duplicate example text 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add terminal detection to disable pterm in non-TTY environments (tests) - Maintain backward compatibility for namespace command tests - Fix new command wizard to require path argument in test mode - Add golang.org/x/term dependency for terminal detection Tests now pass while maintaining beautiful pterm help in terminal usage. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Skip custom help preprocessing when not in TTY mode - Return base help in non-TTY mode to allow plugin wrapper to append - This fixes integration tests that expect plugin commands in help output 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Major architectural improvements to the help system: - Introduced HelpRenderer interface for clean abstraction - PtermHelpRenderer for beautiful terminal output - PlainHelpRenderer for non-TTY environments (tests, pipes) - Removed global state and suppression mechanism - Fixed namespace command help duplication issue - Added calledFromRun flag to prevent double output - Properly handles both `trellis db` and `trellis db --help` - Centralized command metadata - Created NamespaceInfo struct for namespace definitions - Single source of truth for namespace commands and subcommands - Eliminated duplicate command mappings - Improved code organization - Removed preprocessArgs hack with proper ShouldIntercept() method - Added constants for layout magic numbers - Cleaner separation of concerns Tests pass and the help system now works correctly in all modes while maintaining backward compatibility. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Changed description text from dark gray to white for better readability 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
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.
trellis --helpMain Help (categorized)
trellis new --helpRegular Command
trellis logs --helpRegular Command
trellis db --helpNamespace Command (single subcommand)
trellis db open --helpSubcommand (full pterm help)
trellis vault --helpNamespace Command (multiple subcommands)