Production-ready SwiftUI шаблон для macOS menu bar утилит с command palette, Settings и локальным demo dashboard.
Часть коллекции Apple Design Templates.
Шаблон подходит для desktop tools, timers, clipboard workflows, notes apps, system monitors и productivity utilities. Внутри есть MenuBarExtra, обычное Dock-visible окно, command palette, shortcuts, native Settings, Launch at Login через SMAppService, локальные demo data и понятная Swift Package архитектура.
- Reusable Swift Package
MacMenuBarCommandKit. - Запускаемый macOS demo app:
Examples/CommandKitDemo/CommandKitDemo.xcodeproj. - Menu bar dashboard с quick commands, статусом, поиском и локальными метриками.
CommandPaletteс arrow navigation, Return, Escape и focus restoration.- String-backed
CommandID, sync throwing handlers и явные success/failure results. - Native Settings scene с General, Appearance, Commands и About.
LaunchAtLoginServiceдляSMAppServiceсо статусами enabled, disabled, requires approval, unsupported и error.- Loaded, loading, empty и error состояния.
- Unit tests, GitHub Actions, issue templates, changelog и release checklist.
В demo есть 8 команд. Это не случайные кнопки, а компактный набор типовых действий для menu bar утилит:
| Команда | Что показывает | Видимый результат |
|---|---|---|
| New Note | Быстрый локальный capture | Добавляет item в inbox и activity |
| Start Timer | Focus/timer workflow | Включает focus state и увеличивает protected time |
| Capture Clipboard | Работу с pasteboard | Сохраняет скопированный текст в local state |
| Copy Status Report | Вывод в системный clipboard | Копирует текстовый отчет в macOS pasteboard |
| Clear Inbox | Batch cleanup action | Обнуляет inbox metric |
| Toggle Focus Mode | Stateful toggle | Меняет focus status и badges |
| Open Dashboard | Window navigation | Открывает main workspace |
| Open Settings | Native preferences | Открывает SwiftUI Settings scene |
open Examples/CommandKitDemo/CommandKitDemo.xcodeprojВыбери CommandKitDemo и запусти на My Mac.
Или через локальный script:
./script/build_and_run.sh
./script/build_and_run.sh --verifyОпредели app-owned CommandID, добавь CommandItem, затем зарегистрируй handler в app entry point:
registry.register(.copyStatusReport) { command in
try copyReport()
return .success("Готово: \(command.title)")
}Подробнее: Commands.
- Getting started
- Architecture
- Commands
- Migration 0.1.0 → 0.2.0
- Customization
- Accessibility
- Release checklist
swift test
xcodebuild -project Examples/CommandKitDemo/CommandKitDemo.xcodeproj -scheme CommandKitDemo -destination 'platform=macOS' CODE_SIGNING_ALLOWED=NO buildMIT.
