# gmeghnag/omc architecture

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

- Interactive diagram: https://gitdiagram.com/gmeghnag/omc
- Repository: https://github.com/gmeghnag/omc

## Overview

omc is a command-line client for inspecting OpenShift must-gather captures much like `oc`. The main workflow is to select a local or remote must-gather, then query captured resources and render results; specialized commands inspect logs, events, certificates, upgrade recommendations, and cluster subsystems. The graph includes major README capabilities and central indexed modules. Some command implementations and registrations were not sampled, so those links are documented or marked unverified rather than inferred from imports alone.

Main entry points: [`root/root.go`](https://github.com/gmeghnag/omc/blob/main/root/root.go) (Command Router), [`cmd/get/get.go`](https://github.com/gmeghnag/omc/blob/main/cmd/get/get.go) (Resource Retrieval), [`cmd/use/use.go`](https://github.com/gmeghnag/omc/blob/main/cmd/use/use.go) (Must-Gather Selection), [`cmd/events/events.go`](https://github.com/gmeghnag/omc/blob/main/cmd/events/events.go) (Event Queries)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI and Context"]
  node_cli["Command Router<br/>[root.go]"]
  node_context["Must-Gather Selection<br/>[use.go]"]
end

subgraph group_resources["Resource Queries"]
  node_get["Resource Retrieval<br/>[get.go]"]
  node_customhandlers["Resource Handlers"]
  node_describe["Resource Description<br/>[describe.go]"]
  node_projects["Project Listing<br/>[projects.go]"]
  node_events["Event Queries<br/>[events.go]"]
  node_logs["Log Retrieval<br/>[logs.go]"]
  node_stern["Multi-Pod Logs<br/>[stern.go]"]
end

subgraph group_cluster["Cluster Diagnostics"]
  node_network["Connectivity Checks<br/>[connectivity.go]"]
  node_etcd["etcd Diagnostics<br/>[etcdctl.go]"]
  node_prometheus["Prometheus Queries<br/>[rule.go]"]
  node_haproxy["HAProxy Backends<br/>[backends.go]"]
  node_ovn["OVN Diagnostics<br/>[hostnetinfo.go]"]
end

subgraph group_analysis["Specialized Analysis"]
  node_certificates["Certificate Inspection<br/>[inspect.go]"]
  node_recommend["Upgrade Recommendations"]
  node_machineconfig["MachineConfig Extraction<br/>[extract.go]"]
  node_source["Source Lookup<br/>[code.go]"]
end

subgraph group_shared["Shared Presentation"]
  node_deserialize["Data Deserialization<br/>[deserializer.go]"]
  node_tables["Table Rendering<br/>[tablegenerator.go]"]
end

node_engineer(("Engineer"))

node_engineer -->|"runs commands"| node_cli
node_cli -->|"routes selection"| node_context
node_engineer -->|"selects capture"| node_context
node_context -->|"then queries"| node_get
node_cli -.->|"routes get"| node_get
node_cli -.->|"routes describe"| node_describe
node_cli -.->|"routes projects"| node_projects
node_cli -->|"registers events"| node_events
node_cli -.->|"routes logs"| node_logs
node_cli -->|"registers stern"| node_stern
node_cli -.->|"routes certs"| node_certificates
node_cli -.->|"routes recommendations"| node_recommend
node_cli -->|"registers extraction"| node_machineconfig
node_cli -->|"registers connectivity"| node_network
node_cli -.->|"routes etcd"| node_etcd
node_cli -->|"registers queries"| node_prometheus
node_cli -.->|"routes backends"| node_haproxy
node_cli -.->|"routes diagnostics"| node_ovn
node_cli -.->|"routes lookup"| node_source
node_get -->|"uses handlers"| node_customhandlers
node_get -->|"decodes resources"| node_deserialize
node_get -->|"renders results"| node_tables
node_events -->|"resolves resource kind"| node_get
node_stern -->|"invokes log retrieval"| node_logs
node_engineer -->|"inspects certificates"| node_certificates
node_engineer -.->|"requests recommendations"| node_recommend
node_engineer -.->|"extracts configuration"| node_machineconfig
node_engineer -->|"checks connectivity"| node_network
node_engineer -->|"checks status"| node_etcd
node_engineer -->|"queries alerts"| node_prometheus
node_engineer -->|"lists backends"| node_haproxy

click node_cli "https://github.com/gmeghnag/omc/blob/main/root/root.go"
click node_context "https://github.com/gmeghnag/omc/blob/main/cmd/use/use.go"
click node_get "https://github.com/gmeghnag/omc/blob/main/cmd/get/get.go"
click node_customhandlers "https://github.com/gmeghnag/omc/blob/main/cmd/get/missing-handlers.go"
click node_describe "https://github.com/gmeghnag/omc/blob/main/cmd/describe/describe.go"
click node_projects "https://github.com/gmeghnag/omc/blob/main/cmd/projects.go"
click node_events "https://github.com/gmeghnag/omc/blob/main/cmd/events/events.go"
click node_logs "https://github.com/gmeghnag/omc/blob/main/cmd/logs/logs.go"
click node_stern "https://github.com/gmeghnag/omc/blob/main/cmd/stern/stern.go"
click node_deserialize "https://github.com/gmeghnag/omc/blob/main/pkg/deserializer/deserializer.go"
click node_tables "https://github.com/gmeghnag/omc/blob/main/pkg/tablegenerator/tablegenerator.go"
click node_certificates "https://github.com/gmeghnag/omc/blob/main/cmd/certs/inspect.go"
click node_recommend "https://github.com/gmeghnag/omc/blob/main/cmd/admin/upgrade-recommend.go"
click node_machineconfig "https://github.com/gmeghnag/omc/blob/main/cmd/machineconfig/extract.go"
click node_network "https://github.com/gmeghnag/omc/blob/main/cmd/network/connectivity.go"
click node_etcd "https://github.com/gmeghnag/omc/blob/main/cmd/etcd/etcdctl.go"
click node_prometheus "https://github.com/gmeghnag/omc/blob/main/cmd/prometheus/rule.go"
click node_haproxy "https://github.com/gmeghnag/omc/blob/main/cmd/haproxy/backends.go"
click node_ovn "https://github.com/gmeghnag/omc/blob/main/cmd/ovn/hostnetinfo.go"
click node_source "https://github.com/gmeghnag/omc/blob/main/cmd/get-source/code.go"

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,node_context toneBlue
class node_get,node_customhandlers,node_describe,node_projects,node_events,node_logs,node_stern toneAmber
class node_network,node_etcd,node_prometheus,node_haproxy,node_ovn toneMint
class node_certificates,node_recommend,node_machineconfig,node_source toneRose
class node_deserialize,node_tables,node_engineer toneIndigo
```

## Components

### CLI and Context

- [Command Router](https://github.com/gmeghnag/omc/blob/main/root/root.go): `root/root.go`
- [Must-Gather Selection](https://github.com/gmeghnag/omc/blob/main/cmd/use/use.go): `cmd/use/use.go`

### Resource Queries

- [Resource Retrieval](https://github.com/gmeghnag/omc/blob/main/cmd/get/get.go): `cmd/get/get.go`
- [Resource Handlers](https://github.com/gmeghnag/omc/blob/main/cmd/get/missing-handlers.go): `cmd/get/missing-handlers.go`
- [Resource Description](https://github.com/gmeghnag/omc/blob/main/cmd/describe/describe.go): `cmd/describe/describe.go`
- [Project Listing](https://github.com/gmeghnag/omc/blob/main/cmd/projects.go): `cmd/projects.go`
- [Event Queries](https://github.com/gmeghnag/omc/blob/main/cmd/events/events.go): `cmd/events/events.go`
- [Log Retrieval](https://github.com/gmeghnag/omc/blob/main/cmd/logs/logs.go): `cmd/logs/logs.go`
- [Multi-Pod Logs](https://github.com/gmeghnag/omc/blob/main/cmd/stern/stern.go): `cmd/stern/stern.go`

### Cluster Diagnostics

- [Connectivity Checks](https://github.com/gmeghnag/omc/blob/main/cmd/network/connectivity.go): `cmd/network/connectivity.go`
- [etcd Diagnostics](https://github.com/gmeghnag/omc/blob/main/cmd/etcd/etcdctl.go): `cmd/etcd/etcdctl.go`
- [Prometheus Queries](https://github.com/gmeghnag/omc/blob/main/cmd/prometheus/rule.go): `cmd/prometheus/rule.go`
- [HAProxy Backends](https://github.com/gmeghnag/omc/blob/main/cmd/haproxy/backends.go): `cmd/haproxy/backends.go`
- [OVN Diagnostics](https://github.com/gmeghnag/omc/blob/main/cmd/ovn/hostnetinfo.go): `cmd/ovn/hostnetinfo.go`

### Specialized Analysis

- [Certificate Inspection](https://github.com/gmeghnag/omc/blob/main/cmd/certs/inspect.go): `cmd/certs/inspect.go`
- [Upgrade Recommendations](https://github.com/gmeghnag/omc/blob/main/cmd/admin/upgrade-recommend.go): `cmd/admin/upgrade-recommend.go`
- [MachineConfig Extraction](https://github.com/gmeghnag/omc/blob/main/cmd/machineconfig/extract.go): `cmd/machineconfig/extract.go`
- [Source Lookup](https://github.com/gmeghnag/omc/blob/main/cmd/get-source/code.go): `cmd/get-source/code.go`

### Shared Presentation

- [Data Deserialization](https://github.com/gmeghnag/omc/blob/main/pkg/deserializer/deserializer.go): `pkg/deserializer/deserializer.go`
- [Table Rendering](https://github.com/gmeghnag/omc/blob/main/pkg/tablegenerator/tablegenerator.go): `pkg/tablegenerator/tablegenerator.go`

### Other components

- **Engineer**

## Connections

- Engineer → Command Router: runs commands
- Command Router → Must-Gather Selection: routes selection (evidence: `root/root.go`)
- Engineer → Must-Gather Selection: selects capture
- Must-Gather Selection → Resource Retrieval: then queries
- Command Router → Resource Retrieval: routes get
- Command Router → Resource Description: routes describe
- Command Router → Project Listing: routes projects
- Command Router → Event Queries: registers events (evidence: `root/root.go`)
- Command Router → Log Retrieval: routes logs
- Command Router → Multi-Pod Logs: registers stern (evidence: `root/root.go`)
- Command Router → Certificate Inspection: routes certs
- Command Router → Upgrade Recommendations: routes recommendations
- Command Router → MachineConfig Extraction: registers extraction (evidence: `root/root.go`)
- Command Router → Connectivity Checks: registers connectivity (evidence: `root/root.go`)
- Command Router → etcd Diagnostics: routes etcd
- Command Router → Prometheus Queries: registers queries (evidence: `root/root.go`)
- Command Router → HAProxy Backends: routes backends
- Command Router → OVN Diagnostics: routes diagnostics
- Command Router → Source Lookup: routes lookup
- Resource Retrieval → Resource Handlers: uses handlers (evidence: `cmd/get/get.go`)
- Resource Retrieval → Data Deserialization: decodes resources (evidence: `cmd/get/get.go`)
- Resource Retrieval → Table Rendering: renders results (evidence: `cmd/get/get.go`)
- Event Queries → Resource Retrieval: resolves resource kind (evidence: `cmd/events/events.go`)
- Multi-Pod Logs → Log Retrieval: invokes log retrieval (evidence: `cmd/stern/stern.go`)
- Engineer → Certificate Inspection: inspects certificates
- Engineer → Upgrade Recommendations: requests recommendations
- Engineer → MachineConfig Extraction: extracts configuration
- Engineer → Connectivity Checks: checks connectivity
- Engineer → etcd Diagnostics: checks status
- Engineer → Prometheus Queries: queries alerts
- Engineer → HAProxy Backends: lists backends
