# fuatatik/macos-ssh-manager architecture

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

- Interactive diagram: https://gitdiagram.com/fuatatik/macos-ssh-manager
- Repository: https://github.com/fuatatik/macos-ssh-manager

## Overview

SSH Manager is a native macOS menu-bar app for managing saved SSH connections and opening them in a terminal. The principal workflow is: launch the app, choose or create a connection from the menu, save connection details, then launch an SSH session using password or key authentication. Connection editing and deletion are additional management stages. The excerpts show menu-bar setup, terminal-launch fallbacks, forms, and connection-list UI; storage details and some action wiring are documented in the README but not fully visible in the sampled source.

Main entry points: [`SSHManager.swift`](https://github.com/fuatatik/macos-ssh-manager/blob/main/SSHManager.swift) (App delegate), [`main.swift`](https://github.com/fuatatik/macos-ssh-manager/blob/main/main.swift) (App entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App lifecycle"]
  node_main["App entry<br/>[main.swift]"]
  node_delegate["App delegate<br/>[SSHManager.swift]"]
end

subgraph group_management["Connection management"]
  node_menu["Menu bar<br/>[SSHManager.swift]"]
  node_connection_form["Connection form<br/>[SSHManager.swift]"]
  node_key_picker["Key file picker<br/>[SSHManager.swift]"]
  node_connection_list["Connection manager<br/>[SSHManager.swift]"]
  node_connection_record["Connection data<br/>[SSHManager.swift]"]
end

subgraph group_persistence["Connection storage"]
  node_json_file[("Connections JSON")]
end

subgraph group_connection["SSH launch"]
  node_terminal_launch["Terminal launcher<br/>[SSHManager.swift]"]
  node_ssh_command["SSH command<br/>[SSHManager.swift]"]
end

node_user(("User"))
node_terminal["macOS Terminal"]
node_iterm["iTerm2"]
node_ssh_server["SSH server"]
node_sshpass["sshpass"]

node_user -->|"launches"| node_main
node_main -->|"sets delegate"| node_delegate
node_user -->|"chooses action"| node_menu
node_delegate -->|"creates"| node_menu
node_menu -->|"dispatches actions"| node_delegate
node_delegate -->|"opens"| node_connection_form
node_delegate -->|"opens"| node_connection_list
node_connection_form -->|"selects key"| node_key_picker
node_connection_form -->|"collects details"| node_connection_record
node_connection_list -->|"displays and edits"| node_connection_record
node_delegate -->|"loads and saves"| node_json_file
node_json_file -->|"returns saved data"| node_delegate
node_delegate -->|"starts connection"| node_terminal_launch
node_terminal_launch -->|"prepares"| node_ssh_command
node_terminal_launch -->|"opens session"| node_terminal
node_terminal_launch -.->|"tries fallback"| node_iterm
node_ssh_command -->|"connects to"| node_ssh_server
node_terminal_launch -.->|"uses for passwords"| node_sshpass

click node_main "https://github.com/fuatatik/macos-ssh-manager/blob/main/main.swift"
click node_delegate "https://github.com/fuatatik/macos-ssh-manager/blob/main/SSHManager.swift"
click node_menu "https://github.com/fuatatik/macos-ssh-manager/blob/main/SSHManager.swift"
click node_connection_form "https://github.com/fuatatik/macos-ssh-manager/blob/main/SSHManager.swift"
click node_key_picker "https://github.com/fuatatik/macos-ssh-manager/blob/main/SSHManager.swift"
click node_connection_list "https://github.com/fuatatik/macos-ssh-manager/blob/main/SSHManager.swift"
click node_connection_record "https://github.com/fuatatik/macos-ssh-manager/blob/main/SSHManager.swift"
click node_terminal_launch "https://github.com/fuatatik/macos-ssh-manager/blob/main/SSHManager.swift"
click node_ssh_command "https://github.com/fuatatik/macos-ssh-manager/blob/main/SSHManager.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_main,node_delegate,node_user toneBlue
class node_menu,node_connection_form,node_key_picker,node_connection_list,node_connection_record toneAmber
class node_json_file,node_ssh_server toneMint
class node_terminal_launch,node_ssh_command toneRose
class node_terminal,node_iterm,node_sshpass toneIndigo
```

## Components

### App lifecycle

- [App entry](https://github.com/fuatatik/macos-ssh-manager/blob/main/main.swift): `main.swift`
- [App delegate](https://github.com/fuatatik/macos-ssh-manager/blob/main/SSHManager.swift): `SSHManager.swift`

### Connection management

- [Menu bar](https://github.com/fuatatik/macos-ssh-manager/blob/main/SSHManager.swift): `SSHManager.swift`
- [Connection form](https://github.com/fuatatik/macos-ssh-manager/blob/main/SSHManager.swift): `SSHManager.swift`
- [Key file picker](https://github.com/fuatatik/macos-ssh-manager/blob/main/SSHManager.swift): `SSHManager.swift`
- [Connection manager](https://github.com/fuatatik/macos-ssh-manager/blob/main/SSHManager.swift): `SSHManager.swift`
- [Connection data](https://github.com/fuatatik/macos-ssh-manager/blob/main/SSHManager.swift): `SSHManager.swift`

### Connection storage

- **Connections JSON**

### SSH launch

- [Terminal launcher](https://github.com/fuatatik/macos-ssh-manager/blob/main/SSHManager.swift): `SSHManager.swift`
- [SSH command](https://github.com/fuatatik/macos-ssh-manager/blob/main/SSHManager.swift): `SSHManager.swift`

### Other components

- **User**
- **macOS Terminal**
- **iTerm2**
- **SSH server**
- **sshpass**

## Connections

- User → App entry: launches
- App entry → App delegate: sets delegate
- User → Menu bar: chooses action
- App delegate → Menu bar: creates
- Menu bar → App delegate: dispatches actions
- App delegate → Connection form: opens
- App delegate → Connection manager: opens
- Connection form → Key file picker: selects key
- Connection form → Connection data: collects details
- Connection manager → Connection data: displays and edits
- App delegate → Connections JSON: loads and saves
- Connections JSON → App delegate: returns saved data
- App delegate → Terminal launcher: starts connection
- Terminal launcher → SSH command: prepares
- Terminal launcher → macOS Terminal: opens session
- Terminal launcher → iTerm2: tries fallback
- SSH command → SSH server: connects to
- Terminal launcher → sshpass: uses for passwords
