dtree

command module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2026 License: MIT Imports: 7 Imported by: 0

README

dtree

A terminal UI that lists your Docker containers grouped by Compose project. Expand a project to see its containers, then open their logs, inspect them or open a shell, all with vim keys or the arrow keys.

  • Containers are grouped by the com.docker.compose.project label; containers outside Compose are listed under (standalone).
  • The list updates live from Docker's event stream.
  • An info panel below the list shows details for the selected container (image, status, ports) or project (directory, compose file, ports, networks, volumes).
  • Logs and inspect open in a built-in viewer with search, follow and line wrap. Inspect output is shown as YAML.
  • Quick commands: press x on a container, type a shell command and its output streams into a popup. Close the popup and the command keeps running; the container's row shows whether it is still running (⟳), succeeded (✓), failed (✗) or was stopped (■), and X brings the output back. ctrl+c in the popup stops a running command; press it again to kill a command that ignores it. Commands run with sh -c in a terminal but can't read your keyboard, so a command that asks for input waits until you stop it. Use s for interactive programs. Quitting dtree stops commands that are still running.

Install

Requires Go and the docker CLI.

go install github.com/sebastianmorch/dtree@latest

The binary is installed to $(go env GOPATH)/bin (usually ~/go/bin). Make sure that directory is on your PATH:

export PATH="$HOME/go/bin:$PATH"

Usage

dtree          # running containers
dtree -a       # all containers, including stopped ones
dtree --version

dtree connects to the daemon in DOCKER_HOST or, if that is unset, the current docker context (Docker Desktop, OrbStack, Colima, …).

Keys

Press ? inside dtree for this list.

Tree
Key Action
j / ↓, k / ↑ next / previous row
l / → expand project
h / ← collapse project / go to parent
enter toggle project · shell on container
space toggle project · logs on container
g / G top / bottom
/ or f filter by container or project name
esc clear filter
L logs
i inspect
s shell (bash, falls back to sh)
x run a command (output in a popup; ↑/↓ for history)
X show the last command's output
a toggle running / all containers
r refresh
q / ctrl+c quit
Logs, inspect & command output
Key Action
j / k, ↓ / ↑ scroll
ctrl+d / ctrl+u half page down / up
g / G top / bottom (G resumes follow)
/, n, N search, next, previous
f toggle follow (logs, output)
t toggle timestamps (logs)
r refresh (inspect)
w toggle line wrap
q / esc back · close popup
ctrl+c stop the running command (popup); again to kill it

Development

go run .        # run from source
go test ./...

License

MIT

Documentation

Overview

Command dtree shows Docker containers grouped by compose project, with vim-style navigation, a log viewer, inspect and shell access.

Directories

Path Synopsis
internal
docker
Package docker wraps the Docker Engine SDK behind a small interface the UI depends on, so the UI can be tested with a fake.
Package docker wraps the Docker Engine SDK behind a small interface the UI depends on, so the UI can be tested with a fake.
tree
Package tree groups containers into projects and tracks the cursor and expand/collapse state of the project/container tree.
Package tree groups containers into projects and tracks the cursor and expand/collapse state of the project/container tree.
ui
Package ui is the Bubble Tea interface: a project/container tree plus full-screen log and inspect viewers.
Package ui is the Bubble Tea interface: a project/container tree plus full-screen log and inspect viewers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL