# mathias-granlund/netloom architecture

> Architecture diagram of the GitHub repository mathias-granlund/netloom, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mathias-granlund/netloom
- Repository: https://github.com/mathias-granlund/netloom

## Overview

Netloom is a plugin-backed CLI for operating network APIs. The main workflow parses an operator command, resolves the active profile and plugin, uses the plugin’s API catalog to interpret the requested module/service/action, sends requests to the network API, and formats results safely. Separate workflows compare or copy objects across profiles and export/import running configuration. The README documents ClearPass discovery, contextual help/completion, and optional Delinea secret lookup. Some implementation wiring is unsampled, so the graph omits uncertain call relationships.

Main entry points: [`src/netloom/cli/runtime.py`](https://github.com/mathias-granlund/netloom/blob/main/src/netloom/cli/runtime.py) (CLI runtime), [`src/netloom/plugins/clearpass/plugin.py`](https://github.com/mathias-granlund/netloom/blob/main/src/netloom/plugins/clearpass/plugin.py) (ClearPass plugin), [`src/netloom/cli/main.py`](https://github.com/mathias-granlund/netloom/blob/main/src/netloom/cli/main.py) (CLI entry), [`src/netloom/core/running_config.py`](https://github.com/mathias-granlund/netloom/blob/main/src/netloom/core/running_config.py) (Running config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI experience"]
  node_cli_main["CLI entry<br/>[main.py]"]
  node_parser["Command parser<br/>[parser.py]"]
  node_cli_runtime["CLI runtime<br/>[runtime.py]"]
  node_help["Help and completion"]
  node_server_cmd["Profile commands<br/>[server.py]"]
end

subgraph group_workflows["Operator workflows"]
  node_core_actions["API actions<br/>[actions.py]"]
  node_diff["Compare profiles<br/>[diff.py]"]
  node_copy["Copy objects<br/>[copy.py]"]
  node_running_config["Running config<br/>[running_config.py]"]
  node_import_config["Configuration import<br/>[import_config.py]"]
end

subgraph group_integration["ClearPass integration"]
  node_plugin_registry["Plugin registry<br/>[plugin_registry.py]"]
  node_clearpass_plugin["ClearPass plugin<br/>[plugin.py]"]
  node_catalog[("API catalog<br/>[catalog.py]")]
  node_privilege_discovery["Privilege discovery"]
  node_clearpass_api["ClearPass API client<br/>[api.py]"]
  node_http_client["HTTP transport<br/>[client.py]"]
end

subgraph group_configuration["Configuration and data"]
  node_settings["Profile settings<br/>[config.py]"]
  node_output["Output and secrets<br/>[output.py]"]
  node_keystores["Secret providers"]
end

node_operator(("Operator"))
node_network_api(("Network API"))
node_secret_server(("Delinea Secret Server"))

node_operator -->|"runs command"| node_cli_main
node_cli_main -->|"parses arguments"| node_parser
node_cli_main -->|"dispatches command"| node_cli_runtime
node_cli_runtime -->|"resolves plugin"| node_plugin_registry
node_cli_runtime -->|"loads profile"| node_settings
node_cli_runtime -->|"routes profile commands"| node_server_cmd
node_cli_runtime -->|"runs API action"| node_core_actions
node_cli_runtime -->|"runs comparison"| node_diff
node_cli_runtime -->|"runs copy"| node_copy
node_cli_runtime -->|"exports config"| node_running_config
node_cli_runtime -->|"imports config"| node_import_config
node_cli_runtime -->|"serves help"| node_help
node_plugin_registry -->|"loads plugin"| node_clearpass_plugin
node_clearpass_plugin -->|"loads catalog"| node_catalog
node_clearpass_plugin -->|"uses API client"| node_clearpass_api
node_catalog -->|"discovers API"| node_network_api
node_clearpass_api -->|"sends requests"| node_http_client
node_http_client -->|"transmits HTTP"| node_network_api
node_privilege_discovery -->|"probes privileges"| node_clearpass_api
node_diff -->|"fetches objects"| node_clearpass_plugin
node_copy -->|"reads and writes"| node_clearpass_plugin
node_running_config -->|"fetches configuration"| node_clearpass_plugin
node_import_config -->|"restores objects"| node_clearpass_plugin
node_core_actions -->|"formats results"| node_output
node_running_config -->|"writes export"| node_output
node_import_config -->|"writes report"| node_output
node_operator -.->|"configures secrets"| node_secret_server
node_keystores -.->|"resolves references"| node_secret_server
node_settings -.->|"configures providers"| node_keystores

click node_cli_main "https://github.com/mathias-granlund/netloom/blob/main/src/netloom/cli/main.py"
click node_parser "https://github.com/mathias-granlund/netloom/blob/main/src/netloom/cli/parser.py"
click node_cli_runtime "https://github.com/mathias-granlund/netloom/blob/main/src/netloom/cli/runtime.py"
click node_help "https://github.com/mathias-granlund/netloom/blob/main/src/netloom/core/interactive_help.py"
click node_server_cmd "https://github.com/mathias-granlund/netloom/blob/main/src/netloom/cli/server.py"
click node_core_actions "https://github.com/mathias-granlund/netloom/blob/main/src/netloom/core/actions.py"
click node_diff "https://github.com/mathias-granlund/netloom/blob/main/src/netloom/core/diff.py"
click node_copy "https://github.com/mathias-granlund/netloom/blob/main/src/netloom/core/copy.py"
click node_running_config "https://github.com/mathias-granlund/netloom/blob/main/src/netloom/core/running_config.py"
click node_import_config "https://github.com/mathias-granlund/netloom/blob/main/src/netloom/core/import_config.py"
click node_plugin_registry "https://github.com/mathias-granlund/netloom/blob/main/src/netloom/core/plugin_registry.py"
click node_clearpass_plugin "https://github.com/mathias-granlund/netloom/blob/main/src/netloom/plugins/clearpass/plugin.py"
click node_catalog "https://github.com/mathias-granlund/netloom/blob/main/src/netloom/plugins/clearpass/catalog.py"
click node_privilege_discovery "https://github.com/mathias-granlund/netloom/blob/main/src/netloom/plugins/clearpass/privilege_discovery.py"
click node_clearpass_api "https://github.com/mathias-granlund/netloom/blob/main/src/netloom/plugins/clearpass/api.py"
click node_http_client "https://github.com/mathias-granlund/netloom/blob/main/src/netloom/http/client.py"
click node_settings "https://github.com/mathias-granlund/netloom/blob/main/src/netloom/core/config.py"
click node_output "https://github.com/mathias-granlund/netloom/blob/main/src/netloom/io/output.py"
click node_keystores "https://github.com/mathias-granlund/netloom/tree/main/src/netloom/keystores"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli_main,node_parser,node_cli_runtime,node_help,node_server_cmd toneBlue
class node_core_actions,node_diff,node_copy,node_running_config,node_import_config toneAmber
class node_plugin_registry,node_clearpass_plugin,node_catalog,node_privilege_discovery,node_clearpass_api,node_http_client,node_network_api,node_secret_server toneMint
class node_settings,node_output,node_keystores toneRose
class node_operator toneIndigo
```

## Components

### CLI experience

- [CLI entry](https://github.com/mathias-granlund/netloom/blob/main/src/netloom/cli/main.py): `src/netloom/cli/main.py`
- [Command parser](https://github.com/mathias-granlund/netloom/blob/main/src/netloom/cli/parser.py): `src/netloom/cli/parser.py`
- [CLI runtime](https://github.com/mathias-granlund/netloom/blob/main/src/netloom/cli/runtime.py): `src/netloom/cli/runtime.py`
- [Help and completion](https://github.com/mathias-granlund/netloom/blob/main/src/netloom/core/interactive_help.py): `src/netloom/core/interactive_help.py`
- [Profile commands](https://github.com/mathias-granlund/netloom/blob/main/src/netloom/cli/server.py): `src/netloom/cli/server.py`

### Operator workflows

- [API actions](https://github.com/mathias-granlund/netloom/blob/main/src/netloom/core/actions.py): `src/netloom/core/actions.py`
- [Compare profiles](https://github.com/mathias-granlund/netloom/blob/main/src/netloom/core/diff.py): `src/netloom/core/diff.py`
- [Copy objects](https://github.com/mathias-granlund/netloom/blob/main/src/netloom/core/copy.py): `src/netloom/core/copy.py`
- [Running config](https://github.com/mathias-granlund/netloom/blob/main/src/netloom/core/running_config.py): `src/netloom/core/running_config.py`
- [Configuration import](https://github.com/mathias-granlund/netloom/blob/main/src/netloom/core/import_config.py): `src/netloom/core/import_config.py`

### ClearPass integration

- [Plugin registry](https://github.com/mathias-granlund/netloom/blob/main/src/netloom/core/plugin_registry.py): `src/netloom/core/plugin_registry.py`
- [ClearPass plugin](https://github.com/mathias-granlund/netloom/blob/main/src/netloom/plugins/clearpass/plugin.py): `src/netloom/plugins/clearpass/plugin.py`
- [API catalog](https://github.com/mathias-granlund/netloom/blob/main/src/netloom/plugins/clearpass/catalog.py): `src/netloom/plugins/clearpass/catalog.py`
- [Privilege discovery](https://github.com/mathias-granlund/netloom/blob/main/src/netloom/plugins/clearpass/privilege_discovery.py): `src/netloom/plugins/clearpass/privilege_discovery.py`
- [ClearPass API client](https://github.com/mathias-granlund/netloom/blob/main/src/netloom/plugins/clearpass/api.py): `src/netloom/plugins/clearpass/api.py`
- [HTTP transport](https://github.com/mathias-granlund/netloom/blob/main/src/netloom/http/client.py): `src/netloom/http/client.py`

### Configuration and data

- [Profile settings](https://github.com/mathias-granlund/netloom/blob/main/src/netloom/core/config.py): `src/netloom/core/config.py`
- [Output and secrets](https://github.com/mathias-granlund/netloom/blob/main/src/netloom/io/output.py): `src/netloom/io/output.py`
- [Secret providers](https://github.com/mathias-granlund/netloom/tree/main/src/netloom/keystores): `src/netloom/keystores`

### Other components

- **Operator**
- **Network API**
- **Delinea Secret Server**

## Connections

- Operator → CLI entry: runs command
- CLI entry → Command parser: parses arguments
- CLI entry → CLI runtime: dispatches command
- CLI runtime → Plugin registry: resolves plugin
- CLI runtime → Profile settings: loads profile
- CLI runtime → Profile commands: routes profile commands
- CLI runtime → API actions: runs API action
- CLI runtime → Compare profiles: runs comparison
- CLI runtime → Copy objects: runs copy
- CLI runtime → Running config: exports config
- CLI runtime → Configuration import: imports config
- CLI runtime → Help and completion: serves help
- Plugin registry → ClearPass plugin: loads plugin
- ClearPass plugin → API catalog: loads catalog
- ClearPass plugin → ClearPass API client: uses API client
- API catalog → Network API: discovers API
- ClearPass API client → HTTP transport: sends requests
- HTTP transport → Network API: transmits HTTP
- Privilege discovery → ClearPass API client: probes privileges
- Compare profiles → ClearPass plugin: fetches objects
- Copy objects → ClearPass plugin: reads and writes
- Running config → ClearPass plugin: fetches configuration
- Configuration import → ClearPass plugin: restores objects
- API actions → Output and secrets: formats results
- Running config → Output and secrets: writes export
- Configuration import → Output and secrets: writes report
- Operator → Delinea Secret Server: configures secrets
- Secret providers → Delinea Secret Server: resolves references
- Profile settings → Secret providers: configures providers
