# ahagelberg/wassh architecture

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

- Interactive diagram: https://gitdiagram.com/ahagelberg/wassh
- Repository: https://github.com/ahagelberg/wassh

## Overview

WaSSH is a native desktop client for SSH and local terminal sessions, with saved hosts, tabs, file management and built-in plugins. The primary path is launch into the application shell, open or create a session, connect through a backend, and render its terminal in the UI. Separate branches cover persistence, SSH features, and plugin capabilities. The README documents crate responsibilities; links between components are included only where excerpts, indexed references, or the README support them. Several plugin implementations are unsampled, so their internal wiring is not inferred.

Main entry points: [`crates/wassh/src/app/session.rs`](https://github.com/ahagelberg/wassh/blob/main/crates/wassh/src/app/session.rs) (Open session), [`crates/wassh-plugins/src/plugin.rs`](https://github.com/ahagelberg/wassh/blob/main/crates/wassh-plugins/src/plugin.rs) (Plugin registry), [`crates/wassh/src/app/mod.rs`](https://github.com/ahagelberg/wassh/blob/main/crates/wassh/src/app/mod.rs) (Application shell), [`crates/wassh/src/main.rs`](https://github.com/ahagelberg/wassh/blob/main/crates/wassh/src/main.rs) (App entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Desktop app"]
  node_entry["App entry<br/>[main.rs]"]
  node_shell["Application shell<br/>[mod.rs]"]
  node_session["Open session<br/>[session.rs]"]
  node_dialogs["Connection dialogs<br/>[dialogs.rs]"]
  node_localexec["Local execution<br/>[local_exec.rs]"]
  node_localfiles["Local files<br/>[local_files.rs]"]
  node_wslfiles["WSL files<br/>[wsl_files.rs]"]
end

subgraph group_transport["Session transports"]
  node_ssh["SSH transport<br/>[session.rs]"]
  node_sftp["SFTP operations<br/>[sftp.rs]"]
  node_telnet["Telnet transport<br/>[session.rs]"]
  node_serial["Serial transport<br/>[lib.rs]"]
end

subgraph group_terminal["Terminal and UI"]
  node_terminal["Terminal emulator<br/>[emulator.rs]"]
  node_terminalui["Terminal view<br/>[terminal_view.rs]"]
  node_sidebar["Host sidebar<br/>[sidebar.rs]"]
end

subgraph group_plugins["Built-in plugins"]
  node_pluginhost["Plugin registry<br/>[plugin.rs]"]
  node_agent["AI agent<br/>[agent.rs]"]
  node_filesplugin["Files plugin<br/>[files.rs]"]
  node_monitor["Server monitor<br/>[monitor.rs]"]
  node_commands["Command plugin<br/>[command.rs]"]
  node_docker["Docker plugin<br/>[docker.rs]"]
  node_mqttplugin["MQTT plugin<br/>[mqtt.rs]"]
end

subgraph group_state["Domain and persistence"]
  node_core["Domain model<br/>[session.rs]"]
  node_store[("Config store<br/>[lib.rs]")]
  node_legacy["Legacy import<br/>[legacy.rs]"]
  node_sys["System facts<br/>[lib.rs]"]
end

node_user(("Desktop user"))

node_user -->|"launches"| node_entry
node_entry -->|"runs"| node_shell
node_shell -->|"manages"| node_session
node_shell -->|"opens"| node_dialogs
node_session -->|"uses"| node_localexec
node_session -->|"uses"| node_localfiles
node_session -->|"uses"| node_wslfiles
node_session -->|"uses backend"| node_ssh
node_session -->|"owns emulator"| node_terminal
node_shell -->|"draws terminal"| node_terminalui
node_sidebar -->|"references"| node_terminalui
node_ssh -->|"supports"| node_sftp
node_ssh -.->|"uses host facts"| node_sys
node_shell -.->|"persists state"| node_store
node_entry -.->|"imports old config"| node_legacy
node_shell -.->|"uses domain model"| node_core
node_session -.->|"hosts panes"| node_pluginhost
node_pluginhost -->|"registers"| node_agent
node_pluginhost -->|"registers"| node_filesplugin
node_pluginhost -->|"registers"| node_monitor
node_pluginhost -->|"registers"| node_commands
node_pluginhost -->|"registers"| node_docker
node_pluginhost -->|"registers"| node_mqttplugin
node_filesplugin -->|"accesses files"| node_session
node_monitor -->|"requests commands"| node_commands
node_user -.->|"connects via"| node_telnet
node_user -.->|"connects via"| node_serial

click node_entry "https://github.com/ahagelberg/wassh/blob/main/crates/wassh/src/main.rs"
click node_shell "https://github.com/ahagelberg/wassh/blob/main/crates/wassh/src/app/mod.rs"
click node_session "https://github.com/ahagelberg/wassh/blob/main/crates/wassh/src/app/session.rs"
click node_dialogs "https://github.com/ahagelberg/wassh/blob/main/crates/wassh/src/app/dialogs.rs"
click node_localexec "https://github.com/ahagelberg/wassh/blob/main/crates/wassh/src/app/local_exec.rs"
click node_localfiles "https://github.com/ahagelberg/wassh/blob/main/crates/wassh/src/app/local_files.rs"
click node_wslfiles "https://github.com/ahagelberg/wassh/blob/main/crates/wassh/src/app/wsl_files.rs"
click node_ssh "https://github.com/ahagelberg/wassh/blob/main/crates/wassh-ssh/src/session.rs"
click node_sftp "https://github.com/ahagelberg/wassh/blob/main/crates/wassh-ssh/src/sftp.rs"
click node_telnet "https://github.com/ahagelberg/wassh/blob/main/crates/wassh-telnet/src/session.rs"
click node_serial "https://github.com/ahagelberg/wassh/blob/main/crates/wassh-serial/src/lib.rs"
click node_terminal "https://github.com/ahagelberg/wassh/blob/main/crates/wassh-term/src/emulator.rs"
click node_terminalui "https://github.com/ahagelberg/wassh/blob/main/crates/wassh-ui/src/terminal_view.rs"
click node_sidebar "https://github.com/ahagelberg/wassh/blob/main/crates/wassh-ui/src/sidebar.rs"
click node_pluginhost "https://github.com/ahagelberg/wassh/blob/main/crates/wassh-plugins/src/plugin.rs"
click node_agent "https://github.com/ahagelberg/wassh/blob/main/crates/wassh-plugins/src/ai_agent/agent.rs"
click node_filesplugin "https://github.com/ahagelberg/wassh/blob/main/crates/wassh-plugins/src/files.rs"
click node_monitor "https://github.com/ahagelberg/wassh/blob/main/crates/wassh-plugins/src/monitor.rs"
click node_commands "https://github.com/ahagelberg/wassh/blob/main/crates/wassh-plugins/src/command.rs"
click node_docker "https://github.com/ahagelberg/wassh/blob/main/crates/wassh-plugins/src/docker.rs"
click node_mqttplugin "https://github.com/ahagelberg/wassh/blob/main/crates/wassh-plugins/src/mqtt.rs"
click node_core "https://github.com/ahagelberg/wassh/blob/main/crates/wassh-core/src/session.rs"
click node_store "https://github.com/ahagelberg/wassh/blob/main/crates/wassh-store/src/lib.rs"
click node_legacy "https://github.com/ahagelberg/wassh/blob/main/crates/wassh-store/src/legacy.rs"
click node_sys "https://github.com/ahagelberg/wassh/blob/main/crates/wassh-sys/src/lib.rs"

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_entry,node_shell,node_session,node_dialogs,node_localexec,node_localfiles,node_wslfiles,node_user toneBlue
class node_ssh,node_sftp,node_telnet,node_serial toneAmber
class node_terminal,node_terminalui,node_sidebar toneMint
class node_pluginhost,node_agent,node_filesplugin,node_monitor,node_commands,node_docker,node_mqttplugin toneRose
class node_core,node_store,node_legacy,node_sys toneIndigo
```

## Components

### Desktop app

- [App entry](https://github.com/ahagelberg/wassh/blob/main/crates/wassh/src/main.rs): `crates/wassh/src/main.rs`
- [Application shell](https://github.com/ahagelberg/wassh/blob/main/crates/wassh/src/app/mod.rs): `crates/wassh/src/app/mod.rs`
- [Open session](https://github.com/ahagelberg/wassh/blob/main/crates/wassh/src/app/session.rs): `crates/wassh/src/app/session.rs`
- [Connection dialogs](https://github.com/ahagelberg/wassh/blob/main/crates/wassh/src/app/dialogs.rs): `crates/wassh/src/app/dialogs.rs`
- [Local execution](https://github.com/ahagelberg/wassh/blob/main/crates/wassh/src/app/local_exec.rs): `crates/wassh/src/app/local_exec.rs`
- [Local files](https://github.com/ahagelberg/wassh/blob/main/crates/wassh/src/app/local_files.rs): `crates/wassh/src/app/local_files.rs`
- [WSL files](https://github.com/ahagelberg/wassh/blob/main/crates/wassh/src/app/wsl_files.rs): `crates/wassh/src/app/wsl_files.rs`

### Session transports

- [SSH transport](https://github.com/ahagelberg/wassh/blob/main/crates/wassh-ssh/src/session.rs): `crates/wassh-ssh/src/session.rs`
- [SFTP operations](https://github.com/ahagelberg/wassh/blob/main/crates/wassh-ssh/src/sftp.rs): `crates/wassh-ssh/src/sftp.rs`
- [Telnet transport](https://github.com/ahagelberg/wassh/blob/main/crates/wassh-telnet/src/session.rs): `crates/wassh-telnet/src/session.rs`
- [Serial transport](https://github.com/ahagelberg/wassh/blob/main/crates/wassh-serial/src/lib.rs): `crates/wassh-serial/src/lib.rs`

### Terminal and UI

- [Terminal emulator](https://github.com/ahagelberg/wassh/blob/main/crates/wassh-term/src/emulator.rs): `crates/wassh-term/src/emulator.rs`
- [Terminal view](https://github.com/ahagelberg/wassh/blob/main/crates/wassh-ui/src/terminal_view.rs): `crates/wassh-ui/src/terminal_view.rs`
- [Host sidebar](https://github.com/ahagelberg/wassh/blob/main/crates/wassh-ui/src/sidebar.rs): `crates/wassh-ui/src/sidebar.rs`

### Built-in plugins

- [Plugin registry](https://github.com/ahagelberg/wassh/blob/main/crates/wassh-plugins/src/plugin.rs): `crates/wassh-plugins/src/plugin.rs`
- [AI agent](https://github.com/ahagelberg/wassh/blob/main/crates/wassh-plugins/src/ai_agent/agent.rs): `crates/wassh-plugins/src/ai_agent/agent.rs`
- [Files plugin](https://github.com/ahagelberg/wassh/blob/main/crates/wassh-plugins/src/files.rs): `crates/wassh-plugins/src/files.rs`
- [Server monitor](https://github.com/ahagelberg/wassh/blob/main/crates/wassh-plugins/src/monitor.rs): `crates/wassh-plugins/src/monitor.rs`
- [Command plugin](https://github.com/ahagelberg/wassh/blob/main/crates/wassh-plugins/src/command.rs): `crates/wassh-plugins/src/command.rs`
- [Docker plugin](https://github.com/ahagelberg/wassh/blob/main/crates/wassh-plugins/src/docker.rs): `crates/wassh-plugins/src/docker.rs`
- [MQTT plugin](https://github.com/ahagelberg/wassh/blob/main/crates/wassh-plugins/src/mqtt.rs): `crates/wassh-plugins/src/mqtt.rs`

### Domain and persistence

- [Domain model](https://github.com/ahagelberg/wassh/blob/main/crates/wassh-core/src/session.rs): `crates/wassh-core/src/session.rs`
- [Config store](https://github.com/ahagelberg/wassh/blob/main/crates/wassh-store/src/lib.rs): `crates/wassh-store/src/lib.rs`
- [Legacy import](https://github.com/ahagelberg/wassh/blob/main/crates/wassh-store/src/legacy.rs): `crates/wassh-store/src/legacy.rs`
- [System facts](https://github.com/ahagelberg/wassh/blob/main/crates/wassh-sys/src/lib.rs): `crates/wassh-sys/src/lib.rs`

### Other components

- **Desktop user**

## Connections

- Desktop user → App entry: launches (evidence: `crates/wassh/src/main.rs`)
- App entry → Application shell: runs (evidence: `crates/wassh/src/main.rs`)
- Application shell → Open session: manages (evidence: `crates/wassh/src/app/mod.rs`)
- Application shell → Connection dialogs: opens (evidence: `crates/wassh/src/app/mod.rs`)
- Open session → Local execution: uses (evidence: `crates/wassh/src/app/session.rs`)
- Open session → Local files: uses (evidence: `crates/wassh/src/app/session.rs`)
- Open session → WSL files: uses (evidence: `crates/wassh/src/app/session.rs`)
- Open session → SSH transport: uses backend (evidence: `crates/wassh/src/app/session.rs`)
- Open session → Terminal emulator: owns emulator (evidence: `crates/wassh/src/app/session.rs`)
- Application shell → Terminal view: draws terminal (evidence: `crates/wassh/src/app/mod.rs`)
- Host sidebar → Terminal view: references (evidence: `crates/wassh-ui/src/sidebar.rs`)
- SSH transport → SFTP operations: supports (evidence: `crates/wassh-ssh/src/session.rs`)
- SSH transport → System facts: uses host facts
- Application shell → Config store: persists state
- App entry → Legacy import: imports old config
- Application shell → Domain model: uses domain model
- Open session → Plugin registry: hosts panes
- Plugin registry → AI agent: registers (evidence: `crates/wassh-plugins/src/plugin.rs`)
- Plugin registry → Files plugin: registers (evidence: `crates/wassh-plugins/src/plugin.rs`)
- Plugin registry → Server monitor: registers (evidence: `crates/wassh-plugins/src/plugin.rs`)
- Plugin registry → Command plugin: registers (evidence: `crates/wassh-plugins/src/plugin.rs`)
- Plugin registry → Docker plugin: registers (evidence: `crates/wassh-plugins/src/plugin.rs`)
- Plugin registry → MQTT plugin: registers (evidence: `crates/wassh-plugins/src/plugin.rs`)
- Files plugin → Open session: accesses files (evidence: `crates/wassh-plugins/src/files.rs`)
- Server monitor → Command plugin: requests commands (evidence: `crates/wassh-plugins/src/monitor.rs`)
- Desktop user → Telnet transport: connects via
- Desktop user → Serial transport: connects via
