# kute-dev/kute architecture

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

- Interactive diagram: https://gitdiagram.com/kute-dev/kute
- Repository: https://github.com/kute-dev/kute

## Overview

kute is a keyboard-driven Kubernetes incident console. An operator launches the terminal app against a selected cluster and namespace, triages unhealthy workloads, follows logs, events, and rollout history to diagnose changes, then inspects details or performs guarded actions. The main runtime is composed in app, presented through the TUI, and backed by Kubernetes access and resource projections. Dedicated screens cover routing, batch-workload history, certificates, GitOps, Helm, and cluster access. README documents these capabilities; where implementation was not sampled, links are limited to supported entry points and paths.

Main entry points: [`internal/kube/cluster.go`](https://github.com/kute-dev/kute/blob/main/internal/kube/cluster.go) (Cluster client), [`internal/tui/tasks/browse/model.go`](https://github.com/kute-dev/kute/blob/main/internal/tui/tasks/browse/model.go) (Resource browser), [`internal/app/app.go`](https://github.com/kute-dev/kute/blob/main/internal/app/app.go) (Session composition), [`internal/tui/model.go`](https://github.com/kute-dev/kute/blob/main/internal/tui/model.go) (Terminal console)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Application runtime"]
  node_cli["CLI entry<br/>[main.go]"]
  node_app["Session composition<br/>[app.go]"]
  node_tui["Terminal console<br/>[model.go]"]
  node_state["Session state<br/>[state.go]"]
end

subgraph group_triage["Incident triage"]
  node_browse["Resource browser<br/>[model.go]"]
  node_overview["Cluster overview<br/>[model.go]"]
  node_podlogs["Restart-aware logs<br/>[model.go]"]
  node_events["Cluster events<br/>[model.go]"]
  node_timeline["Incident timeline<br/>[model.go]"]
  node_poddetail["Pod diagnosis<br/>[model.go]"]
  node_routetable["Route resolution<br/>[model.go]"]
end

subgraph group_workloads["Workload operations"]
  node_jobattempts["Job attempts<br/>[model.go]"]
  node_cronjobdetail["CronJob detail<br/>[model.go]"]
  node_certchain["Certificate chain<br/>[model.go]"]
  node_actions["Action confirmation<br/>[controller.go]"]
end

subgraph group_integrations["Cluster integrations"]
  node_resources["Resource projections<br/>[resources.go]"]
  node_helm["Helm screens<br/>[model.go]"]
  node_gitops["GitOps screens<br/>[model.go]"]
end

subgraph group_access["Kubernetes access"]
  node_kube["Cluster client<br/>[cluster.go]"]
  node_client["Kubernetes client<br/>[client.go]"]
  node_helmcache["Chart cache<br/>[cache.go]"]
end

node_operator(("Operator"))
node_api{{"Kubernetes API"}}

node_operator -->|"launches"| node_cli
node_cli -->|"starts"| node_app
node_app -->|"composes"| node_tui
node_app -->|"builds session"| node_kube
node_app -->|"loads and saves"| node_state
node_tui -->|"opens browser"| node_browse
node_tui -->|"opens overview"| node_overview
node_browse -->|"opens logs"| node_podlogs
node_browse -->|"opens details"| node_poddetail
node_browse -->|"opens routes"| node_routetable
node_browse -->|"opens attempts"| node_jobattempts
node_browse -->|"opens CronJob"| node_cronjobdetail
node_browse -->|"opens chain"| node_certchain
node_browse -->|"opens Helm"| node_helm
node_browse -->|"opens GitOps"| node_gitops
node_browse -->|"projects rows"| node_resources
node_podlogs -->|"reads logs"| node_kube
node_events -->|"reads events"| node_kube
node_timeline -->|"reads history"| node_kube
node_poddetail -->|"reads and diagnoses"| node_kube
node_routetable -->|"resolves backends"| node_kube
node_jobattempts -->|"reads attempts"| node_kube
node_cronjobdetail -->|"reads and edits"| node_kube
node_certchain -->|"reads and renews"| node_kube
node_helm -->|"reads releases"| node_kube
node_gitops -->|"reads resources"| node_kube
node_browse -->|"requests mutations"| node_actions
node_actions -->|"executes guarded action"| node_kube
node_kube -->|"creates client"| node_client
node_client -->|"sends requests"| node_api
node_kube -->|"watches cluster"| node_api
node_helm -->|"uses chart cache"| node_helmcache

click node_cli "https://github.com/kute-dev/kute/blob/main/cmd/kute/main.go"
click node_app "https://github.com/kute-dev/kute/blob/main/internal/app/app.go"
click node_tui "https://github.com/kute-dev/kute/blob/main/internal/tui/model.go"
click node_state "https://github.com/kute-dev/kute/blob/main/internal/state/state.go"
click node_browse "https://github.com/kute-dev/kute/blob/main/internal/tui/tasks/browse/model.go"
click node_overview "https://github.com/kute-dev/kute/blob/main/internal/tui/tasks/overview/model.go"
click node_podlogs "https://github.com/kute-dev/kute/blob/main/internal/tui/tasks/podlogs/model.go"
click node_events "https://github.com/kute-dev/kute/blob/main/internal/tui/tasks/events/model.go"
click node_timeline "https://github.com/kute-dev/kute/blob/main/internal/tui/tasks/timeline/model.go"
click node_poddetail "https://github.com/kute-dev/kute/blob/main/internal/tui/tasks/poddetail/model.go"
click node_routetable "https://github.com/kute-dev/kute/blob/main/internal/tui/tasks/routetable/model.go"
click node_jobattempts "https://github.com/kute-dev/kute/blob/main/internal/tui/tasks/jobattempts/model.go"
click node_cronjobdetail "https://github.com/kute-dev/kute/blob/main/internal/tui/tasks/cronjobdetail/model.go"
click node_certchain "https://github.com/kute-dev/kute/blob/main/internal/tui/tasks/certchain/model.go"
click node_actions "https://github.com/kute-dev/kute/blob/main/internal/tui/actions/controller.go"
click node_resources "https://github.com/kute-dev/kute/blob/main/internal/resources/resources.go"
click node_helm "https://github.com/kute-dev/kute/blob/main/internal/tui/tasks/helmdetail/model.go"
click node_gitops "https://github.com/kute-dev/kute/blob/main/internal/tui/tasks/fluxdetail/model.go"
click node_kube "https://github.com/kute-dev/kute/blob/main/internal/kube/cluster.go"
click node_client "https://github.com/kute-dev/kute/blob/main/internal/kube/client.go"
click node_helmcache "https://github.com/kute-dev/kute/blob/main/internal/helmrepo/cache.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_app,node_tui,node_state toneBlue
class node_browse,node_overview,node_podlogs,node_events,node_timeline,node_poddetail,node_routetable toneAmber
class node_jobattempts,node_cronjobdetail,node_certchain,node_actions,node_api toneMint
class node_resources,node_helm,node_gitops toneRose
class node_kube,node_client,node_helmcache,node_operator toneIndigo
```

## Components

### Application runtime

- [CLI entry](https://github.com/kute-dev/kute/blob/main/cmd/kute/main.go): `cmd/kute/main.go`
- [Session composition](https://github.com/kute-dev/kute/blob/main/internal/app/app.go): `internal/app/app.go`
- [Terminal console](https://github.com/kute-dev/kute/blob/main/internal/tui/model.go): `internal/tui/model.go`
- [Session state](https://github.com/kute-dev/kute/blob/main/internal/state/state.go): `internal/state/state.go`

### Incident triage

- [Resource browser](https://github.com/kute-dev/kute/blob/main/internal/tui/tasks/browse/model.go): `internal/tui/tasks/browse/model.go`
- [Cluster overview](https://github.com/kute-dev/kute/blob/main/internal/tui/tasks/overview/model.go): `internal/tui/tasks/overview/model.go`
- [Restart-aware logs](https://github.com/kute-dev/kute/blob/main/internal/tui/tasks/podlogs/model.go): `internal/tui/tasks/podlogs/model.go`
- [Cluster events](https://github.com/kute-dev/kute/blob/main/internal/tui/tasks/events/model.go): `internal/tui/tasks/events/model.go`
- [Incident timeline](https://github.com/kute-dev/kute/blob/main/internal/tui/tasks/timeline/model.go): `internal/tui/tasks/timeline/model.go`
- [Pod diagnosis](https://github.com/kute-dev/kute/blob/main/internal/tui/tasks/poddetail/model.go): `internal/tui/tasks/poddetail/model.go`
- [Route resolution](https://github.com/kute-dev/kute/blob/main/internal/tui/tasks/routetable/model.go): `internal/tui/tasks/routetable/model.go`

### Workload operations

- [Job attempts](https://github.com/kute-dev/kute/blob/main/internal/tui/tasks/jobattempts/model.go): `internal/tui/tasks/jobattempts/model.go`
- [CronJob detail](https://github.com/kute-dev/kute/blob/main/internal/tui/tasks/cronjobdetail/model.go): `internal/tui/tasks/cronjobdetail/model.go`
- [Certificate chain](https://github.com/kute-dev/kute/blob/main/internal/tui/tasks/certchain/model.go): `internal/tui/tasks/certchain/model.go`
- [Action confirmation](https://github.com/kute-dev/kute/blob/main/internal/tui/actions/controller.go): `internal/tui/actions/controller.go`

### Cluster integrations

- [Resource projections](https://github.com/kute-dev/kute/blob/main/internal/resources/resources.go): `internal/resources/resources.go`
- [Helm screens](https://github.com/kute-dev/kute/blob/main/internal/tui/tasks/helmdetail/model.go): `internal/tui/tasks/helmdetail/model.go`
- [GitOps screens](https://github.com/kute-dev/kute/blob/main/internal/tui/tasks/fluxdetail/model.go): `internal/tui/tasks/fluxdetail/model.go`

### Kubernetes access

- [Cluster client](https://github.com/kute-dev/kute/blob/main/internal/kube/cluster.go): `internal/kube/cluster.go`
- [Kubernetes client](https://github.com/kute-dev/kute/blob/main/internal/kube/client.go): `internal/kube/client.go`
- [Chart cache](https://github.com/kute-dev/kute/blob/main/internal/helmrepo/cache.go): `internal/helmrepo/cache.go`

### Other components

- **Operator**
- **Kubernetes API**

## Connections

- Operator → CLI entry: launches
- CLI entry → Session composition: starts
- Session composition → Terminal console: composes
- Session composition → Cluster client: builds session
- Session composition → Session state: loads and saves
- Terminal console → Resource browser: opens browser
- Terminal console → Cluster overview: opens overview
- Resource browser → Restart-aware logs: opens logs
- Resource browser → Pod diagnosis: opens details
- Resource browser → Route resolution: opens routes
- Resource browser → Job attempts: opens attempts
- Resource browser → CronJob detail: opens CronJob
- Resource browser → Certificate chain: opens chain
- Resource browser → Helm screens: opens Helm
- Resource browser → GitOps screens: opens GitOps
- Resource browser → Resource projections: projects rows
- Restart-aware logs → Cluster client: reads logs
- Cluster events → Cluster client: reads events
- Incident timeline → Cluster client: reads history
- Pod diagnosis → Cluster client: reads and diagnoses
- Route resolution → Cluster client: resolves backends
- Job attempts → Cluster client: reads attempts
- CronJob detail → Cluster client: reads and edits
- Certificate chain → Cluster client: reads and renews
- Helm screens → Cluster client: reads releases
- GitOps screens → Cluster client: reads resources
- Resource browser → Action confirmation: requests mutations
- Action confirmation → Cluster client: executes guarded action
- Cluster client → Kubernetes client: creates client
- Kubernetes client → Kubernetes API: sends requests
- Cluster client → Kubernetes API: watches cluster
- Helm screens → Chart cache: uses chart cache
