How thiago-pedroso/legato works
Legato is a macOS menu-bar voice-dictation app. The main workflow is: a user holds the dictation key, audio is recorded and saved, a local or API speech engine transcribes it, optional cleanup and vocabulary/replacement correction shape the text, and the result is typed into the target app. Settings, history/retry, vocabulary suggestions, and learning from user corrections are additional product capabilities. Some subsystem links are omitted where the excerpts show no invocation; the graph uses README statements for documented behavior.
Main entry points: Controller.swift Dictation controller · SettingsView.swift Settings window · App.swift App lifecycle · HistoryStore.swift Dictation history
Components 23
Capture and control
- Dictation controller
Sources/Legato/Controller.swift - Hotkey monitor
Sources/Legato/Hotkey.swift - Hotkey state
Sources/LegatoCore/HotkeyStateMachine.swift - Audio recorder
Sources/Legato/Recorder.swift - Audio devices
Sources/Legato/AudioDevices.swift
Speech and text
- Speech engines
Sources/Legato/Engines.swift - On-device cleanup
Sources/Legato/OnDeviceCleanup.swift - Text processing
Sources/LegatoCore/TextProcessor.swift - Language check
Sources/LegatoCore/LanguageCheck.swift - WAV encoding
Sources/LegatoCore/WAV.swift
Vocabulary and learning
- Correction watcher
Sources/Legato/CorrectionWatcher.swift - Correction rules
Sources/LegatoCore/Corrections.swift - Vocabulary tools
Sources/Legato/Vocab.swift - Vocabulary mining
Sources/LegatoCore/VocabularyMining.swift - Command-line tools
Sources/Legato/CLI.swift
App and persistence
- App lifecycle
Sources/Legato/App.swift - Dictation history
Sources/LegatoCore/HistoryStore.swift - Settings model
Sources/LegatoCore/Settings.swift - Settings window
Sources/Legato/SettingsView.swift - Status pill
Sources/Legato/Pill.swift - App assets
Sources/Legato/Assets.swift - Visual theme
Sources/Legato/Theme.swift
Other components
- Mac user
Connections 28
- Mac user → Hotkey monitor: holds key
README.md - Hotkey monitor → Dictation controller: signals key
- Dictation controller → Hotkey state: updates state
Sources/Legato/Controller.swift - Dictation controller → Audio recorder: starts recording
Sources/Legato/Controller.swift - Dictation controller → Audio devices: selects input
Sources/Legato/Controller.swift - Dictation controller → Speech engines: transcribes audio
Sources/Legato/Controller.swift - Dictation controller → On-device cleanup: cleans transcript
Sources/Legato/Controller.swift - Dictation controller → Text processing: processes text
Sources/Legato/Controller.swift - Dictation controller → Language check: checks transcript
Sources/Legato/Controller.swift - Dictation controller → Dictation history: saves dictation
Sources/Legato/Controller.swift - Dictation history → WAV encoding: encodes audio
Sources/LegatoCore/HistoryStore.swift - Dictation controller → Correction watcher: watches typed text
Sources/Legato/Controller.swift - Correction watcher → Correction rules: uses corrections
Sources/Legato/CorrectionWatcher.swift - App lifecycle → Dictation controller: creates controller
Sources/Legato/App.swift - App lifecycle → Settings window: opens window
Sources/Legato/App.swift - Settings window → Dictation controller: configures dictation
Sources/Legato/SettingsView.swift - Dictation controller → Settings model: reads preferences
Sources/Legato/Controller.swift - Settings window → Audio devices: lists devices
Sources/Legato/SettingsView.swift - Mac user → Settings window: configures app
README.md - Dictation controller → Status pill: shows status
- Status pill → Visual theme: uses styling
Sources/Legato/Pill.swift - Settings window → Visual theme: uses styling
Sources/Legato/SettingsView.swift - App lifecycle → App assets: uses assets
Sources/Legato/App.swift - Mac user → Dictation history: reviews recordings
README.md - Mac user → Vocabulary tools: requests suggestions
README.md - Vocabulary tools → Vocabulary mining: mines project terms
Sources/Legato/Vocab.swift - Mac user → Command-line tools: runs commands
README.md - Dictation controller → Speech engines: prepares vocabulary
Sources/Legato/Controller.swift