Skip to content

Conversation

@retlehs
Copy link
Member

@retlehs retlehs commented Aug 11, 2025

Command Screenshot
trellis --help
Main Help (categorized)
image image
trellis new --help
Regular Command
image image
trellis logs --help
Regular Command
imageimage
trellis db --help
Namespace Command (single subcommand)
image
trellis db open --help
Subcommand (full pterm help)
image
trellis vault --help
Namespace Command (multiple subcommands)
image

retlehs and others added 2 commits August 10, 2025 21:03
- 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 <[email protected]>
- 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 <[email protected]>
@retlehs retlehs requested a review from swalkinshaw August 11, 2025 02:10
@retlehs retlehs self-assigned this Aug 11, 2025
@retlehs retlehs added the enhancement New feature or request label Aug 11, 2025
retlehs and others added 4 commits August 10, 2025 22:19
- 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 <[email protected]>
- 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 <[email protected]>
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 <[email protected]>
Changed description text from dark gray to white for better readability

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

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant