How fujacob/cotabby works
Cotabby is a macOS-wide, local-first autocomplete app. Its main workflow observes typing and the focused field, builds a contextual suggestion request, routes generation to the selected engine, then presents ghost text for wordwise acceptance or dismissal. Separate inline features provide emoji completion and macros; settings cover engines and model downloads, while optional screen context and spelling support enrich writing assistance. README documents these capabilities; sampled runtime source confirms engine routing and backend adaptation, but coordinator wiring is not fully shown in the excerpts.
Main entry points: SuggestionCoordinator.swift Suggestion coordinator · SuggestionEngineRouter.swift Engine router · LlamaSuggestionEngine.swift Open-source engine · OpenAICompatibleSuggestionEngine.swift Compatible endpoint engine
Components 26
App workflow
- Input monitoring
Cotabby/Services/Input/InputMonitor.swift - Suggestion coordinator
Cotabby/App/Coordinators/Suggestion/SuggestionCoordinator.swift - Suggestion presentation
Cotabby/Services/Suggestion/SuggestionOverlayPresenter.swift - Ghost-text overlay
Cotabby/UI/Overlays/SuggestionOverlayViews.swift - Suggestion insertion
Cotabby/Services/Suggestion/SuggestionInserter.swift
Suggestion runtime
- Suggestion request
Cotabby/Support/Suggestion/Request/SuggestionRequestFactory.swift - Engine router
Cotabby/Services/Runtime/SuggestionEngineRouter.swift - Apple Intelligence
Cotabby/Services/Runtime/AppleIntelligence/FoundationModelSuggestionEngine.swift - Open-source engine
Cotabby/Services/Runtime/Llama/LlamaSuggestionEngine.swift - Local model runtime
Cotabby/Services/Runtime/Llama/LlamaRuntimeManager.swift - Compatible endpoint engine
Cotabby/Services/Runtime/OpenAICompatible/OpenAICompatibleSuggestionEngine.swift
Inline features
- Emoji completion
Cotabby/App/Coordinators/InlineFeatures/EmojiPickerController.swift - Emoji picker
Cotabby/UI/InlineFeatures/EmojiPickerView.swift - Inline macros
Cotabby/App/Coordinators/InlineFeatures/MacroController.swift - Macro evaluation
Cotabby/Support/Macros/MacroEngine.swift
Context and focus
- Focus tracking
Cotabby/Services/Focus/FocusTracker.swift - Screen context
Cotabby/Services/Visual/VisualContextCoordinator.swift - Clipboard context
Cotabby/Services/Context/ClipboardContextProvider.swift - Spelling correction
Cotabby/Services/Spelling/CurrentWordSpellChecker.swift
Settings and models
- Settings UI
Cotabby/UI/Settings/SettingsContainerView.swift - Suggestion settings
Cotabby/Models/Settings/SuggestionSettingsModel.swift - Model management
Cotabby/Services/ModelManagement/ModelDownloadManager.swift
Other components
- Mac user
- Focused text field
- Configured endpoint
- Hugging Face
Connections 31
- Mac user → Focused text field: types in
- Input monitoring → Suggestion coordinator: signals typing
- Suggestion coordinator → Focus tracking: reads focus
- Focus tracking → Focused text field: inspects field
- Suggestion coordinator → Screen context: requests context
- Suggestion coordinator → Clipboard context: requests context
- Suggestion coordinator → Suggestion request: builds request
- Suggestion request → Engine router: submits request
- Engine router → Apple Intelligence: routes generation
- Engine router → Open-source engine: routes generation
- Engine router → Compatible endpoint engine: routes generation
- Open-source engine → Local model runtime: generates locally
- Compatible endpoint engine → Configured endpoint: sends request
- Apple Intelligence → Engine router: returns result
- Open-source engine → Engine router: returns result
- Compatible endpoint engine → Engine router: returns result
- Engine router → Suggestion coordinator: returns result
- Suggestion coordinator → Suggestion presentation: presents suggestion
- Suggestion presentation → Ghost-text overlay: shows ghost text
- Mac user → Ghost-text overlay: accepts or dismisses
- Suggestion coordinator → Suggestion insertion: inserts accepted text
- Suggestion insertion → Focused text field: writes text
- Mac user → Emoji completion: enters emoji query
- Emoji completion → Emoji picker: presents picker
- Mac user → Inline macros: enters macro
- Inline macros → Macro evaluation: evaluates query
- Mac user → Settings UI: configures app
- Settings UI → Suggestion settings: updates preferences
- Settings UI → Model management: manages models
- Model management → Hugging Face: searches/downloads
- Suggestion coordinator → Spelling correction: checks current word