Repository navigation
feat(tui): add Bubble Tea TUI dashboard with detail view, logs, and project management, fixes #5762 - #8144
Conversation
|
Download the artifacts for this pull request:
See Testing a PR. |
tyler36
left a comment
There was a problem hiding this comment.
Had a brief play.
- Start random project
- Restart project
- SSH into project
- Stop project
I liked that I was always returned to the TUI between actions.
Some of the keybindings felt weird. EG. o to open, but my fingers want to type l for launch, but theres already l for logs. I'll need to retrain my fingers.
|
Could we add a Should we include something to open XHgui? I guess most people use tasks to automatically start/stop xdebugger via their IDE but perhaps we should include this ability too. |
|
Your wish is Claude's command:
|
|
the dashboard command is unknown in the latest version but the |
|
@rpkoller I'm not sure what you mean by "dashboard". You launch this with just |
|
i was following what was written in the issue summary: |
|
Thanks, yeah that's trying to say "DDEV dashboard" not |
06f5ee5 to
836e8d5
Compare
|
It's conceivable this could make it into v1.25.1 |
|
yes ddev alone worked as well. but the one thing i wonder why not replace |
|
@rpkoller we try hard to not change existing behavior. |
baeb0de to
e50f607
Compare
## The Issue - Fixes ddev#5762 DDEV has 78+ CLI commands and users who aren't deeply familiar with the command line struggle to discover and remember them. An external proof-of-concept (ddev-mngr) validated the approach of a TUI layer. ## How This PR Solves The Issue Adds a built-in interactive dashboard using Bubble Tea that launches when `ddev` is run with no arguments in a terminal. All existing `ddev <command>` usage continues to work identically. - **Entry point**: Bare `ddev` in a TTY auto-launches TUI; also available via explicit `ddev tui`. Piped usage shows help as before. - **Opt-out**: `DDEV_NO_TUI=true` env var or `ddev config global --no-tui` - **Operations**: TUI suspends via `tea.ExecProcess` for start/stop/restart, running the ddev binary as a subprocess so all hooks, output, and checks work normally. - **Dashboard**: Project list with status, type, URL. Keybindings for start (s), stop (x), restart (r), open in browser (o), filter (/), refresh (R), help (?), quit (q). Auto-refresh every 5 seconds. - **Styling**: Respects `SimpleFormatting` and `NO_COLOR`. Uses alternate screen buffer to avoid polluting scroll-back. New dependencies: charmbracelet/bubbletea, bubbles, lipgloss (vendored). ## Manual Testing Instructions 1. Build: `make` 2. Run bare `ddev` in a terminal -- TUI should launch 3. Navigate with j/k or arrows, press s to start, x to stop, o to open 4. Press / to filter projects, Esc to clear filter 5. Press ? for help overlay 6. Verify `ddev list` and other commands still work normally 7. Verify `echo | ddev` shows help (piped, not a TTY) 8. Verify `DDEV_NO_TUI=true ddev` shows help 9. Verify `ddev tui` always launches the TUI ## Automated Testing Overview 17 unit tests in pkg/tui/ covering model initialization, project loading, cursor navigation, filtering (including case-insensitive), help toggle, quit, view rendering, error handling, and cursor bounds. No Docker required. ## Release/Deployment Notes New optional feature, no breaking changes. Adds ~5-10MB to vendored deps. Future phases: project detail view, log viewer, config editor, command palette. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Add depth to the TUI dashboard: pressing Enter/d on a project opens a detail view (equivalent to ddev describe), and pressing l opens a log viewer showing recent container logs. Detail view shows project type, PHP/Node.js versions, webserver, database, xdebug, performance mode, URLs, mailpit, DB port, add-ons, and services. Log view supports toggling between web/db, scrolling with j/k, and manual refresh with R. Esc navigates back through views. Co-Authored-By: Claude Opus 4.6 <[email protected]>
…tions Detail view now auto-refreshes on each tick interval so service statuses stay current. Operations (start/stop/restart) from the detail view now reload both the detail and the dashboard project list to keep them in sync. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Press 'e' in the detail view to ddev ssh into the web container, suspending the TUI and handing off the terminal to the interactive shell session. Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Add animated loading spinner using bubbles/spinner for all loading states (project list, detail view, log view) - Sort services deterministically: web first, db second, rest alphabetical - Narrow terminal (<60 cols): shrink project names, hide URLs - Wide terminal: truncate URLs that would overflow the terminal width Co-Authored-By: Claude Opus 4.6 <[email protected]>
Multi-project operations: - S starts all projects, X stops all projects from the dashboard - Both require y to confirm, any other key cancels - No-op when there are no projects Error resilience: - Check AppRoot exists before loading detail or logs, with clear error message when a project directory has been deleted - Show error and "Press R to retry" when project loading fails (e.g., Docker not running) - Clear error state on successful reload Co-Authored-By: Claude Opus 4.6 <[email protected]>
Replace hardcoded ANSI color 8 (bright black) with Faint(true) for de-emphasized text. Color 8 is invisible on Solarized Dark and problematic on many terminal themes. Faint uses the terminal's own default foreground dimmed, ensuring readable contrast everywhere. Add contextual hint when all projects are stopped so users know to press 's' to start selected or 'S' to start all. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Remap launch/open from 'o' to 'l', move logs from 'l' to 'L', and add 'm' to open Mailpit in the browser. Works in both dashboard and detail views. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Replace the ExecProcess-based log viewer with an in-TUI streaming log view. Runs `ddev logs -f` as a background subprocess, streams output line-by-line into the TUI, and auto-scrolls to show the latest output at the bottom. Press esc to kill the log process and return to detail view. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Add x key to launch XHGui (enables xhprof + opens UI) in both dashboard and detail views. Remap stop from x to S, start all from S to a, and stop all from X to A. Co-Authored-By: Claude Opus 4.6 <[email protected]>
…uildkite] Add integration tests behind //go:build integration tag so unit tests run in <0.1s without Docker. Make dashboard name column auto-size to the longest project name instead of hardcoding 16 chars. Co-Authored-By: Claude Opus 4.6 <[email protected]>
…n terminal detection - Auto-detect plain/dumb terminals via termenv.ColorProfile() for colorless output - Display router status (healthy/stopped/unhealthy) in dashboard footer - Add X key in detail view to toggle xdebug on running projects - Add P key in dashboard for poweroff with confirmation - Add c key in detail view to copy primary URL to clipboard (pbcopy/xclip/xsel/wl-copy) - Fix pre-existing QF1012 lint warnings (WriteString+Sprintf -> Fprintf) - Update help view and key hints for all new bindings Co-Authored-By: Claude Opus 4.6 <[email protected]>
Add a 'C' key binding to run `ddev config` interactively from the TUI, using stderr capture so actual error messages display in the status bar instead of generic "exit status 1". Update empty-state text to guide users toward the new key. Add TUI documentation to cli.md, index.md, managing-projects.md, and project.md. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Capture the output of `ddev xdebug toggle` and parse it to determine whether xdebug was enabled or disabled, then display "Xdebug enabled" or "Xdebug disabled" in the status bar instead of the generic "Xdebug toggled". Co-Authored-By: Claude Opus 4.6 <[email protected]>
Instead of suspending the TUI with tea.ExecProcess for start/stop/restart/ poweroff, stream the command output within a dedicated operation view (like the existing logs view). On success, auto-return to the previous screen after 2 seconds. On error, stay on the operation view so the user can read the output and press esc to go back. - Add viewOperation mode with operationView() rendering - Add startOperationStreamCmd() for background subprocess streaming - Add waitForOperationLineCmd() with error channel support - Add enterOperationView() helper and handleOperationKey() for navigation - Add operationAutoReturnMsg with 2-second delay via tea.Tick - Convert all start/stop/restart/poweroff actions from ddevExecCommand - Remove unused ddevExecCommand() wrapper - Add tests for auto-return, line cap, operation view lifecycle Co-Authored-By: Claude Opus 4.6 <[email protected]>
… from disk [skip buildkite] The "Refreshing..." status message was never cleared on successful load, making it appear stuck. Also, loadProjects() read from the in-memory global project list which missed changes made by subprocesses like ddev config. Now calls globalconfig.ReadProjectList() to re-read from disk before fetching projects. Co-Authored-By: Claude Opus 4.6 <[email protected]>
…buildkite] Document NO_COLOR, simple_formatting, TERM, and DDEV_NO_TUI options for users with unusual terminals or color rendering issues. Co-Authored-By: Claude Opus 4.6 <[email protected]>
…ildkite] Co-Authored-By: Claude Opus 4.6 <[email protected]>
e50f607 to
2780b8b
Compare
|
I sure like that fix! |


The Issue
Inspired by https://github.com/dkd-dobberkau/ddev-mngr from @dkd-dobberkau
Adds a Bubble Tea-based TUI dashboard to DDEV, providing an interactive terminal interface for managing projects without memorizing CLI commands.
Try it out by just typing
ddevHow This PR Solves The Issue
Implements a full TUI dashboard accessible via
ddev tui(orddev dashboard) with three views:Dashboard View — Lists all DDEV projects with status, type, and URL. Supports:
Detail View (Enter/d) — Shows full project info equivalent to
ddev describe:Log View (l from detail) — Shows last 100 lines of container logs:
Additional features:
--no-tuiflag andDDEV_NO_TUIenv var to prevent recursionManual Testing Instructions
ddevlto open log view, verify web logs appear, pressdto switch to db logss/x/rto start/stop/restart from both dashboard and detailS/Xfor start all/stop all (should prompt for confirmation)ein detail view to SSH into web container/to filter projects, Esc to clearAutomated Testing Overview
63 unit tests in
pkg/tui/model_test.gocovering:All tests run without Docker — they test the Bubble Tea model/update/view cycle with synthetic messages.
Next Steps
This PR delivers the TUI foundation. Planned follow-ups:
loadDetailCmd,loadLogsCmd, and the exec commands against real DDEV projects with Docker. The current 63 tests are all unit tests against the model layer; integration tests would verify thecommands.gofunctions that callddevapp.NewApp,app.Describe,app.CaptureLogs, andddevapp.GetInstalledAddonNameswith actual running containers.routerStatusfield to show Traefik health in the dashboard footer.ddev poweroffshortcut with confirmation from the dashboard.Release/Deployment Notes
ddevand no arguments.--no-tuiglobal flag andDDEV_NO_TUIenvironment variableno_tuioption to global configcharmbracelet/bubbletea,charmbracelet/bubbles,charmbracelet/lipgloss, and their transitive dependencies🤖 Generated with Claude Code