Skip to content

feat(tui): add Bubble Tea TUI dashboard with detail view, logs, and project management, fixes #5762 - #8144

Merged
rfay merged 20 commits into
ddev:mainfrom
rfay:20260213_rfay_bubbletea
Feb 19, 2026
Merged

rfay merged 20 commits into
ddev:mainfrom
rfay:20260213_rfay_bubbletea

Conversation

@rfay

@rfay rfay commented Feb 14, 2026 •

Copy link
Copy Markdown
Member

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 ddev

How This PR Solves The Issue

Implements a full TUI dashboard accessible via ddev tui (or ddev dashboard) with three views:

Dashboard View — Lists all DDEV projects with status, type, and URL. Supports:

  • Navigation with j/k or arrow keys
  • Start/stop/restart individual projects (s/x/r)
  • Start all / stop all with confirmation prompt (S/X)
  • Open project URL in browser (o)
  • Filter projects by name/type/status (/)
  • Auto-refresh every 5 seconds

Detail View (Enter/d) — Shows full project info equivalent to ddev describe:

  • PHP version, webserver type, Node.js version, docroot, database, xdebug status, performance mode
  • URLs, Mailpit URL, DB published port
  • Installed add-ons
  • Service statuses (sorted: web first, db second, rest alphabetical)
  • Start/stop/restart/open/SSH actions from this view
  • Auto-refresh on tick interval

Log View (l from detail) — Shows last 100 lines of container logs:

  • Toggle between web/db service (w/d)
  • Scroll with j/k
  • Manual refresh with R

Additional features:

  • Animated loading spinner (bubbles/spinner)
  • Narrow terminal support (< 60 cols shrinks names, hides URLs)
  • SSH into web container from detail view (e)
  • Error resilience: checks for missing project directories, shows retry hint when Docker is down
  • Global --no-tui flag and DDEV_NO_TUI env var to prevent recursion

Manual Testing Instructions

  1. Minor docs at
  1. Run: ddev
  2. Verify project list shows with statuses and types
  3. Navigate with j/k, press Enter on a project to see detail view
  4. In detail view: verify PHP, webserver, database, URLs, services are correct
  5. Press l to open log view, verify web logs appear, press d to switch to db logs
  6. Press Esc to navigate back through views
  7. Test s/x/r to start/stop/restart from both dashboard and detail
  8. Test S/X for start all/stop all (should prompt for confirmation)
  9. Test e in detail view to SSH into web container
  10. Test / to filter projects, Esc to clear
  11. Resize terminal to < 60 cols, verify layout adapts
  12. Test with Docker stopped — should show error with retry hint

Automated Testing Overview

63 unit tests in pkg/tui/model_test.go covering:

  • Model initialization and state
  • Cursor navigation and bounds checking
  • Filter mode (enter, type, backspace, confirm, clear)
  • View transitions (dashboard→detail, detail→logs, back navigation)
  • All message handlers (projectsLoaded, detailLoaded, logsLoaded, operationFinished)
  • Detail view rendering with all fields
  • Log view rendering, scrolling, service toggling
  • Key bindings per view mode (dashboard/detail/log)
  • Multi-project operations (start all/stop all confirmation and cancellation)
  • Error resilience (load errors, retry hints, error clearing)
  • Visual polish (service sorting, truncation, narrow terminal, spinner, isLoading)
  • Help view and quit from all views

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:

  • Integration tests — Tests that exercise 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 the commands.go functions that call ddevapp.NewApp, app.Describe, app.CaptureLogs, and ddevapp.GetInstalledAddonNames with actual running containers.
  • Router status — Wire up the existing routerStatus field to show Traefik health in the dashboard footer.
  • Xdebug toggle — Quick toggle from detail view without leaving the TUI.
  • Poweroff — ddev poweroff shortcut with confirmation from the dashboard.
  • Service SSH selection — Extend SSH to pick which service to connect to, not just web.
  • URL copy to clipboard — Copy the primary URL from detail view.

Release/Deployment Notes

  • Adds new TUI dashboard to DDEV, enter with ddev and no arguments.
  • Adds --no-tui global flag and DDEV_NO_TUI environment variable
  • Adds no_tui option to global config
  • Vendors new dependencies: charmbracelet/bubbletea, charmbracelet/bubbles, charmbracelet/lipgloss, and their transitive dependencies
  • No changes to existing DDEV behavior — the TUI is purely additive

🤖 Generated with Claude Code

@rfay
rfay requested review from a team as code owners February 14, 2026 06:50
@github-actions github-actions Bot added dependencies Pull requests that update a dependency file enhancement labels Feb 14, 2026
@github-actions

github-actions Bot commented Feb 14, 2026 •

Copy link
Copy Markdown

@rfay rfay changed the title feat(tui): add Bubble Tea TUI dashboard with detail view, logs, and project management feat(tui): add Bubble Tea TUI dashboard with detail view, logs, and project management, fixes #5762 Feb 15, 2026
@rfay rfay mentioned this pull request Feb 16, 2026
1 task done

@tyler36 tyler36 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@tyler36

tyler36 commented Feb 16, 2026

Copy link
Copy Markdown
Collaborator

Could we add a m to open mailpit?

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.

@rfay

rfay commented Feb 16, 2026

Copy link
Copy Markdown
Member Author

Your wish is Claude's command:

  • m for Mailpit
  • l for launch
  • Streaming logs instead of static-at-beginning logs
  • Integration tests

@rpkoller

Copy link
Copy Markdown
Collaborator

the dashboard command is unknown in the latest version

$> ddev dashboard
Error: unknown command "dashboard" for "ddev"
Run 'ddev --help' for usage.

but the tui one works (will take a closer look in the next days, was just a glimps right before bed)

@rfay

rfay commented Feb 17, 2026

Copy link
Copy Markdown
Member Author

@rpkoller I'm not sure what you mean by "dashboard". You launch this with just ddev or alternately ddev tui, but mostly just ddev. Thanks for testing!

@rpkoller

Copy link
Copy Markdown
Collaborator

i was following what was written in the issue summary:

Implements a full TUI dashboard accessible via ddev tui (or ddev dashboard) with three views:

@rfay

rfay commented Feb 17, 2026

Copy link
Copy Markdown
Member Author

Thanks, yeah that's trying to say "DDEV dashboard" not ddev dashboard. But I hope you were able to run ddev

@rfay
rfay force-pushed the 20260213_rfay_bubbletea branch 2 times, most recently from 06f5ee5 to 836e8d5 Compare February 17, 2026 19:35
@rfay
rfay requested review from stasadev and tyler36 February 17, 2026 19:54
@rfay

rfay commented Feb 17, 2026

Copy link
Copy Markdown
Member Author

It's conceivable this could make it into v1.25.1

@rpkoller

Copy link
Copy Markdown
Collaborator

yes ddev alone worked as well. but the one thing i wonder why not replace ddev listwith it? it is covering the same basica functionality with a few extras. while access it via just ddev would make the man page unavailable that is currently displayed with just ddev

@rfay

rfay commented Feb 17, 2026

Copy link
Copy Markdown
Member Author

@rpkoller we try hard to not change existing behavior. ddev list is long established, and remember ddev list -j

@rfay
rfay force-pushed the 20260213_rfay_bubbletea branch from baeb0de to e50f607 Compare February 18, 2026 16:14
rfay and others added 8 commits February 19, 2026 16:22
## 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]>
rfay and others added 12 commits February 19, 2026 16:22
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]>
@stasadev
stasadev force-pushed the 20260213_rfay_bubbletea branch from e50f607 to 2780b8b Compare February 19, 2026 14:30

@stasadev stasadev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

I pushed one more commit to show all keybindings:

Before (one row):
before

After (several rows):
after

@rfay

rfay commented Feb 19, 2026

Copy link
Copy Markdown
Member Author

I sure like that fix!

@rfay
rfay merged commit 4ba2d92 into ddev:main Feb 19, 2026
29 of 30 checks passed
@rfay
rfay deleted the 20260213_rfay_bubbletea branch February 19, 2026 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rework DDEV UI as a TUI using Bubbletea

4 participants