How rbc33/ghostbar works
Ghostbar is a native macOS menu-bar AI client whose floating chat window is excluded from screen capture. The main workflow is opening chat from the menu or global shortcut, entering a message (or attaching a screenshot), streaming a response from the configured model backend, and optionally recording voice for on-device transcription. Settings configure backends and shortcuts. The graph reflects excerpted calls and README-documented capabilities; dashed, uncited links mark relationships not verified in the sampled source.
Main entry points: WKWebViewWrapper.swift Web view bridge · AppDelegate.swift App delegate · GlobalHotKey.swift Global hotkey · ChatWindow.swift Chat window
Components 18
App and window UI
- App entry
Sources/Ghostbar/main.swift - App delegate
Sources/Ghostbar/App/AppDelegate.swift - Global hotkey
Sources/Ghostbar/App/GlobalHotKey.swift - Chat window
Sources/Ghostbar/UI/ChatWindow.swift - Movable window
Sources/Ghostbar/UI/MovableWindow.swift
Chat and model access
- Web view bridge
Sources/Ghostbar/WebView/WKWebViewWrapper.swift - Chat interface
Sources/Ghostbar/Resources/ChatHTML.swift - Stream delegate
Sources/Ghostbar/Streaming/StreamDelegate.swift - Stream parsers
Sources/Ghostbar/Streaming/StreamParsers.swift - Configured model backend
Voice and capture
- Audio recorder
Sources/Ghostbar/Services/AudioRecorder.swift - Voice transcription
Sources/Ghostbar/Services/Transcriber.swift - Screenshot capture
Sources/Ghostbar/Services/ScreenCapture.swift
Settings and shortcuts
- Backend config
Sources/Ghostbar/Config/BackendConfig.swift - Shortcut settings
Sources/Ghostbar/Config/RecordingShortcut.swift - Shortcut recorder
Sources/Ghostbar/UI/ShortcutRecorder.swift - Model picker
Sources/Ghostbar/UI/PrivateDropdown.swift
Other components
- User
Connections 22
- User → App entry: launches
README.md - App entry → App delegate: starts
Sources/Ghostbar/main.swift - App delegate → Chat window: opens
Sources/Ghostbar/App/AppDelegate.swift - App delegate → Global hotkey: registers
Sources/Ghostbar/App/AppDelegate.swift - Global hotkey → App delegate: toggles chat
Sources/Ghostbar/App/AppDelegate.swift - Chat window → Movable window: creates
Sources/Ghostbar/UI/ChatWindow.swift - Chat window → Web view bridge: hosts
Sources/Ghostbar/UI/ChatWindow.swift - Web view bridge → Chat interface: loads
Sources/Ghostbar/WebView/WKWebViewWrapper.swift - Web view bridge → Backend config: reads
Sources/Ghostbar/WebView/WKWebViewWrapper.swift - Web view bridge → Configured model backend: requests models and streams
README.md - Web view bridge → Stream delegate: creates
Sources/Ghostbar/WebView/WKWebViewWrapper.swift - Stream delegate → Stream parsers: parses events
- Stream delegate → Web view bridge: sends tokens
Sources/Ghostbar/Streaming/StreamDelegate.swift - App delegate → Backend config: configures
Sources/Ghostbar/App/AppDelegate.swift - App delegate → Model picker: uses model picker
Sources/Ghostbar/App/AppDelegate.swift - App delegate → Shortcut recorder: configures shortcuts
Sources/Ghostbar/App/AppDelegate.swift - Shortcut recorder → Shortcut settings: loads and saves
Sources/Ghostbar/UI/ShortcutRecorder.swift - Global hotkey → Shortcut settings: loads shortcut
Sources/Ghostbar/App/GlobalHotKey.swift - Web view bridge → Audio recorder: records audio
Sources/Ghostbar/WebView/WKWebViewWrapper.swift - Audio recorder → Voice transcription: provides recording
- Web view bridge → Screenshot capture: captures screenshot
- User → Web view bridge: sends chat or voice
README.md