How ozdadirri/port-show works
PortShow is a macOS menu-bar app for discovering listening ports and managing their owning processes. The workflow starts when the user opens the popover: AppState scans ports, applies filters and favorites, and the UI presents grouped rows with actions to open, copy, reveal, pin, or stop a process. Settings, launch-at-login, and pinned-port notifications are supporting capabilities. The graph follows excerpted calls and README-documented behavior; unsampled implementation details are represented only where documented.
Main entry points: AppState.swift App state · PortScanner.swift Port scanner · main.swift Menu-bar app · PopoverViewController.swift Port popover
Components 20
App and UI
- Menu-bar app
Sources/main.swift - Port popover
Sources/PopoverViewController.swift - Port row actions
Sources/PortRowView.swift
Port discovery
- Port entry model
Sources/PortEntry.swift - Port scanner
Sources/PortScanner.swift
State and preferences
- App state
Sources/AppState.swift - Pinned ports
Sources/FavoritesStore.swift - App preferences
Sources/AppState.swift
macOS integrations
- Launch-at-login
Sources/LoginItemManager.swift - Port notifications
Sources/NotificationManager.swift - Workspace actions
Sources/NSWorkspaceHelper.swift
Other components
- Mac user
- Socket/process data
- User LaunchAgent
- launchctl
- macOS notifications
- Default browser
- Finder
- Pasteboard
- Owned process
Connections 24
- Mac user → Menu-bar app: opens popover
Sources/main.swift - Menu-bar app → App state: starts and refreshes
Sources/main.swift - Menu-bar app → Port popover: shows
Sources/main.swift - Port popover → App state: reads settings and entries
Sources/PopoverViewController.swift - Port popover → Port row actions: creates and configures
Sources/PopoverViewController.swift - Port row actions → App state: invokes row actions
Sources/PopoverViewController.swift - App state → Port scanner: requests scan
Sources/AppState.swift - Port scanner → Socket/process data: reads socket data
Sources/PortScanner.swift - Port scanner → Port entry model: produces entries
Sources/PortScanner.swift - App state → Port entry model: filters and groups
Sources/AppState.swift - App state → Pinned ports: checks and toggles pins
Sources/AppState.swift - Pinned ports → App preferences: persists favorites
Sources/FavoritesStore.swift - App state → App preferences: persists settings
Sources/AppState.swift - App state → Launch-at-login: toggles login launch
Sources/AppState.swift - Launch-at-login → User LaunchAgent: writes or removes
Sources/LoginItemManager.swift - Launch-at-login → launchctl: loads or unloads
Sources/LoginItemManager.swift - App state → Port notifications: requests and sends
Sources/AppState.swift - Port notifications → macOS notifications: posts alerts
Sources/NotificationManager.swift - App state → Workspace actions: opens and copies
Sources/AppState.swift - Workspace actions → Default browser: opens port URL
Sources/NSWorkspaceHelper.swift - Workspace actions → Pasteboard: copies text
Sources/NSWorkspaceHelper.swift - App state → Port scanner: kills or reveals process
Sources/AppState.swift - Port scanner → Finder: reveals start file
README.md - Port scanner → Owned process: sends SIGTERM
README.md