# databus23/helm-diff architecture

> Architecture diagram of the GitHub repository databus23/helm-diff, 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/databus23/helm-diff
- Repository: https://github.com/databus23/helm-diff

## Overview

Helm Diff is a Helm plugin that previews Kubernetes resource changes, primarily by comparing a deployed release with a chart rendered for an upgrade. Its commands also compare release revisions, preview rollbacks, and compare two local charts. The graph follows the command entry points into Helm-backed manifest acquisition, manifest parsing and optional live-object merging, then diff computation and report output. README capabilities are included, but unsampled command implementations are represented only at their supported source paths; their internal wiring is not inferred.

Main entry points: [`diff/diff.go`](https://github.com/databus23/helm-diff/blob/master/diff/diff.go) (Diff engine), [`cmd/root.go`](https://github.com/databus23/helm-diff/blob/master/cmd/root.go) (CLI root), [`cmd/upgrade.go`](https://github.com/databus23/helm-diff/blob/master/cmd/upgrade.go) (Upgrade preview), [`cmd/helm.go`](https://github.com/databus23/helm-diff/blob/master/cmd/helm.go) (Helm bridge)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_commands["Plugin commands"]
  node_root["CLI root<br/>[root.go]"]
  node_upgrade["Upgrade preview<br/>[upgrade.go]"]
  node_revision["Revision diff<br/>[revision.go]"]
  node_rollback["Rollback preview<br/>[rollback.go]"]
  node_local["Local chart diff<br/>[local.go]"]
end

subgraph group_acquisition["Manifest acquisition"]
  node_helmbridge["Helm bridge<br/>[helm.go]"]
  node_manifestparse["Manifest parsing<br/>[parse.go]"]
  node_manifestmerge["Live merge<br/>[generate.go]"]
end

subgraph group_comparison["Diff and reports"]
  node_diffengine["Diff engine<br/>[diff.go]"]
  node_structured["Structured changes<br/>[structured.go]"]
  node_report["Report output<br/>[report.go]"]
  node_difftool["External diff tool<br/>[difftool.go]"]
end

node_user(("Helm user"))
node_helm{{"Helm CLI"}}
node_kubernetes{{"Kubernetes API"}}

node_user -->|"invokes"| node_root
node_root -->|"dispatches"| node_upgrade
node_root -->|"dispatches"| node_revision
node_root -->|"dispatches"| node_rollback
node_root -->|"dispatches"| node_local
node_upgrade -->|"fetches and renders"| node_helmbridge
node_revision -->|"fetches revisions"| node_helmbridge
node_rollback -->|"fetches releases"| node_helmbridge
node_helmbridge -->|"runs commands"| node_helm
node_helmbridge -->|"parses manifests"| node_manifestparse
node_local -->|"renders charts"| node_helm
node_local -->|"parses manifests"| node_manifestparse
node_upgrade -->|"merges live state"| node_manifestmerge
node_manifestmerge -->|"reads and patches"| node_kubernetes
node_upgrade -->|"checks cluster access"| node_kubernetes
node_upgrade -->|"compares manifests"| node_diffengine
node_revision -->|"compares revisions"| node_diffengine
node_rollback -->|"compares releases"| node_diffengine
node_local -->|"compares manifests"| node_diffengine
node_diffengine -->|"builds field changes"| node_structured
node_diffengine -->|"creates report"| node_report
node_report -.->|"uses configured tool"| node_difftool

click node_root "https://github.com/databus23/helm-diff/blob/master/cmd/root.go"
click node_upgrade "https://github.com/databus23/helm-diff/blob/master/cmd/upgrade.go"
click node_revision "https://github.com/databus23/helm-diff/blob/master/cmd/revision.go"
click node_rollback "https://github.com/databus23/helm-diff/blob/master/cmd/rollback.go"
click node_local "https://github.com/databus23/helm-diff/blob/master/cmd/local.go"
click node_helmbridge "https://github.com/databus23/helm-diff/blob/master/cmd/helm.go"
click node_manifestparse "https://github.com/databus23/helm-diff/blob/master/manifest/parse.go"
click node_manifestmerge "https://github.com/databus23/helm-diff/blob/master/manifest/generate.go"
click node_diffengine "https://github.com/databus23/helm-diff/blob/master/diff/diff.go"
click node_structured "https://github.com/databus23/helm-diff/blob/master/diff/structured.go"
click node_report "https://github.com/databus23/helm-diff/blob/master/diff/report.go"
click node_difftool "https://github.com/databus23/helm-diff/blob/master/diff/difftool.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_root,node_upgrade,node_revision,node_rollback,node_local,node_user toneBlue
class node_helmbridge,node_manifestparse,node_manifestmerge toneAmber
class node_diffengine,node_structured,node_report,node_difftool,node_kubernetes toneMint
class node_helm toneIndigo
```

## Components

### Plugin commands

- [CLI root](https://github.com/databus23/helm-diff/blob/master/cmd/root.go): `cmd/root.go`
- [Upgrade preview](https://github.com/databus23/helm-diff/blob/master/cmd/upgrade.go): `cmd/upgrade.go`
- [Revision diff](https://github.com/databus23/helm-diff/blob/master/cmd/revision.go): `cmd/revision.go`
- [Rollback preview](https://github.com/databus23/helm-diff/blob/master/cmd/rollback.go): `cmd/rollback.go`
- [Local chart diff](https://github.com/databus23/helm-diff/blob/master/cmd/local.go): `cmd/local.go`

### Manifest acquisition

- [Helm bridge](https://github.com/databus23/helm-diff/blob/master/cmd/helm.go): `cmd/helm.go`
- [Manifest parsing](https://github.com/databus23/helm-diff/blob/master/manifest/parse.go): `manifest/parse.go`
- [Live merge](https://github.com/databus23/helm-diff/blob/master/manifest/generate.go): `manifest/generate.go`

### Diff and reports

- [Diff engine](https://github.com/databus23/helm-diff/blob/master/diff/diff.go): `diff/diff.go`
- [Structured changes](https://github.com/databus23/helm-diff/blob/master/diff/structured.go): `diff/structured.go`
- [Report output](https://github.com/databus23/helm-diff/blob/master/diff/report.go): `diff/report.go`
- [External diff tool](https://github.com/databus23/helm-diff/blob/master/diff/difftool.go): `diff/difftool.go`

### Other components

- **Helm user**
- **Helm CLI**
- **Kubernetes API**

## Connections

- Helm user → CLI root: invokes
- CLI root → Upgrade preview: dispatches
- CLI root → Revision diff: dispatches
- CLI root → Rollback preview: dispatches
- CLI root → Local chart diff: dispatches
- Upgrade preview → Helm bridge: fetches and renders
- Revision diff → Helm bridge: fetches revisions
- Rollback preview → Helm bridge: fetches releases
- Helm bridge → Helm CLI: runs commands
- Helm bridge → Manifest parsing: parses manifests
- Local chart diff → Helm CLI: renders charts
- Local chart diff → Manifest parsing: parses manifests
- Upgrade preview → Live merge: merges live state
- Live merge → Kubernetes API: reads and patches
- Upgrade preview → Kubernetes API: checks cluster access
- Upgrade preview → Diff engine: compares manifests
- Revision diff → Diff engine: compares revisions
- Rollback preview → Diff engine: compares releases
- Local chart diff → Diff engine: compares manifests
- Diff engine → Structured changes: builds field changes
- Diff engine → Report output: creates report
- Report output → External diff tool: uses configured tool
