How wagoodman/dive works
Dive is a CLI for inspecting Docker/OCI images, exploring layer contents and estimating wasted space. The main path resolves an image from a selected source, analyzes its layers, then presents the result in an interactive terminal UI or emits JSON / a CI pass-fail evaluation. A separate build command supports build-then-analyze workflows. The graph includes the documented source and analysis capabilities; several provider and view details are unsampled, so links without direct excerpt or index evidence are omitted.
Main entry points: run.go CLI commands · app.go Interactive TUI · source.go Image sources · analysis.go Layer analysis
Components 19
CLI workflows
- CLI commands
cmd/dive/cli/internal/command/run.go - Build command
cmd/dive/cli/internal/command/build.go - Event bus
internal/bus/bus.go
Image analysis
- Image sources
internal/source/source.go - Image engines
- Layer analysis
dive/analysis.go - Layer trees
internal/layertree/layertree.go
Terminal exploration
- Progress UI
cmd/dive/cli/internal/ui/progress_ui.go - Image event handler
cmd/dive/cli/internal/ui/handler/handler.go - Interactive TUI
cmd/dive/cli/internal/ui/tui/app/app.go - View controller
cmd/dive/cli/internal/ui/tui/app/controller.go - Layer views
cmd/dive/cli/internal/ui/tui/view/layer.go - File tree view
cmd/dive/cli/internal/ui/tui/view/filetree.go - File tree model
cmd/dive/cli/internal/ui/tui/viewmodel/filetree.go - File tree data
cmd/dive/cli/internal/ui/tui/filetree/file_tree.go - Terminal layout
cmd/dive/cli/internal/ui/tui/layout/manager.go
Automation outputs
- CI evaluation
cmd/dive/cli/internal/command/ci/evaluator.go - JSON export
cmd/dive/cli/internal/command/export/export.go
Other components
- CLI user
Connections 16
- CLI user → CLI commands: invokes
- CLI user → Build command: builds and analyzes
- CLI commands → Image sources: loads image
cmd/dive/cli/internal/command/run.go - Image sources → Image engines: resolves image
- CLI commands → Layer analysis: analyzes image
cmd/dive/cli/internal/command/run.go - Layer analysis → Layer trees: uses layer trees
dive/analysis.go - CLI commands → CI evaluation: evaluates rules
- CLI commands → JSON export: exports analysis
- CLI commands → Event bus: publishes task events
cmd/dive/cli/internal/command/run.go - Progress UI → Image event handler: dispatches events
cmd/dive/cli/internal/ui/progress_ui.go - Image event handler → Event bus: handles image events
cmd/dive/cli/internal/ui/handler/handler.go - Interactive TUI → Terminal layout: configures layout
cmd/dive/cli/internal/ui/tui/app/app.go - Interactive TUI → View controller: creates controller
cmd/dive/cli/internal/ui/tui/app/app.go - View controller → Layer views: updates views
cmd/dive/cli/internal/ui/tui/app/controller.go - File tree view → File tree model: uses model
cmd/dive/cli/internal/ui/tui/view/filetree.go - File tree model → File tree data: uses tree data
cmd/dive/cli/internal/ui/tui/viewmodel/filetree.go