How kumarasakti/dpv works
dpv is a Go CLI that presents Docker container listings as readable terminal cards, a slim list, or JSON. The principal workflow is: the user supplies listing and display options; the CLI retrieves containers from Docker, filters and sorts them, computes summary statistics, selects a formatter, and writes the result. The formatter package provides the three documented output modes, with shared color styling for the human-readable modes. The graph follows the sampled CLI and runtime source; the README documents the output modes and flags.
Main entry points: root.go CLI orchestration · formatter.go Formatter helpers · client.go Docker client · pretty.go Card output
Components 13
CLI workflow
- Program entry
main.go - CLI orchestration
cmd/root.go
Container data
- Docker client
internal/docker/client.go - Container models
internal/docker/types.go - Search and sort
internal/filter/filter.go
Output rendering
- Formatter helpers
internal/formatter/formatter.go - Card output
internal/formatter/pretty.go - Slim output
internal/formatter/slim.go - JSON output
internal/formatter/json.go - Terminal styling
internal/color/color.go
Other components
- CLI user
- Docker Engine
- Terminal
Connections 16
- CLI user → Program entry: invokes
- Program entry → CLI orchestration: executes
- CLI orchestration → Docker client: creates, lists
- Docker client → Docker Engine: requests containers
- Docker client → Container models: normalizes data
- CLI orchestration → Search and sort: filters, sorts
- CLI orchestration → Container models: builds statistics
- CLI orchestration → Formatter helpers: selects, writes
- Formatter helpers → Card output: dispatches
- Formatter helpers → Slim output: dispatches
- Formatter helpers → JSON output: dispatches
- Card output → Terminal styling: styles output
- Slim output → Terminal styling: styles output
- Card output → Terminal: writes cards
- Slim output → Terminal: writes list
- JSON output → Terminal: writes JSON