# whisky-app/whisky architecture

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

- Interactive diagram: https://gitdiagram.com/whisky-app/whisky
- Repository: https://github.com/whisky-app/whisky

## Overview

Whisky is a native macOS SwiftUI manager for running Windows apps and games through Wine. The main workflow creates a bottle, configures its Windows environment, discovers or adds programs, and launches them through Wine; bottle settings, pins, and program settings persist locally. Separate capabilities include Winetricks, PE inspection, setup and WhiskyWine installation, and a command-line interface. Relationships are limited to calls or references visible in the excerpts, SOURCE INDEX, or README; some unsampled subsystem details are therefore represented without speculative internal links.

Main entry points: [`Whisky/Views/Bottle/BottleView.swift`](https://github.com/whisky-app/whisky/blob/main/Whisky/Views/Bottle/BottleView.swift) (Bottle dashboard), [`Whisky/Views/ContentView.swift`](https://github.com/whisky-app/whisky/blob/main/Whisky/Views/ContentView.swift) (Bottle browser), [`Whisky/View Models/BottleVM.swift`](https://github.com/whisky-app/whisky/blob/main/Whisky/View%20Models/BottleVM.swift) (Bottle coordinator), [`WhiskyKit/Sources/WhiskyKit/Wine/Wine.swift`](https://github.com/whisky-app/whisky/blob/main/WhiskyKit/Sources/WhiskyKit/Wine/Wine.swift) (Wine operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Whisky app"]
  node_content["Bottle browser<br/>[ContentView.swift]"]
  node_bottlecreate["Create bottle UI"]
  node_detail["Bottle dashboard<br/>[BottleView.swift]"]
  node_config["Bottle configuration<br/>[ConfigView.swift]"]
  node_programs["Program browser<br/>[ProgramsView.swift]"]
  node_pins["Pinned programs<br/>[PinView.swift]"]
  node_winetricksui["Winetricks UI"]
end

subgraph group_bottles["Bottle management"]
  node_bottlevm["Bottle coordinator<br/>[BottleVM.swift]"]
  node_bottlelist[("Bottle registry<br/>[BottleData.swift]")]
  node_bottle["Bottle model<br/>[Bottle.swift]"]
  node_settings[("Bottle settings")]
  node_program["Program model<br/>[Program.swift]"]
  node_programsettings[("Program settings")]
end

subgraph group_runtime["Wine runtime"]
  node_winetricks["Winetricks runner<br/>[Winetricks.swift]"]
  node_wine["Wine operations<br/>[Wine.swift]"]
  node_winebinary["WhiskyWine runtime"]
  node_externalwine{{"Wine processes"}}
end

subgraph group_support["Setup and inspection"]
  node_setup["First-run setup<br/>[WelcomeView.swift]"]
  node_pe["PE section parser<br/>[Section.swift]"]
  node_cli["Command-line interface<br/>[Main.swift]"]
end

node_user(("Mac user"))
node_versionservice{{"Version endpoint"}}

node_user -->|"manages bottles"| node_content
node_content -->|"loads bottles"| node_bottlevm
node_content -->|"opens creation"| node_bottlecreate
node_bottlecreate -->|"requests creation"| node_bottlevm
node_bottlevm -->|"creates bottle"| node_bottle
node_bottlevm -->|"sets version"| node_wine
node_bottlevm -->|"loads paths"| node_bottlelist
node_bottlelist -->|"loads bottles"| node_bottle
node_content -->|"shows selection"| node_detail
node_detail -->|"opens settings"| node_config
node_detail -->|"opens programs"| node_programs
node_detail -->|"shows pins"| node_pins
node_detail -->|"opens tools"| node_winetricksui
node_detail -->|"runs selected app"| node_wine
node_config -->|"configures"| node_bottle
node_config -->|"inspects sections"| node_pe
node_programs -->|"displays programs"| node_program
node_program -->|"loads and saves"| node_programsettings
node_programs -->|"runs program"| node_wine
node_pins -->|"displays pinned"| node_program
node_winetricksui -->|"runs verbs"| node_winetricks
node_winetricks -->|"uses bundled tools"| node_winebinary
node_wine -->|"launches processes"| node_externalwine
node_setup -->|"installs runtime"| node_winebinary
node_content -->|"checks updates"| node_winebinary
node_winebinary -->|"fetches version"| node_versionservice
node_user -->|"runs commands"| node_cli
node_cli -->|"creates or runs"| node_bottle

click node_content "https://github.com/whisky-app/whisky/blob/main/Whisky/Views/ContentView.swift"
click node_bottlecreate "https://github.com/whisky-app/whisky/blob/main/Whisky/Views/Bottle/BottleCreationView.swift"
click node_bottlevm "https://github.com/whisky-app/whisky/blob/main/Whisky/View%20Models/BottleVM.swift"
click node_bottlelist "https://github.com/whisky-app/whisky/blob/main/WhiskyKit/Sources/WhiskyKit/Whisky/BottleData.swift"
click node_bottle "https://github.com/whisky-app/whisky/blob/main/WhiskyKit/Sources/WhiskyKit/Whisky/Bottle.swift"
click node_settings "https://github.com/whisky-app/whisky/blob/main/WhiskyKit/Sources/WhiskyKit/Whisky/BottleSettings.swift"
click node_detail "https://github.com/whisky-app/whisky/blob/main/Whisky/Views/Bottle/BottleView.swift"
click node_config "https://github.com/whisky-app/whisky/blob/main/Whisky/Views/Bottle/ConfigView.swift"
click node_programs "https://github.com/whisky-app/whisky/blob/main/Whisky/Views/Programs/ProgramsView.swift"
click node_program "https://github.com/whisky-app/whisky/blob/main/WhiskyKit/Sources/WhiskyKit/Whisky/Program.swift"
click node_programsettings "https://github.com/whisky-app/whisky/blob/main/WhiskyKit/Sources/WhiskyKit/Whisky/ProgramSettings.swift"
click node_pins "https://github.com/whisky-app/whisky/blob/main/Whisky/Views/Bottle/Pins/PinView.swift"
click node_winetricksui "https://github.com/whisky-app/whisky/blob/main/Whisky/Views/Bottle/WinetricksView.swift"
click node_winetricks "https://github.com/whisky-app/whisky/blob/main/Whisky/Utils/Winetricks.swift"
click node_wine "https://github.com/whisky-app/whisky/blob/main/WhiskyKit/Sources/WhiskyKit/Wine/Wine.swift"
click node_winebinary "https://github.com/whisky-app/whisky/blob/main/WhiskyKit/Sources/WhiskyKit/WhiskyWine/WhiskyWineInstaller.swift"
click node_setup "https://github.com/whisky-app/whisky/blob/main/Whisky/Views/Setup/WelcomeView.swift"
click node_pe "https://github.com/whisky-app/whisky/blob/main/WhiskyKit/Sources/WhiskyKit/PE/Section.swift"
click node_cli "https://github.com/whisky-app/whisky/blob/main/WhiskyCmd/Main.swift"

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_content,node_bottlecreate,node_detail,node_config,node_programs,node_pins,node_winetricksui,node_user toneBlue
class node_bottlevm,node_bottlelist,node_bottle,node_settings,node_program,node_programsettings toneAmber
class node_winetricks,node_wine,node_winebinary,node_externalwine toneMint
class node_setup,node_pe,node_cli toneRose
class node_versionservice toneIndigo
```

## Components

### Whisky app

- [Bottle browser](https://github.com/whisky-app/whisky/blob/main/Whisky/Views/ContentView.swift): `Whisky/Views/ContentView.swift`
- [Create bottle UI](https://github.com/whisky-app/whisky/blob/main/Whisky/Views/Bottle/BottleCreationView.swift): `Whisky/Views/Bottle/BottleCreationView.swift`
- [Bottle dashboard](https://github.com/whisky-app/whisky/blob/main/Whisky/Views/Bottle/BottleView.swift): `Whisky/Views/Bottle/BottleView.swift`
- [Bottle configuration](https://github.com/whisky-app/whisky/blob/main/Whisky/Views/Bottle/ConfigView.swift): `Whisky/Views/Bottle/ConfigView.swift`
- [Program browser](https://github.com/whisky-app/whisky/blob/main/Whisky/Views/Programs/ProgramsView.swift): `Whisky/Views/Programs/ProgramsView.swift`
- [Pinned programs](https://github.com/whisky-app/whisky/blob/main/Whisky/Views/Bottle/Pins/PinView.swift): `Whisky/Views/Bottle/Pins/PinView.swift`
- [Winetricks UI](https://github.com/whisky-app/whisky/blob/main/Whisky/Views/Bottle/WinetricksView.swift): `Whisky/Views/Bottle/WinetricksView.swift`

### Bottle management

- [Bottle coordinator](https://github.com/whisky-app/whisky/blob/main/Whisky/View%20Models/BottleVM.swift): `Whisky/View Models/BottleVM.swift`
- [Bottle registry](https://github.com/whisky-app/whisky/blob/main/WhiskyKit/Sources/WhiskyKit/Whisky/BottleData.swift): `WhiskyKit/Sources/WhiskyKit/Whisky/BottleData.swift`
- [Bottle model](https://github.com/whisky-app/whisky/blob/main/WhiskyKit/Sources/WhiskyKit/Whisky/Bottle.swift): `WhiskyKit/Sources/WhiskyKit/Whisky/Bottle.swift`
- [Bottle settings](https://github.com/whisky-app/whisky/blob/main/WhiskyKit/Sources/WhiskyKit/Whisky/BottleSettings.swift): `WhiskyKit/Sources/WhiskyKit/Whisky/BottleSettings.swift`
- [Program model](https://github.com/whisky-app/whisky/blob/main/WhiskyKit/Sources/WhiskyKit/Whisky/Program.swift): `WhiskyKit/Sources/WhiskyKit/Whisky/Program.swift`
- [Program settings](https://github.com/whisky-app/whisky/blob/main/WhiskyKit/Sources/WhiskyKit/Whisky/ProgramSettings.swift): `WhiskyKit/Sources/WhiskyKit/Whisky/ProgramSettings.swift`

### Wine runtime

- [Winetricks runner](https://github.com/whisky-app/whisky/blob/main/Whisky/Utils/Winetricks.swift): `Whisky/Utils/Winetricks.swift`
- [Wine operations](https://github.com/whisky-app/whisky/blob/main/WhiskyKit/Sources/WhiskyKit/Wine/Wine.swift): `WhiskyKit/Sources/WhiskyKit/Wine/Wine.swift`
- [WhiskyWine runtime](https://github.com/whisky-app/whisky/blob/main/WhiskyKit/Sources/WhiskyKit/WhiskyWine/WhiskyWineInstaller.swift): `WhiskyKit/Sources/WhiskyKit/WhiskyWine/WhiskyWineInstaller.swift`
- **Wine processes**

### Setup and inspection

- [First-run setup](https://github.com/whisky-app/whisky/blob/main/Whisky/Views/Setup/WelcomeView.swift): `Whisky/Views/Setup/WelcomeView.swift`
- [PE section parser](https://github.com/whisky-app/whisky/blob/main/WhiskyKit/Sources/WhiskyKit/PE/Section.swift): `WhiskyKit/Sources/WhiskyKit/PE/Section.swift`
- [Command-line interface](https://github.com/whisky-app/whisky/blob/main/WhiskyCmd/Main.swift): `WhiskyCmd/Main.swift`

### Other components

- **Mac user**
- **Version endpoint**

## Connections

- Mac user → Bottle browser: manages bottles
- Bottle browser → Bottle coordinator: loads bottles (evidence: `Whisky/Views/ContentView.swift`)
- Bottle browser → Create bottle UI: opens creation (evidence: `Whisky/Views/ContentView.swift`)
- Create bottle UI → Bottle coordinator: requests creation (evidence: `Whisky/Views/Bottle/BottleCreationView.swift`)
- Bottle coordinator → Bottle model: creates bottle (evidence: `Whisky/View Models/BottleVM.swift`)
- Bottle coordinator → Wine operations: sets version (evidence: `Whisky/View Models/BottleVM.swift`)
- Bottle coordinator → Bottle registry: loads paths (evidence: `Whisky/View Models/BottleVM.swift`)
- Bottle registry → Bottle model: loads bottles (evidence: `WhiskyKit/Sources/WhiskyKit/Whisky/BottleData.swift`)
- Bottle browser → Bottle dashboard: shows selection (evidence: `Whisky/Views/ContentView.swift`)
- Bottle dashboard → Bottle configuration: opens settings (evidence: `Whisky/Views/Bottle/BottleView.swift`)
- Bottle dashboard → Program browser: opens programs (evidence: `Whisky/Views/Bottle/BottleView.swift`)
- Bottle dashboard → Pinned programs: shows pins (evidence: `Whisky/Views/Bottle/BottleView.swift`)
- Bottle dashboard → Winetricks UI: opens tools (evidence: `Whisky/Views/Bottle/BottleView.swift`)
- Bottle dashboard → Wine operations: runs selected app (evidence: `Whisky/Views/Bottle/BottleView.swift`)
- Bottle configuration → Bottle model: configures (evidence: `Whisky/Views/Bottle/ConfigView.swift`)
- Bottle configuration → PE section parser: inspects sections (evidence: `Whisky/Views/Bottle/ConfigView.swift`)
- Program browser → Program model: displays programs (evidence: `Whisky/Views/Programs/ProgramsView.swift`)
- Program model → Program settings: loads and saves (evidence: `WhiskyKit/Sources/WhiskyKit/Whisky/Program.swift`)
- Program browser → Wine operations: runs program (evidence: `Whisky/Views/Programs/ProgramsView.swift`)
- Pinned programs → Program model: displays pinned (evidence: `Whisky/Views/Bottle/Pins/PinView.swift`)
- Winetricks UI → Winetricks runner: runs verbs (evidence: `Whisky/Views/Bottle/WinetricksView.swift`)
- Winetricks runner → WhiskyWine runtime: uses bundled tools (evidence: `Whisky/Utils/Winetricks.swift`)
- Wine operations → Wine processes: launches processes (evidence: `WhiskyKit/Sources/WhiskyKit/Wine/Wine.swift`)
- First-run setup → WhiskyWine runtime: installs runtime (evidence: `Whisky/Views/Setup/WelcomeView.swift`)
- Bottle browser → WhiskyWine runtime: checks updates (evidence: `Whisky/Views/ContentView.swift`)
- WhiskyWine runtime → Version endpoint: fetches version (evidence: `WhiskyKit/Sources/WhiskyKit/WhiskyWine/WhiskyWineInstaller.swift`)
- Mac user → Command-line interface: runs commands (evidence: `WhiskyCmd/Main.swift`)
- Command-line interface → Bottle model: creates or runs (evidence: `WhiskyCmd/Main.swift`)
