Skip to content

Latest commit

 

History

History
118 lines (69 loc) · 7.38 KB

File metadata and controls

118 lines (69 loc) · 7.38 KB
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"
Loading

CodeBoardingDemoContact

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.

CLI Bootstrap

Creates the clio application, wires the global UI placeholder and registers the root Cobra command.

Related Classes/Methods:

Command Dispatcher [Expand]

Registers sub‑commands (run, build, ci), parses flags, and orchestrates the overall execution flow.

Related Classes/Methods:

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:

Image Provider & Adapter

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:

Event Bus

Central publish/subscribe hub; receives ExploreAnalysis (and other task events) and forwards them to any registered listeners.

Related Classes/Methods:

Terminal UI [Expand]

Subscribes to the Event Bus, renders the split‑pane interactive UI and reacts to key‑bindings / live updates.

Related Classes/Methods:

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:

Unclassified

Component for all unclassified files and utility functions (Utility functions/External Libraries/Dependencies)

Related Classes/Methods: None