This guide walks you through embedding OpenClicky’s full AI runtime into your own macOS SwiftUI app. By the end you will have a workingDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/jasonkneen/openclicky/llms.txt
Use this file to discover all available pages before exploring further.
OpenClickySDKSession presenting the conversation panel as a sheet, with voice, agent mode, and TTS fully operational.
OpenClicky is a source-level integration — you add its Swift files and resources directly to your host app target. There is no Swift Package Manager product yet.
Add source files to your host target
In Xcode, add the Swift sources from the OpenClicky repository to your host app target.Required files:
cursor-buddy/OpenClickySDK.swift— the public SDK entry pointcursor-buddy/CompanionManager.swift— the central runtime state managercursor-buddy/CompanionPanelView.swift— the SwiftUI panel view- All other
.swiftfiles incursor-buddy/that are depended on by the above (including Codex/agent managers, model managers, overlay managers, settings managers, and dictation managers)
cursor-buddy/*.swift folder and exclude only:cursor-buddy/cursor_buddyApp.swift— this is the menu-bar app’s@mainentry point and will conflict with your host app’s entry point
Bundle resources into your host app
OpenClicky loads several resource files from
Add a Run Script build phase to your target that copies these resources into the built bundle:Adjust
Bundle.main at runtime. You must copy these into your host app bundle at the resource root (not inside a subdirectory).Required resources:| Resource | Purpose |
|---|---|
SOUL.md | OpenClicky’s persona and behavioral instructions |
OpenClickyModelInstructions.md | Model system prompt supplement |
AGENTS.md | Agent mode configuration |
OpenClickyBundledSkills/ | Built-in skill definitions |
OpenClickyBundledWikiSeed/ | Bundled knowledge base seed |
CodexRuntime/ | Codex agent runtime files (required for Agent Mode) |
ClaudeAgentSDKBridge/ | Claude Agent SDK bridge (required for local Claude auth) |
agent-done.mp3 | Completion chime audio |
If you are not using Agent Mode, you can still start the runtime and test text prompts — but
CodexRuntime and related assets are required for Codex-backed agent workflows.ROOT to wherever you store the OpenClicky resources relative to your project.Add privacy keys to Info.plist
OpenClicky requires several macOS privacy usage descriptions. Add these keys to your host app’s You should also ensure your app’s entitlements and capabilities allow access to:
Info.plist:com.apple.security.network.client— for API requests to Claude, ElevenLabs, Cartesia, and Deepgramcom.apple.security.device.microphone— for voice capturecom.apple.security.device.audio-input— for AVFoundation microphone access- ScreenCaptureKit access via the macOS privacy prompt (triggered at runtime by OpenClicky)
Launch and embed in SwiftUI
The preferred pattern uses Recommended host runtime wrapper (App scene and ContentView:Using AppKit (
@StateObject to own the session at your view or scene level, starts the runtime on .onAppear, and presents the panel as a .sheet.Minimal host view:OpenClickyHostRuntime.swift):For larger apps, extract the SDK session into its own ObservableObject and inject it via .environmentObject:NSWindow) instead of .sheet?- Keep one persistent
OpenClickySDKSessionat a controller level. - Create an
NSHostingView(rootView:)fromruntime.makePanel(...). - Present and close that hosting view in your normal host window flow.
- Still call
OpenClickySDKSession.start()once at app launch andstop()on app shutdown.
Wire API keys
Once the runtime is started, set your API keys. OpenClicky persists these through the same code paths as the native app:These setters update existing OpenClicky code paths and persist the keys the same way the native app does. You do not need to restart the session after setting keys.Sending prompts programmatically:Checking runtime state:Logging:OpenClicky writes structured request logs to:Filter on
openclicky.request.completed to validate completions and cancellations during development.Known Limitations
- This is a source-level SDK path, not yet a dedicated SPM product.
- Your host app may receive permission re-prompts when features like microphone or screen capture are first used.
- In embedded mode, global push-to-talk, overlay auto-show, and onboarding tied to menu-bar state are all disabled by design.
- The
CodexRuntimeandClaudeAgentSDKBridgeresources are required for Agent Mode and local Claude auth respectively. Text-only voice responses work without them if an Anthropic API key is configured.