# xelaex/macscp architecture

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

- Interactive diagram: https://gitdiagram.com/xelaex/macscp
- Repository: https://github.com/xelaex/macscp

## Overview

MacSCP is a native macOS SFTP/SSH file-transfer client, not a web service. Its main workflow is to open a connection or select a favorite, verify the server key, choose a local folder, then browse and transfer files between local and remote panels. The single indexed source file implements the application; the README documents additional capabilities including a full SSH terminal, text editing, permissions, tabs, and Touch ID. Relationships below are documented in the README; the source excerpt is partial, so internal call paths are not inferred.

Main entry points: [`macos_app/main.py`](https://github.com/xelaex/macscp/blob/main/macos_app/main.py) (SSH/SFTP connection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_connection["Connections and trust"]
  node_app["MacSCP app<br/>[main.py]"]
  node_sessions["Connection tabs<br/>[main.py]"]
  node_ssh["SSH/SFTP connection<br/>[main.py]"]
  node_hosttrust["Host key trust<br/>[main.py]"]
end

subgraph group_files["File management"]
  node_local[("Local files")]
  node_panels["File panels<br/>[main.py]"]
  node_fileops["File operations<br/>[main.py]"]
  node_transfers["Background transfers<br/>[main.py]"]
  node_permissions["Permissions editor<br/>[main.py]"]
end

subgraph group_extras["Additional capabilities"]
  node_terminal["SSH terminal<br/>[main.py]"]
  node_textedit["Text editor<br/>[main.py]"]
end

subgraph group_prefs["Preferences and credentials"]
  node_favorites[("Favorites<br/>[main.py]")]
  node_savedcredentials[("Saved passwords<br/>[main.py]")]
  node_knownhosts[("known_hosts")]
end

node_user(("User"))
node_server["SSH server"]
node_touchid["Touch ID"]

node_user -->|"uses"| node_app
node_user -->|"opens tabs"| node_sessions
node_sessions -->|"connects"| node_ssh
node_ssh -->|"SSH/SFTP"| node_server
node_ssh -->|"verifies key"| node_hosttrust
node_hosttrust -->|"updates"| node_knownhosts
node_user -->|"browses"| node_panels
node_panels -->|"lists local files"| node_local
node_panels -->|"lists remote files"| node_server
node_user -->|"drags items"| node_transfers
node_transfers -->|"reads/writes"| node_local
node_transfers -->|"uploads/downloads"| node_server
node_user -->|"manages files"| node_fileops
node_user -->|"changes modes"| node_permissions
node_user -->|"opens console"| node_terminal
node_terminal -->|"sends terminal input"| node_server
node_user -->|"edits files"| node_textedit
node_textedit -->|"saves remote files"| node_server
node_user -->|"manages favorites"| node_favorites
node_favorites -->|"stores passwords"| node_savedcredentials
node_touchid -->|"unlocks"| node_savedcredentials

click node_app "https://github.com/xelaex/macscp/blob/main/macos_app/main.py"
click node_sessions "https://github.com/xelaex/macscp/blob/main/macos_app/main.py"
click node_ssh "https://github.com/xelaex/macscp/blob/main/macos_app/main.py"
click node_hosttrust "https://github.com/xelaex/macscp/blob/main/macos_app/main.py"
click node_panels "https://github.com/xelaex/macscp/blob/main/macos_app/main.py"
click node_fileops "https://github.com/xelaex/macscp/blob/main/macos_app/main.py"
click node_transfers "https://github.com/xelaex/macscp/blob/main/macos_app/main.py"
click node_permissions "https://github.com/xelaex/macscp/blob/main/macos_app/main.py"
click node_terminal "https://github.com/xelaex/macscp/blob/main/macos_app/main.py"
click node_textedit "https://github.com/xelaex/macscp/blob/main/macos_app/main.py"
click node_favorites "https://github.com/xelaex/macscp/blob/main/macos_app/main.py"
click node_savedcredentials "https://github.com/xelaex/macscp/blob/main/macos_app/main.py"

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_app,node_sessions,node_ssh,node_hosttrust,node_user toneBlue
class node_local,node_panels,node_fileops,node_transfers,node_permissions toneAmber
class node_terminal,node_textedit,node_server toneMint
class node_favorites,node_savedcredentials,node_knownhosts toneRose
class node_touchid toneIndigo
```

## Components

### Connections and trust

- [MacSCP app](https://github.com/xelaex/macscp/blob/main/macos_app/main.py): `macos_app/main.py`
- [Connection tabs](https://github.com/xelaex/macscp/blob/main/macos_app/main.py): `macos_app/main.py`
- [SSH/SFTP connection](https://github.com/xelaex/macscp/blob/main/macos_app/main.py): `macos_app/main.py`
- [Host key trust](https://github.com/xelaex/macscp/blob/main/macos_app/main.py): `macos_app/main.py`

### File management

- **Local files**
- [File panels](https://github.com/xelaex/macscp/blob/main/macos_app/main.py): `macos_app/main.py`
- [File operations](https://github.com/xelaex/macscp/blob/main/macos_app/main.py): `macos_app/main.py`
- [Background transfers](https://github.com/xelaex/macscp/blob/main/macos_app/main.py): `macos_app/main.py`
- [Permissions editor](https://github.com/xelaex/macscp/blob/main/macos_app/main.py): `macos_app/main.py`

### Additional capabilities

- [SSH terminal](https://github.com/xelaex/macscp/blob/main/macos_app/main.py): `macos_app/main.py`
- [Text editor](https://github.com/xelaex/macscp/blob/main/macos_app/main.py): `macos_app/main.py`

### Preferences and credentials

- [Favorites](https://github.com/xelaex/macscp/blob/main/macos_app/main.py): `macos_app/main.py`
- [Saved passwords](https://github.com/xelaex/macscp/blob/main/macos_app/main.py): `macos_app/main.py`
- **known_hosts**

### Other components

- **User**
- **SSH server**
- **Touch ID**

## Connections

- User → MacSCP app: uses (evidence: `README.md`)
- User → Connection tabs: opens tabs (evidence: `README.md`)
- Connection tabs → SSH/SFTP connection: connects (evidence: `README.md`)
- SSH/SFTP connection → SSH server: SSH/SFTP (evidence: `README.md`)
- SSH/SFTP connection → Host key trust: verifies key (evidence: `README.md`)
- Host key trust → known_hosts: updates (evidence: `README.md`)
- User → File panels: browses (evidence: `README.md`)
- File panels → Local files: lists local files (evidence: `README.md`)
- File panels → SSH server: lists remote files (evidence: `README.md`)
- User → Background transfers: drags items (evidence: `README.md`)
- Background transfers → Local files: reads/writes (evidence: `README.md`)
- Background transfers → SSH server: uploads/downloads (evidence: `README.md`)
- User → File operations: manages files (evidence: `README.md`)
- User → Permissions editor: changes modes (evidence: `README.md`)
- User → SSH terminal: opens console (evidence: `README.md`)
- SSH terminal → SSH server: sends terminal input (evidence: `README.md`)
- User → Text editor: edits files (evidence: `README.md`)
- Text editor → SSH server: saves remote files (evidence: `README.md`)
- User → Favorites: manages favorites (evidence: `README.md`)
- Favorites → Saved passwords: stores passwords (evidence: `README.md`)
- Touch ID → Saved passwords: unlocks (evidence: `README.md`)
