# jacklandrin/onlyswitch architecture

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

- Interactive diagram: https://gitdiagram.com/jacklandrin/onlyswitch
- Repository: https://github.com/jacklandrin/onlyswitch

## Overview

OnlySwitch is a macOS menu-bar utility that brings system toggles and related tools into one customizable interface. The main workflow is opening the menu-bar controls, choosing a switch or shortcut, and invoking its associated behavior; the README also documents keyboard shortcuts, widgets, an alternate Only Control appearance, and an optional desktop pet. Major branches include audio playback, system monitoring, AI-agent tools, and iOS remote control. The graph uses documented capabilities and the sampled manager, status-bar, player, pet, and remote-demo code; unsampled subsystem wiring is left out where uncertain.

Main entry points: [`OnlySwitch/Features/RemoteAccess/Host/RemoteHost.swift`](https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/Features/RemoteAccess/Host/RemoteHost.swift) (Remote Host), [`OnlySwitch/Features/OnlySwitchList/OnlySwitchListView.swift`](https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/Features/OnlySwitchList/OnlySwitchListView.swift) (Switch List), [`OnlySwitch/Features/Settings/SettingsView/SettingsView.swift`](https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/Features/Settings/SettingsView/SettingsView.swift) (Settings), [`OnlySwitch/StatusBar/StatusBarController.swift`](https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/StatusBar/StatusBarController.swift) (Status Bar)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Menu Bar Access"]
  node_statusbar["Status Bar"]
  node_switchlist["Switch List"]
  node_onlycontrol["Only Control"]
  node_pet["Desktop Pet"]
end

subgraph group_switches["Switches And Items"]
  node_shortcuts["Shortcuts Items"]
  node_registry["Switch Manager"]
  node_switchimpl["Switch Implementations<br/>[SwitchType++.swift]"]
  node_switchbar["Switch Bar"]
end

subgraph group_settings["Configuration"]
  node_settingsui["Settings<br/>[SettingsView.swift]"]
  node_customize["List Customization"]
  node_evolution["Evolution Gallery"]
end

subgraph group_tools["App Tools"]
  node_audio["Audio Playback"]
  node_systemmonitor["System Monitor"]
  node_agent["Only Agent<br/>[AgentCommand.swift]"]
  node_authenticator["Authenticator"]
end

subgraph group_remote["Remote Access"]
  node_remoteui["Remote Settings"]
  node_remotehost["Remote Host<br/>[RemoteHost.swift]"]
  node_remoterouter["Command Router"]
  node_remotecatalog["Control Catalog"]
  node_remoteprotocol["Remote Protocol"]
  node_transport["Remote Transport"]
end

node_user(("Mac User"))
node_ios(("OnlyRemote Device"))

node_user -->|"opens"| node_statusbar
node_statusbar -->|"shows controls"| node_switchlist
node_user -->|"selects item"| node_switchlist
node_user -->|"opens appearance"| node_onlycontrol
node_user -->|"uses companion"| node_pet
node_pet -->|"opens controls"| node_onlycontrol
node_switchlist -->|"gets items"| node_registry
node_registry -->|"registers"| node_switchimpl
node_switchlist -->|"presents switches"| node_switchbar
node_user -->|"runs shortcut"| node_shortcuts
node_user -->|"configures app"| node_settingsui
node_settingsui -->|"opens customization"| node_customize
node_settingsui -->|"opens gallery"| node_evolution
node_user -->|"controls playback"| node_audio
node_user -->|"views metrics"| node_systemmonitor
node_user -->|"uses agent"| node_agent
node_user -->|"uses codes"| node_authenticator
node_user -->|"enables remote"| node_remoteui
node_ios -->|"connects over LAN"| node_remotehost
node_remotehost -->|"publishes controls"| node_remotecatalog
node_remotehost -->|"routes commands"| node_remoterouter
node_remoterouter -->|"uses messages"| node_remoteprotocol
node_remotehost -->|"exchanges messages"| node_remoteprotocol
node_remotehost -->|"uses connection I/O"| node_transport

click node_statusbar "https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/StatusBar/StatusBarController.swift"
click node_switchlist "https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/Features/OnlySwitchList/OnlySwitchListView.swift"
click node_onlycontrol "https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/Features/OnlyControl/OnlyControlView.swift"
click node_pet "https://github.com/jacklandrin/onlyswitch/blob/main/Modules/Sources/DesktopPet/DesktopPetController.swift"
click node_shortcuts "https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/Features/SwitchItem/ShortcutsItem/ShortcutsBarView.swift"
click node_registry "https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/EverySwitch/SwitchManager.swift"
click node_switchimpl "https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/EverySwitch/SwitchType%2B%2B.swift"
click node_switchbar "https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/Features/SwitchItem/SwitchBar/SwitchBarView.swift"
click node_settingsui "https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/Features/Settings/SettingsView/SettingsView.swift"
click node_customize "https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/Features/Settings/Customize/CustomizeView.swift"
click node_evolution "https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/Features/Settings/Evolution/EvolutionGallery/EvolutionGalleryView.swift"
click node_audio "https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/Player/CommonPlayer/PlayerManager.swift"
click node_systemmonitor "https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/Features/SystemMonitor/SystemMonitorStatusItemController.swift"
click node_agent "https://github.com/jacklandrin/onlyswitch/blob/main/Modules/Sources/OnlyAgent/AgentCommand.swift"
click node_authenticator "https://github.com/jacklandrin/onlyswitch/blob/main/Modules/Sources/Authenticator/AuthenticatorStore.swift"
click node_remoteui "https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/Features/RemoteAccess/Settings/RemoteAccessSettingsView.swift"
click node_remotehost "https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/Features/RemoteAccess/Host/RemoteHost.swift"
click node_remoterouter "https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/Features/RemoteAccess/Commands/RemoteCommandRouter.swift"
click node_remotecatalog "https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/Features/RemoteAccess/Catalog/RemoteCatalogProvider.swift"
click node_remoteprotocol "https://github.com/jacklandrin/onlyswitch/blob/main/Modules/Sources/RemoteCore/RemoteMessage.swift"
click node_transport "https://github.com/jacklandrin/onlyswitch/blob/main/Modules/Sources/RemoteTransport/RemoteConnectionIO.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_statusbar,node_switchlist,node_onlycontrol,node_pet,node_user toneBlue
class node_shortcuts,node_registry,node_switchimpl,node_switchbar toneAmber
class node_settingsui,node_customize,node_evolution toneMint
class node_audio,node_systemmonitor,node_agent,node_authenticator toneRose
class node_remoteui,node_remotehost,node_remoterouter,node_remotecatalog,node_remoteprotocol,node_transport,node_ios toneIndigo
```

## Components

### Menu Bar Access

- [Status Bar](https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/StatusBar/StatusBarController.swift): `OnlySwitch/StatusBar/StatusBarController.swift`
- [Switch List](https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/Features/OnlySwitchList/OnlySwitchListView.swift): `OnlySwitch/Features/OnlySwitchList/OnlySwitchListView.swift`
- [Only Control](https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/Features/OnlyControl/OnlyControlView.swift): `OnlySwitch/Features/OnlyControl/OnlyControlView.swift`
- [Desktop Pet](https://github.com/jacklandrin/onlyswitch/blob/main/Modules/Sources/DesktopPet/DesktopPetController.swift): `Modules/Sources/DesktopPet/DesktopPetController.swift`

### Switches And Items

- [Shortcuts Items](https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/Features/SwitchItem/ShortcutsItem/ShortcutsBarView.swift): `OnlySwitch/Features/SwitchItem/ShortcutsItem/ShortcutsBarView.swift`
- [Switch Manager](https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/EverySwitch/SwitchManager.swift): `OnlySwitch/EverySwitch/SwitchManager.swift`
- [Switch Implementations](https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/EverySwitch/SwitchType%2B%2B.swift): `OnlySwitch/EverySwitch/SwitchType++.swift`
- [Switch Bar](https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/Features/SwitchItem/SwitchBar/SwitchBarView.swift): `OnlySwitch/Features/SwitchItem/SwitchBar/SwitchBarView.swift`

### Configuration

- [Settings](https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/Features/Settings/SettingsView/SettingsView.swift): `OnlySwitch/Features/Settings/SettingsView/SettingsView.swift`
- [List Customization](https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/Features/Settings/Customize/CustomizeView.swift): `OnlySwitch/Features/Settings/Customize/CustomizeView.swift`
- [Evolution Gallery](https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/Features/Settings/Evolution/EvolutionGallery/EvolutionGalleryView.swift): `OnlySwitch/Features/Settings/Evolution/EvolutionGallery/EvolutionGalleryView.swift`

### App Tools

- [Audio Playback](https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/Player/CommonPlayer/PlayerManager.swift): `OnlySwitch/Player/CommonPlayer/PlayerManager.swift`
- [System Monitor](https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/Features/SystemMonitor/SystemMonitorStatusItemController.swift): `OnlySwitch/Features/SystemMonitor/SystemMonitorStatusItemController.swift`
- [Only Agent](https://github.com/jacklandrin/onlyswitch/blob/main/Modules/Sources/OnlyAgent/AgentCommand.swift): `Modules/Sources/OnlyAgent/AgentCommand.swift`
- [Authenticator](https://github.com/jacklandrin/onlyswitch/blob/main/Modules/Sources/Authenticator/AuthenticatorStore.swift): `Modules/Sources/Authenticator/AuthenticatorStore.swift`

### Remote Access

- [Remote Settings](https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/Features/RemoteAccess/Settings/RemoteAccessSettingsView.swift): `OnlySwitch/Features/RemoteAccess/Settings/RemoteAccessSettingsView.swift`
- [Remote Host](https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/Features/RemoteAccess/Host/RemoteHost.swift): `OnlySwitch/Features/RemoteAccess/Host/RemoteHost.swift`
- [Command Router](https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/Features/RemoteAccess/Commands/RemoteCommandRouter.swift): `OnlySwitch/Features/RemoteAccess/Commands/RemoteCommandRouter.swift`
- [Control Catalog](https://github.com/jacklandrin/onlyswitch/blob/main/OnlySwitch/Features/RemoteAccess/Catalog/RemoteCatalogProvider.swift): `OnlySwitch/Features/RemoteAccess/Catalog/RemoteCatalogProvider.swift`
- [Remote Protocol](https://github.com/jacklandrin/onlyswitch/blob/main/Modules/Sources/RemoteCore/RemoteMessage.swift): `Modules/Sources/RemoteCore/RemoteMessage.swift`
- [Remote Transport](https://github.com/jacklandrin/onlyswitch/blob/main/Modules/Sources/RemoteTransport/RemoteConnectionIO.swift): `Modules/Sources/RemoteTransport/RemoteConnectionIO.swift`

### Other components

- **Mac User**
- **OnlyRemote Device**

## Connections

- Mac User → Status Bar: opens
- Status Bar → Switch List: shows controls
- Mac User → Switch List: selects item
- Mac User → Only Control: opens appearance
- Mac User → Desktop Pet: uses companion
- Desktop Pet → Only Control: opens controls
- Switch List → Switch Manager: gets items
- Switch Manager → Switch Implementations: registers
- Switch List → Switch Bar: presents switches
- Mac User → Shortcuts Items: runs shortcut
- Mac User → Settings: configures app
- Settings → List Customization: opens customization
- Settings → Evolution Gallery: opens gallery
- Mac User → Audio Playback: controls playback
- Mac User → System Monitor: views metrics
- Mac User → Only Agent: uses agent
- Mac User → Authenticator: uses codes
- Mac User → Remote Settings: enables remote
- OnlyRemote Device → Remote Host: connects over LAN
- Remote Host → Control Catalog: publishes controls
- Remote Host → Command Router: routes commands
- Command Router → Remote Protocol: uses messages
- Remote Host → Remote Protocol: exchanges messages
- Remote Host → Remote Transport: uses connection I/O
