# reinhardt-stadler/wds-mod-manager architecture

> Architecture diagram of the GitHub repository reinhardt-stadler/wds-mod-manager, 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/reinhardt-stadler/wds-mod-manager
- Repository: https://github.com/reinhardt-stadler/wds-mod-manager

## Overview

WDS Mod Manager installs and manages Wargame Design Studio visual mods through a shared Python backend exposed by a CLI and a Tauri/Vue desktop client. The main workflow discovers games, scans and matches mod paths, lets users review mappings, then installs files with backups and registry/log updates; users can inspect status, switch or uninstall mods, and undo operations. The GUI adds game/file browsing and BMP preview and comparison. Some command and GUI internals were not excerpted, so those links rely on README statements or indexed references.

Main entry points: [`src/wds/cli/app.py`](https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/cli/app.py) (CLI and REPL), [`src/wds/installer.py`](https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/installer.py) (Install engine), [`src/wds/cli/install_cmd.py`](https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/cli/install_cmd.py) (Install command), [`gui/src/App.vue`](https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/gui/src/App.vue) (GUI shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI and commands"]
  node_cli_app["CLI and REPL<br/>[app.py]"]
  node_install_cmd["Install command<br/>[install_cmd.py]"]
  node_manage_cmd["Mod management<br/>[manage_cmd.py]"]
  node_scan_cmd["Scan command<br/>[scan_cmd.py]"]
  node_status_cmd["Status command<br/>[status_cmd.py]"]
  node_undo_cmd["Undo command<br/>[undo_cmd.py]"]
  node_map_cmd["Mapping commands<br/>[map_cmd.py]"]
  node_edit_cmd["Edit protection<br/>[edit_cmd.py]"]
  node_zip_cmd["ZIP import<br/>[import_zip_cmd.py]"]
end

subgraph group_mapping["Discovery and mapping"]
  node_review["Mapping review<br/>[review.py]"]
  node_scanner["Game discovery<br/>[scanner.py]"]
  node_matcher["Path matcher<br/>[matcher.py]"]
  node_mapping_profile[("Mapping profiles<br/>[mapping_profile.py]")]
end

subgraph group_runtime["Install and state"]
  node_installer["Install engine<br/>[installer.py]"]
  node_backup[("File backups<br/>[backup.py]")]
  node_registry[("Mod registry<br/>[registry.py]")]
  node_operation_log[("Undo log<br/>[operation_log.py]")]
  node_models["Domain models<br/>[models.py]"]
end

subgraph group_desktop["Desktop interface"]
  node_gui_shell["GUI shell<br/>[App.vue]"]
  node_dashboard["Game dashboard<br/>[DashboardView.vue]"]
  node_tree_view["File tree<br/>[TreeView.vue]"]
  node_gui_bridge["CLI bridge<br/>[wds-bridge.ts]"]
  node_tauri_bridge["Tauri backend bridge<br/>[wds_cli.rs]"]
end

subgraph group_preview["BMP preview"]
  node_preview_store["Preview state<br/>[preview-store.ts]"]
  node_preview_canvas["Preview canvas<br/>[PreviewCanvas.vue]"]
  node_preview_tile["Preview tile<br/>[PreviewTile.vue]"]
  node_bmp_compare["BMP comparison<br/>[BmpCompare.vue]"]
  node_bmp_worker["BMP worker<br/>[bmp-worker.ts]"]
  node_bmp_decode["BMP decoder<br/>[bmp-decode.ts]"]
end

node_user(("User"))
node_game_files[("WDS game files")]

node_user -->|"runs commands"| node_cli_app
node_cli_app -->|"dispatches"| node_install_cmd
node_cli_app -->|"dispatches"| node_manage_cmd
node_cli_app -->|"dispatches"| node_scan_cmd
node_cli_app -->|"dispatches"| node_status_cmd
node_cli_app -->|"dispatches"| node_undo_cmd
node_cli_app -->|"dispatches"| node_map_cmd
node_cli_app -->|"dispatches"| node_edit_cmd
node_cli_app -->|"dispatches"| node_zip_cmd
node_install_cmd -->|"discovers games"| node_scanner
node_install_cmd -->|"matches paths"| node_matcher
node_install_cmd -->|"applies rules"| node_mapping_profile
node_install_cmd -->|"requests review"| node_review
node_install_cmd -->|"installs mod"| node_installer
node_review -->|"learns mappings"| node_mapping_profile
node_scan_cmd -.->|"discovers games"| node_scanner
node_manage_cmd -->|"manages mods"| node_installer
node_manage_cmd -->|"reads status"| node_registry
node_map_cmd -->|"edits rules"| node_mapping_profile
node_edit_cmd -->|"marks files"| node_registry
node_undo_cmd -.->|"reverses operation"| node_installer
node_installer -->|"backs up files"| node_backup
node_installer -->|"updates state"| node_registry
node_installer -->|"logs operation"| node_operation_log
node_installer -->|"copies files"| node_game_files
node_scanner -->|"scans directories"| node_game_files
node_user -->|"uses desktop app"| node_gui_shell
node_gui_shell -->|"shows view"| node_dashboard
node_gui_shell -->|"shows view"| node_tree_view
node_dashboard -->|"requests game status"| node_gui_bridge
node_tree_view -->|"requests files and status"| node_gui_bridge
node_gui_bridge -->|"invokes backend"| node_tauri_bridge
node_tauri_bridge -->|"runs CLI backend"| node_cli_app
node_gui_shell -->|"sets theme"| node_user
node_tree_view -->|"sets selection"| node_preview_store
node_tree_view -->|"mounts preview"| node_preview_canvas
node_preview_canvas -->|"reads selection"| node_preview_store
node_preview_canvas -->|"renders tiles"| node_preview_tile
node_preview_tile -->|"shows comparison"| node_bmp_compare
node_bmp_compare -->|"decodes images"| node_bmp_worker
node_bmp_worker -->|"uses decoder"| node_bmp_decode
node_bmp_compare -->|"decodes BMP"| node_bmp_decode
node_bmp_compare -.->|"compares original"| node_backup

click node_cli_app "https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/cli/app.py"
click node_install_cmd "https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/cli/install_cmd.py"
click node_manage_cmd "https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/cli/manage_cmd.py"
click node_scan_cmd "https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/cli/scan_cmd.py"
click node_status_cmd "https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/cli/status_cmd.py"
click node_undo_cmd "https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/cli/undo_cmd.py"
click node_map_cmd "https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/cli/map_cmd.py"
click node_edit_cmd "https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/cli/edit_cmd.py"
click node_zip_cmd "https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/cli/import_zip_cmd.py"
click node_review "https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/cli/review.py"
click node_scanner "https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/scanner.py"
click node_matcher "https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/matcher.py"
click node_mapping_profile "https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/mapping_profile.py"
click node_installer "https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/installer.py"
click node_backup "https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/backup.py"
click node_registry "https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/registry.py"
click node_operation_log "https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/operation_log.py"
click node_models "https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/models.py"
click node_gui_shell "https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/gui/src/App.vue"
click node_dashboard "https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/gui/src/views/DashboardView.vue"
click node_tree_view "https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/gui/src/views/TreeView.vue"
click node_gui_bridge "https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/gui/src/lib/wds-bridge.ts"
click node_tauri_bridge "https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/gui/src-tauri/src/wds_cli.rs"
click node_preview_store "https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/gui/src/lib/preview-store.ts"
click node_preview_canvas "https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/gui/src/components/PreviewCanvas.vue"
click node_preview_tile "https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/gui/src/components/PreviewTile.vue"
click node_bmp_compare "https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/gui/src/components/BmpCompare.vue"
click node_bmp_worker "https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/gui/src/lib/bmp-worker.ts"
click node_bmp_decode "https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/gui/src/lib/bmp-decode.ts"

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_app,node_install_cmd,node_manage_cmd,node_scan_cmd,node_status_cmd,node_undo_cmd,node_map_cmd,node_edit_cmd,node_zip_cmd,node_user toneBlue
class node_review,node_scanner,node_matcher,node_mapping_profile,node_game_files toneAmber
class node_installer,node_backup,node_registry,node_operation_log,node_models toneMint
class node_gui_shell,node_dashboard,node_tree_view,node_gui_bridge,node_tauri_bridge toneRose
class node_preview_store,node_preview_canvas,node_preview_tile,node_bmp_compare,node_bmp_worker,node_bmp_decode toneIndigo
```

## Components

### CLI and commands

- [CLI and REPL](https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/cli/app.py): `src/wds/cli/app.py`
- [Install command](https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/cli/install_cmd.py): `src/wds/cli/install_cmd.py`
- [Mod management](https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/cli/manage_cmd.py): `src/wds/cli/manage_cmd.py`
- [Scan command](https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/cli/scan_cmd.py): `src/wds/cli/scan_cmd.py`
- [Status command](https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/cli/status_cmd.py): `src/wds/cli/status_cmd.py`
- [Undo command](https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/cli/undo_cmd.py): `src/wds/cli/undo_cmd.py`
- [Mapping commands](https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/cli/map_cmd.py): `src/wds/cli/map_cmd.py`
- [Edit protection](https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/cli/edit_cmd.py): `src/wds/cli/edit_cmd.py`
- [ZIP import](https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/cli/import_zip_cmd.py): `src/wds/cli/import_zip_cmd.py`

### Discovery and mapping

- [Mapping review](https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/cli/review.py): `src/wds/cli/review.py`
- [Game discovery](https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/scanner.py): `src/wds/scanner.py`
- [Path matcher](https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/matcher.py): `src/wds/matcher.py`
- [Mapping profiles](https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/mapping_profile.py): `src/wds/mapping_profile.py`

### Install and state

- [Install engine](https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/installer.py): `src/wds/installer.py`
- [File backups](https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/backup.py): `src/wds/backup.py`
- [Mod registry](https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/registry.py): `src/wds/registry.py`
- [Undo log](https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/operation_log.py): `src/wds/operation_log.py`
- [Domain models](https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/src/wds/models.py): `src/wds/models.py`

### Desktop interface

- [GUI shell](https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/gui/src/App.vue): `gui/src/App.vue`
- [Game dashboard](https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/gui/src/views/DashboardView.vue): `gui/src/views/DashboardView.vue`
- [File tree](https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/gui/src/views/TreeView.vue): `gui/src/views/TreeView.vue`
- [CLI bridge](https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/gui/src/lib/wds-bridge.ts): `gui/src/lib/wds-bridge.ts`
- [Tauri backend bridge](https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/gui/src-tauri/src/wds_cli.rs): `gui/src-tauri/src/wds_cli.rs`

### BMP preview

- [Preview state](https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/gui/src/lib/preview-store.ts): `gui/src/lib/preview-store.ts`
- [Preview canvas](https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/gui/src/components/PreviewCanvas.vue): `gui/src/components/PreviewCanvas.vue`
- [Preview tile](https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/gui/src/components/PreviewTile.vue): `gui/src/components/PreviewTile.vue`
- [BMP comparison](https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/gui/src/components/BmpCompare.vue): `gui/src/components/BmpCompare.vue`
- [BMP worker](https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/gui/src/lib/bmp-worker.ts): `gui/src/lib/bmp-worker.ts`
- [BMP decoder](https://github.com/reinhardt-stadler/wds-mod-manager/blob/main/gui/src/lib/bmp-decode.ts): `gui/src/lib/bmp-decode.ts`

### Other components

- **User**
- **WDS game files**

## Connections

- User → CLI and REPL: runs commands (evidence: `README.md`)
- CLI and REPL → Install command: dispatches (evidence: `src/wds/cli/app.py`)
- CLI and REPL → Mod management: dispatches (evidence: `src/wds/cli/app.py`)
- CLI and REPL → Scan command: dispatches (evidence: `src/wds/cli/app.py`)
- CLI and REPL → Status command: dispatches (evidence: `src/wds/cli/app.py`)
- CLI and REPL → Undo command: dispatches (evidence: `src/wds/cli/app.py`)
- CLI and REPL → Mapping commands: dispatches (evidence: `src/wds/cli/app.py`)
- CLI and REPL → Edit protection: dispatches (evidence: `src/wds/cli/app.py`)
- CLI and REPL → ZIP import: dispatches (evidence: `src/wds/cli/app.py`)
- Install command → Game discovery: discovers games (evidence: `src/wds/cli/install_cmd.py`)
- Install command → Path matcher: matches paths (evidence: `src/wds/cli/install_cmd.py`)
- Install command → Mapping profiles: applies rules (evidence: `src/wds/cli/install_cmd.py`)
- Install command → Mapping review: requests review (evidence: `src/wds/cli/install_cmd.py`)
- Install command → Install engine: installs mod (evidence: `src/wds/cli/install_cmd.py`)
- Mapping review → Mapping profiles: learns mappings (evidence: `src/wds/mapping_profile.py`)
- Scan command → Game discovery: discovers games
- Mod management → Install engine: manages mods (evidence: `src/wds/cli/manage_cmd.py`)
- Mod management → Mod registry: reads status (evidence: `src/wds/cli/manage_cmd.py`)
- Mapping commands → Mapping profiles: edits rules (evidence: `src/wds/cli/map_cmd.py`)
- Edit protection → Mod registry: marks files (evidence: `src/wds/cli/edit_cmd.py`)
- Undo command → Install engine: reverses operation
- Install engine → File backups: backs up files (evidence: `src/wds/installer.py`)
- Install engine → Mod registry: updates state (evidence: `src/wds/installer.py`)
- Install engine → Undo log: logs operation (evidence: `src/wds/installer.py`)
- Install engine → WDS game files: copies files (evidence: `src/wds/installer.py`)
- Game discovery → WDS game files: scans directories (evidence: `src/wds/scanner.py`)
- User → GUI shell: uses desktop app (evidence: `README.md`)
- GUI shell → Game dashboard: shows view (evidence: `gui/src/App.vue`)
- GUI shell → File tree: shows view (evidence: `gui/src/App.vue`)
- Game dashboard → CLI bridge: requests game status (evidence: `gui/src/views/DashboardView.vue`)
- File tree → CLI bridge: requests files and status (evidence: `gui/src/views/TreeView.vue`)
- CLI bridge → Tauri backend bridge: invokes backend (evidence: `README.md`)
- Tauri backend bridge → CLI and REPL: runs CLI backend (evidence: `README.md`)
- GUI shell → User: sets theme (evidence: `gui/src/App.vue`)
- File tree → Preview state: sets selection (evidence: `gui/src/views/TreeView.vue`)
- File tree → Preview canvas: mounts preview (evidence: `gui/src/views/TreeView.vue`)
- Preview canvas → Preview state: reads selection (evidence: `gui/src/components/PreviewCanvas.vue`)
- Preview canvas → Preview tile: renders tiles (evidence: `gui/src/components/PreviewCanvas.vue`)
- Preview tile → BMP comparison: shows comparison (evidence: `gui/src/components/PreviewTile.vue`)
- BMP comparison → BMP worker: decodes images (evidence: `gui/src/components/BmpCompare.vue`)
- BMP worker → BMP decoder: uses decoder (evidence: `gui/src/lib/bmp-worker.ts`)
- BMP comparison → BMP decoder: decodes BMP (evidence: `gui/src/components/BmpCompare.vue`)
- BMP comparison → File backups: compares original (evidence: `README.md`)
