# badtuxx/girus-cli architecture

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

- Interactive diagram: https://gitdiagram.com/badtuxx/girus-cli
- Repository: https://github.com/badtuxx/girus-cli

## Overview

GIRUS is a local CLI for creating and managing isolated interactive learning labs on Kubernetes. The main workflow provisions the GIRUS cluster, installs lab templates or repository labs, and lets the user inspect and manage the running environment. Repository management, multilingual manifests, and CLI updates are additional capabilities. The backend and frontend are described in the README but their implementation is not present in this repository; links to them reflect documented or excerpted CLI interactions.

Main entry points: [`cmd/root.go`](https://github.com/badtuxx/girus-cli/blob/main/cmd/root.go) (Command router), [`cmd/create.go`](https://github.com/badtuxx/girus-cli/blob/main/cmd/create.go) (Create cluster), [`cmd/lab.go`](https://github.com/badtuxx/girus-cli/blob/main/cmd/lab.go) (Lab commands), [`internal/repo/repo.go`](https://github.com/badtuxx/girus-cli/blob/main/internal/repo/repo.go) (Repository manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI entry"]
  node_main["Program entry<br/>[main.go]"]
  node_commands["Command router<br/>[root.go]"]
end

subgraph group_lifecycle["Cluster lifecycle"]
  node_create["Create cluster<br/>[create.go]"]
  node_delete["Delete cluster<br/>[delete.go]"]
  node_start["Start services<br/>[start.go]"]
  node_stop["Stop services<br/>[stop.go]"]
  node_status["Cluster status<br/>[status.go]"]
  node_update["CLI update<br/>[update.go]"]
end

subgraph group_labs["Labs and repositories"]
  node_labcommands["Lab commands<br/>[lab.go]"]
  node_labcreate["Lab creation<br/>[create.go]"]
  node_labruntime["Lab manager<br/>[lab.go]"]
  node_repository["Repository manager<br/>[repo.go]"]
  node_repoindex["Repository index<br/>[index.go]"]
  node_repolabs["Repository lab access<br/>[lab.go]"]
  node_manifests["Lab manifests"]
  node_templates["Manifest selector<br/>[templates.go]"]
end

subgraph group_runtime["Kubernetes operations"]
  node_k8sclient["Kubernetes client<br/>[k8s.go]"]
  node_cluster[("Kind / Kubernetes")]
  node_backend["GIRUS backend"]
  node_frontend["GIRUS frontend"]
end

subgraph group_support["Configuration"]
  node_common["Language and config<br/>[config.go]"]
  node_helpers["Progress helpers<br/>[helpers.go]"]
  node_remote["Release service"]
end

node_user(("CLI user"))

node_user -->|"runs CLI"| node_main
node_main -->|"loads language"| node_common
node_main -->|"executes"| node_commands
node_commands -.->|"routes command"| node_create
node_commands -.->|"routes command"| node_delete
node_commands -.->|"routes command"| node_start
node_commands -.->|"routes command"| node_stop
node_commands -.->|"routes command"| node_status
node_commands -.->|"routes command"| node_update
node_commands -.->|"routes command"| node_labcommands
node_create -->|"provisions cluster"| node_cluster
node_create -->|"reads manifests"| node_templates
node_templates -->|"selects language"| node_manifests
node_create -->|"shows progress"| node_helpers
node_create -->|"creates lab"| node_labruntime
node_create -->|"loads repo lab"| node_repository
node_create -->|"uses Kubernetes"| node_k8sclient
node_delete -->|"deletes cluster"| node_cluster
node_delete -->|"shows progress"| node_helpers
node_start -->|"starts services"| node_k8sclient
node_stop -->|"stops deployments"| node_k8sclient
node_k8sclient -.->|"manages resources"| node_cluster
node_status -->|"queries status"| node_cluster
node_status -->|"checks component"| node_backend
node_status -->|"checks component"| node_frontend
node_update -->|"checks release"| node_remote
node_update -->|"may recreate cluster"| node_delete
node_update -->|"may recreate cluster"| node_create
node_labcommands -->|"lists and installs"| node_repository
node_labcommands -.->|"downloads lab"| node_repolabs
node_repository -.->|"reads index"| node_repoindex
node_repository -.->|"retrieves lab"| node_repolabs
node_repository -->|"fetches repository"| node_remote
node_labcreate -->|"delegates file lab"| node_labruntime
node_labruntime -->|"applies lab"| node_cluster
node_labruntime -->|"restarts backend"| node_backend
node_labcommands -->|"restarts backend"| node_backend
node_labcommands -->|"queries lab API"| node_cluster

click node_main "https://github.com/badtuxx/girus-cli/blob/main/main.go"
click node_commands "https://github.com/badtuxx/girus-cli/blob/main/cmd/root.go"
click node_create "https://github.com/badtuxx/girus-cli/blob/main/cmd/create.go"
click node_delete "https://github.com/badtuxx/girus-cli/blob/main/cmd/delete.go"
click node_start "https://github.com/badtuxx/girus-cli/blob/main/cmd/start.go"
click node_stop "https://github.com/badtuxx/girus-cli/blob/main/cmd/stop.go"
click node_status "https://github.com/badtuxx/girus-cli/blob/main/cmd/status.go"
click node_update "https://github.com/badtuxx/girus-cli/blob/main/cmd/update.go"
click node_labcommands "https://github.com/badtuxx/girus-cli/blob/main/cmd/lab.go"
click node_labcreate "https://github.com/badtuxx/girus-cli/blob/main/cmd/create.go"
click node_labruntime "https://github.com/badtuxx/girus-cli/blob/main/internal/lab/lab.go"
click node_repository "https://github.com/badtuxx/girus-cli/blob/main/internal/repo/repo.go"
click node_repoindex "https://github.com/badtuxx/girus-cli/blob/main/internal/repo/index.go"
click node_repolabs "https://github.com/badtuxx/girus-cli/blob/main/internal/repo/lab.go"
click node_manifests "https://github.com/badtuxx/girus-cli/tree/main/internal/templates/manifests"
click node_templates "https://github.com/badtuxx/girus-cli/blob/main/internal/templates/templates.go"
click node_k8sclient "https://github.com/badtuxx/girus-cli/blob/main/internal/k8s/k8s.go"
click node_common "https://github.com/badtuxx/girus-cli/blob/main/internal/common/config.go"
click node_helpers "https://github.com/badtuxx/girus-cli/blob/main/internal/helpers/helpers.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_main,node_commands,node_user toneBlue
class node_create,node_delete,node_start,node_stop,node_status,node_update toneAmber
class node_labcommands,node_labcreate,node_labruntime,node_repository,node_repoindex,node_repolabs,node_manifests,node_templates toneMint
class node_k8sclient,node_cluster,node_backend,node_frontend toneRose
class node_common,node_helpers,node_remote toneIndigo
```

## Components

### CLI entry

- [Program entry](https://github.com/badtuxx/girus-cli/blob/main/main.go): `main.go`
- [Command router](https://github.com/badtuxx/girus-cli/blob/main/cmd/root.go): `cmd/root.go`

### Cluster lifecycle

- [Create cluster](https://github.com/badtuxx/girus-cli/blob/main/cmd/create.go): `cmd/create.go`
- [Delete cluster](https://github.com/badtuxx/girus-cli/blob/main/cmd/delete.go): `cmd/delete.go`
- [Start services](https://github.com/badtuxx/girus-cli/blob/main/cmd/start.go): `cmd/start.go`
- [Stop services](https://github.com/badtuxx/girus-cli/blob/main/cmd/stop.go): `cmd/stop.go`
- [Cluster status](https://github.com/badtuxx/girus-cli/blob/main/cmd/status.go): `cmd/status.go`
- [CLI update](https://github.com/badtuxx/girus-cli/blob/main/cmd/update.go): `cmd/update.go`

### Labs and repositories

- [Lab commands](https://github.com/badtuxx/girus-cli/blob/main/cmd/lab.go): `cmd/lab.go`
- [Lab creation](https://github.com/badtuxx/girus-cli/blob/main/cmd/create.go): `cmd/create.go`
- [Lab manager](https://github.com/badtuxx/girus-cli/blob/main/internal/lab/lab.go): `internal/lab/lab.go`
- [Repository manager](https://github.com/badtuxx/girus-cli/blob/main/internal/repo/repo.go): `internal/repo/repo.go`
- [Repository index](https://github.com/badtuxx/girus-cli/blob/main/internal/repo/index.go): `internal/repo/index.go`
- [Repository lab access](https://github.com/badtuxx/girus-cli/blob/main/internal/repo/lab.go): `internal/repo/lab.go`
- [Lab manifests](https://github.com/badtuxx/girus-cli/tree/main/internal/templates/manifests): `internal/templates/manifests`
- [Manifest selector](https://github.com/badtuxx/girus-cli/blob/main/internal/templates/templates.go): `internal/templates/templates.go`

### Kubernetes operations

- [Kubernetes client](https://github.com/badtuxx/girus-cli/blob/main/internal/k8s/k8s.go): `internal/k8s/k8s.go`
- **Kind / Kubernetes**
- **GIRUS backend**
- **GIRUS frontend**

### Configuration

- [Language and config](https://github.com/badtuxx/girus-cli/blob/main/internal/common/config.go): `internal/common/config.go`
- [Progress helpers](https://github.com/badtuxx/girus-cli/blob/main/internal/helpers/helpers.go): `internal/helpers/helpers.go`
- **Release service**

### Other components

- **CLI user**

## Connections

- CLI user → Program entry: runs CLI (evidence: `README.md`)
- Program entry → Language and config: loads language (evidence: `main.go`)
- Program entry → Command router: executes (evidence: `main.go`)
- Command router → Create cluster: routes command
- Command router → Delete cluster: routes command
- Command router → Start services: routes command
- Command router → Stop services: routes command
- Command router → Cluster status: routes command
- Command router → CLI update: routes command
- Command router → Lab commands: routes command
- Create cluster → Kind / Kubernetes: provisions cluster (evidence: `README.md`)
- Create cluster → Manifest selector: reads manifests (evidence: `cmd/create.go`)
- Manifest selector → Lab manifests: selects language (evidence: `internal/templates/templates.go`)
- Create cluster → Progress helpers: shows progress (evidence: `cmd/create.go`)
- Create cluster → Lab manager: creates lab (evidence: `cmd/create.go`)
- Create cluster → Repository manager: loads repo lab (evidence: `cmd/create.go`)
- Create cluster → Kubernetes client: uses Kubernetes (evidence: `cmd/create.go`)
- Delete cluster → Kind / Kubernetes: deletes cluster (evidence: `cmd/delete.go`)
- Delete cluster → Progress helpers: shows progress (evidence: `cmd/delete.go`)
- Start services → Kubernetes client: starts services (evidence: `cmd/start.go`)
- Stop services → Kubernetes client: stops deployments (evidence: `cmd/stop.go`)
- Kubernetes client → Kind / Kubernetes: manages resources
- Cluster status → Kind / Kubernetes: queries status (evidence: `cmd/status.go`)
- Cluster status → GIRUS backend: checks component (evidence: `cmd/status.go`)
- Cluster status → GIRUS frontend: checks component (evidence: `cmd/status.go`)
- CLI update → Release service: checks release (evidence: `cmd/update.go`)
- CLI update → Delete cluster: may recreate cluster (evidence: `cmd/update.go`)
- CLI update → Create cluster: may recreate cluster (evidence: `cmd/update.go`)
- Lab commands → Repository manager: lists and installs (evidence: `cmd/lab.go`)
- Lab commands → Repository lab access: downloads lab
- Repository manager → Repository index: reads index
- Repository manager → Repository lab access: retrieves lab
- Repository manager → Release service: fetches repository (evidence: `internal/repo/repo.go`)
- Lab creation → Lab manager: delegates file lab (evidence: `cmd/create.go`)
- Lab manager → Kind / Kubernetes: applies lab (evidence: `internal/lab/lab.go`)
- Lab manager → GIRUS backend: restarts backend (evidence: `internal/lab/lab.go`)
- Lab commands → GIRUS backend: restarts backend (evidence: `cmd/lab.go`)
- Lab commands → Kind / Kubernetes: queries lab API (evidence: `cmd/lab.go`)
