# yuk7/wsldl architecture

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

- Interactive diagram: https://gitdiagram.com/yuk7/wsldl
- Repository: https://github.com/yuk7/wsldl

## Overview

wsldl is a Windows launcher and installer for WSL distributions. Users invoke a renamed executable; the entry point selects install for an unregistered distribution or launch for a registered one, and dispatches explicit commands for configuration, querying, backup, cleanup, and help. Install supports rootfs archives and ext4 VHDX images; launch supports interactive shells, commands, and Windows-path translation. The graph includes the WSL and registry adapter as an internal boundary. Some subsystems are documented in the README but their full implementations were not sampled, so only evidenced links are drawn.

Main entry points: [`src/main.go`](https://github.com/yuk7/wsldl/blob/main/src/main.go) (Command dispatcher), [`src/lib/wsllib/impl.go`](https://github.com/yuk7/wsldl/blob/main/src/lib/wsllib/impl.go) (WSL adapter), [`src/config/command.go`](https://github.com/yuk7/wsldl/blob/main/src/config/command.go) (Set configuration), [`src/get/command.go`](https://github.com/yuk7/wsldl/blob/main/src/get/command.go) (Read settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI entry"]
  node_cli["Command dispatcher<br/>[main.go]"]
  node_help["Help output<br/>[command.go]"]
end

subgraph group_lifecycle["Distribution lifecycle"]
  node_install["Install distribution<br/>[install.go]"]
  node_download["Download files<br/>[download.go]"]
  node_launcher["Launch distro<br/>[command.go]"]
  node_backup["Export backup<br/>[backup.go]"]
  node_clean["Remove distro<br/>[clean.go]"]
end

subgraph group_operations["Instance operations"]
  node_config["Set configuration<br/>[command.go]"]
  node_get["Read settings<br/>[command.go]"]
  node_wtconfig["Terminal profile lookup<br/>[wtutils.go]"]
end

subgraph group_platform["WSL integration"]
  node_wsladapter["WSL adapter<br/>[impl.go]"]
  node_wslconfig["WSL config helpers<br/>[config.go]"]
end

node_user(("Executable user"))
node_wsl{{"Windows WSL services"}}
node_registry[("WSL registry")]

node_user -->|"invokes"| node_cli
node_cli -->|"dispatches"| node_install
node_cli -->|"dispatches"| node_launcher
node_cli -->|"dispatches"| node_config
node_cli -->|"dispatches"| node_get
node_cli -->|"dispatches"| node_backup
node_cli -->|"dispatches"| node_clean
node_cli -->|"dispatches"| node_help
node_cli -->|"creates dependencies"| node_wsladapter
node_install -->|"downloads"| node_download
node_install -->|"registers distro"| node_wsladapter
node_launcher -->|"launches distro"| node_wsladapter
node_config -->|"reads config"| node_wslconfig
node_config -->|"updates config"| node_wsladapter
node_config -->|"updates profile"| node_registry
node_get -->|"reads config"| node_wslconfig
node_get -->|"reads profile"| node_registry
node_get -->|"reads terminal profile"| node_wtconfig
node_backup -->|"exports distro"| node_wsladapter
node_backup -->|"exports registry"| node_registry
node_clean -.->|"unregisters distro"| node_wsladapter
node_wsladapter -->|"calls WSL API"| node_wsl
node_wsladapter -->|"calls registry API"| node_registry

click node_cli "https://github.com/yuk7/wsldl/blob/main/src/main.go"
click node_help "https://github.com/yuk7/wsldl/blob/main/src/help/command.go"
click node_install "https://github.com/yuk7/wsldl/blob/main/src/install/install.go"
click node_download "https://github.com/yuk7/wsldl/blob/main/src/lib/download/download.go"
click node_launcher "https://github.com/yuk7/wsldl/blob/main/src/run/command.go"
click node_backup "https://github.com/yuk7/wsldl/blob/main/src/backup/backup.go"
click node_clean "https://github.com/yuk7/wsldl/blob/main/src/clean/clean.go"
click node_config "https://github.com/yuk7/wsldl/blob/main/src/config/command.go"
click node_get "https://github.com/yuk7/wsldl/blob/main/src/get/command.go"
click node_wtconfig "https://github.com/yuk7/wsldl/blob/main/src/lib/wtutils/wtutils.go"
click node_wsladapter "https://github.com/yuk7/wsldl/blob/main/src/lib/wsllib/impl.go"
click node_wslconfig "https://github.com/yuk7/wsldl/blob/main/src/lib/wslapi/config.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_help,node_user toneBlue
class node_install,node_download,node_launcher,node_backup,node_clean,node_registry toneAmber
class node_config,node_get,node_wtconfig toneMint
class node_wsladapter,node_wslconfig toneRose
class node_wsl toneIndigo
```

## Components

### CLI entry

- [Command dispatcher](https://github.com/yuk7/wsldl/blob/main/src/main.go): `src/main.go`
- [Help output](https://github.com/yuk7/wsldl/blob/main/src/help/command.go): `src/help/command.go`

### Distribution lifecycle

- [Install distribution](https://github.com/yuk7/wsldl/blob/main/src/install/install.go): `src/install/install.go`
- [Download files](https://github.com/yuk7/wsldl/blob/main/src/lib/download/download.go): `src/lib/download/download.go`
- [Launch distro](https://github.com/yuk7/wsldl/blob/main/src/run/command.go): `src/run/command.go`
- [Export backup](https://github.com/yuk7/wsldl/blob/main/src/backup/backup.go): `src/backup/backup.go`
- [Remove distro](https://github.com/yuk7/wsldl/blob/main/src/clean/clean.go): `src/clean/clean.go`

### Instance operations

- [Set configuration](https://github.com/yuk7/wsldl/blob/main/src/config/command.go): `src/config/command.go`
- [Read settings](https://github.com/yuk7/wsldl/blob/main/src/get/command.go): `src/get/command.go`
- [Terminal profile lookup](https://github.com/yuk7/wsldl/blob/main/src/lib/wtutils/wtutils.go): `src/lib/wtutils/wtutils.go`

### WSL integration

- [WSL adapter](https://github.com/yuk7/wsldl/blob/main/src/lib/wsllib/impl.go): `src/lib/wsllib/impl.go`
- [WSL config helpers](https://github.com/yuk7/wsldl/blob/main/src/lib/wslapi/config.go): `src/lib/wslapi/config.go`

### Other components

- **Executable user**
- **Windows WSL services**
- **WSL registry**

## Connections

- Executable user → Command dispatcher: invokes
- Command dispatcher → Install distribution: dispatches (evidence: `src/main.go`)
- Command dispatcher → Launch distro: dispatches (evidence: `src/main.go`)
- Command dispatcher → Set configuration: dispatches (evidence: `src/main.go`)
- Command dispatcher → Read settings: dispatches (evidence: `src/main.go`)
- Command dispatcher → Export backup: dispatches (evidence: `src/main.go`)
- Command dispatcher → Remove distro: dispatches (evidence: `src/main.go`)
- Command dispatcher → Help output: dispatches (evidence: `src/main.go`)
- Command dispatcher → WSL adapter: creates dependencies (evidence: `src/main.go`)
- Install distribution → Download files: downloads (evidence: `src/install/install.go`)
- Install distribution → WSL adapter: registers distro (evidence: `src/install/install.go`)
- Launch distro → WSL adapter: launches distro (evidence: `src/run/command.go`)
- Set configuration → WSL config helpers: reads config (evidence: `src/config/command.go`)
- Set configuration → WSL adapter: updates config (evidence: `src/config/command.go`)
- Set configuration → WSL registry: updates profile (evidence: `src/config/command.go`)
- Read settings → WSL config helpers: reads config (evidence: `src/get/command.go`)
- Read settings → WSL registry: reads profile (evidence: `src/get/command.go`)
- Read settings → Terminal profile lookup: reads terminal profile (evidence: `src/get/command.go`)
- Export backup → WSL adapter: exports distro
- Export backup → WSL registry: exports registry
- Remove distro → WSL adapter: unregisters distro
- WSL adapter → Windows WSL services: calls WSL API (evidence: `src/lib/wsllib/impl.go`)
- WSL adapter → WSL registry: calls registry API (evidence: `src/lib/wsllib/impl.go`)
