Skip to content

Revamp CLI output with lipgloss-powered UI#22

Merged
munezaclovis merged 4 commits intomainfrom
feat/ui-revamp
Mar 6, 2026
Merged

Revamp CLI output with lipgloss-powered UI#22
munezaclovis merged 4 commits intomainfrom
feat/ui-revamp

Conversation

@munezaclovis
Copy link
Copy Markdown
Contributor

Summary

  • Create internal/ui package with spinner, progress bar, styled helpers, and lipgloss table rendering
  • Refactor all commands to use consistent styled output matching install.sh colors (purple accent, green success, red errors, muted gray)
  • Add charmbracelet/lipgloss dependency for terminal styling

What changed

  • pv install / pv update: 8 clean spinner steps, progress bar for PHP downloads, --verbose flag, elapsed time footer
  • pv status: Colored status indicator (green/red dot), lipgloss table for sites
  • pv list: Lipgloss table with rounded purple borders
  • pv link / pv unlink: Styled success/error with clickable https:// URLs
  • pv start / pv stop / pv restart: Spinners for async ops, clean error states
  • pv use: Version transition arrow (8.4 → 8.5)
  • pv php install/list/remove: Spinners, progress bars, styled errors
  • pv service install/uninstall: Spinners for daemon operations
  • Suppress child process output by default (controlled by Verbose flag)
  • Acquire sudo credentials upfront during install to avoid password prompt colliding with spinners
  • ErrAlreadyPrinted sentinel prevents duplicate error messages from cobra

Test plan

  • go test ./... passes
  • pv install --force shows spinner steps with checkmarks
  • pv status shows colored table
  • pv list shows lipgloss table with borders
  • pv link / pv unlink show styled messages, no duplicate errors
  • pv restart when stopped shows clean message (no usage dump)
  • pv php list shows colored version list

Create internal/ui package with spinner, progress bar, styled helpers,
and lipgloss table rendering. Refactor all commands to use consistent
styled output: spinners for async operations, checkmarks for success,
styled errors that don't duplicate messages.

- Add charmbracelet/lipgloss dependency for terminal styling
- Create internal/ui with spinner, progress bar, table, and style helpers
- Colors match install.sh (purple accent, green success, red errors)
- Refactor pv install/update with 8 clean spinner steps + progress bar
- Add --verbose flag to install and update commands
- Suppress child process output by default (binaries, phpenv, setup)
- Acquire sudo credentials upfront to avoid password prompt during spinners
- Prettify all commands: status, list, link, unlink, start, stop, restart,
  service, use, php install/list/remove
- Use lipgloss table with rounded borders for site listings
- Add ErrAlreadyPrinted sentinel to prevent duplicate error messages
- Set SilenceErrors on rootCmd so cobra never prints raw errors
- Add footer with elapsed time for install/update
@munezaclovis
Copy link
Copy Markdown
Contributor Author

@claude fix the failing e2e.yml tests!

We're been changing the ui for a lot of these commands so I guess this might've broken the e2e tests

@claude
Copy link
Copy Markdown

claude Bot commented Mar 5, 2026

Claude finished @munezaclovis's task in 5m 47s —— View job


Fixing failing e2e tests

Root cause: The UI revamp moved all CLI output to os.Stderr for lipgloss styling, but e2e scripts were using $(command) which only captures stdout — so captured variables were always empty. Additionally, some output format strings changed with the new UI.

  • Gather context: check CI status and failing test logs
  • Read e2e test scripts to understand what assertions are being made
  • Compare with changed command output from the UI revamp
  • Fix verify-install.sh: capture stderr + "* 8.4""(global)"
  • Fix link-verify.sh: capture stderr for both pv list and pv php list + "(default)""(global)"
  • Fix lifecycle.sh: add 2>&1 to pv list pipe and pv php list capture
  • Fix stop.sh: capture stderr + "stopped""Stopped" (capitalized)
  • Fix start-curl.sh: capture stderr + "running""Running" (capitalized)
  • Fix dynamic-unlink.sh: add 2>&1 to pv list pipe
  • Commit and push fixes

Changes pushed in commit 188c562:

File Fix
verify-install.sh $(pv php list 2>&1) + "* 8.4""(global)"
link-verify.sh $(pv list 2>&1), $(pv php list 2>&1), "(default)""(global)"
lifecycle.sh pv list 2>&1 |, $(pv php list 2>&1)
stop.sh $(pv status 2>&1), "stopped""Stopped"
start-curl.sh $(pv status 2>&1), "running""Running"
dynamic-unlink.sh pv list 2>&1 |

|

The UI revamp moved all CLI output to os.Stderr for lipgloss styling.
E2e scripts were capturing stdout only; add 2>&1 to capture stderr too.
Also update assertions to match the new output format.

Co-authored-by: Clovis <munezaclovis@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@munezaclovis
Copy link
Copy Markdown
Contributor Author

@claude Lets revert the "(default)" -> "(global)" change.
I'd like to keep the (default) so plz make necessary changed in both the go code and the testing bash scripts!

@claude
Copy link
Copy Markdown

claude Bot commented Mar 5, 2026

Claude finished @munezaclovis's task in 1m 16s —— View job


Reverted "(global)" → "(default)"

  • Find all "(global)" occurrences in Go code and bash scripts
  • Revert to "(default)" in Go source files
  • Revert to "(default)" in e2e bash scripts
  • Commit and push changes

Changes in commit 071893e:

File Change
cmd/php_list.go:54 "(global)""(default)"
cmd/status.go:74 "(global)""(default)"
scripts/e2e/verify-install.sh:16 "(global)""(default)"
scripts/e2e/link-verify.sh:26 "(global)""(default)"
scripts/e2e/start-curl.sh:12 "8.4 (global)""8.4 (default)"

github-actions Bot and others added 2 commits March 5, 2026 18:03
Reverts the "(global)" label back to "(default)" in both the Go source
(php_list.go, status.go) and the e2e test scripts.

Co-authored-by: Clovis <munezaclovis@users.noreply.github.com>
Installing an already-installed PHP version now succeeds (exit 0) with
a friendly checkmark message, like mkdir -p on an existing directory.
Update e2e test to match.
@munezaclovis munezaclovis merged commit 119135f into main Mar 6, 2026
2 checks passed
@munezaclovis munezaclovis deleted the feat/ui-revamp branch March 6, 2026 04:39
munezaclovis added a commit that referenced this pull request Mar 6, 2026
Apply UI styling (spinners via ui.Step) from PR #22 to the renamed
daemon.go, and remove the now-obsolete service.go.
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.

1 participant