A native macOS UI + foundation kit, built entirely in Swift.
An animated "Aurora + Liquid Glass" design system, a zero-API-key AI layer that
drives the user's local claude/codex CLI, and the plumbing every macOS app
re-implements — preferences, Keychain, subprocess running.
SwiftUI · macOS 14+ · Swift 6.2 · zero third-party dependencies
Most native Mac apps re-implement the same things: a themeable look, secret storage, a preferences wrapper, "shell out to a tool on the user's PATH." And "call an LLM" usually means shipping an API key and burning tokens.
CortexKit packages all of that:
- A cohesive design system — animated Aurora background, Liquid Glass cards
with cursor parallax, a 5-theme accent palette, shimmer titles, status dots,
staggered entrances — that you adopt with a single
configurecall. - An AI layer with no API keys — it runs whatever AI CLI the user already
has authenticated (
claude/codex), so there's no token cost and nothing to manage. - Plumbing done once and tested — namespaced preferences, service-scoped
Keychain, and robust
PATHresolution for launching CLIs from a sandboxed, Finder-launched.app.
It's a versioned Swift package: drop it in, and the next app — yours or anyone else's — starts from a polished baseline.
CortexKit is four modules behind one umbrella, so a consumer takes only what
it needs (a CLI tool can pull CortexAI with no SwiftUI link cost):
| Module | Contents |
|---|---|
| CortexUI | Brand + BrandConfig (the injection seam), AccentTheme (Violet/Ocean/Sunset/Forest/Graphite), AuroraBackground, Liquid Glass (liquidGlass, GlassCard), ShimmerText, StatusDot, LogoMark, cascade, GradientButtonStyle/PressableStyle, Animation.cortex springs |
| CortexAI | AICLI (claude/codex), AIProvider (detect / resolve / run via the user's CLI), AIText (strip fences, first-line, truncate) |
| CortexInfra | PrefsStore (namespaced UserDefaults), Keychain (service-scoped), ShellRunner (PATH resolution + subprocess) — no UI |
| CortexHelpers | ToastCenter + .toasts(), MarkdownText, JSONHighlighter, SearchHighlight, SkeletonRow/SkeletonList |
import CortexKit re-exports all four.
In your app's Package.swift:
dependencies: [
.package(url: "https://github.com/rafaelaugustos/cortex-kit", from: "0.1.0"),
],
targets: [
.executableTarget(
name: "MyApp",
dependencies: [
.product(name: "CortexKit", package: "cortex-kit"),
// …or pick granular products:
// .product(name: "CortexUI", package: "cortex-kit"),
]
)
]Requires macOS 14+ and the Swift 6.2 toolchain.
Liquid Glass is macOS 26 only, so .liquidGlass() falls back to
.ultraThinMaterial below 26 — the nearest thing the system has, and a real
vibrancy-backed translucency rather than a flat fill. Nothing else in the kit
needs 26.
Configure once at launch — this installs your app's namespace (for preferences and the accent theme) and logo into the shared identity:
import SwiftUI
import CortexKit
@main
struct MyApp: App {
init() {
// Returns a PrefsStore you can reuse for your own settings + AIProvider.
_ = CortexKit.configure(
namespace: "mynewapp",
logo: NSImage(named: "AppIcon"),
fallbackSymbol: "sparkles"
)
}
var body: some Scene {
WindowGroup {
ContentView()
}
}
}Then build UI with the kit's vocabulary:
struct ContentView: View {
@StateObject private var toasts = ToastCenter()
var body: some View {
ZStack {
AuroraBackground() // the animated brand backdrop
VStack(spacing: 20) {
ShimmerText("My New App")
GlassCard { // Liquid Glass + cursor parallax
HStack {
StatusDot(color: .green)
Text("Ready")
}
}
Button("Do the thing") { toasts.success("Done") }
.buttonStyle(.gradient)
}
.cascade(delay: 0.05) // staggered entrance
}
.toasts(toasts)
}
}No API keys — it shells out to whatever the user already has on PATH:
let prefs = CortexKit.configure(namespace: "mynewapp") // also returns the store
let ai = AIProvider(prefs: prefs)
if let cli = await ai.resolveBackend() { // honours a user-pinned backend
let answer = try await ai.run(prompt: "Summarize this diff…", cli: cli)
let clean = AIText.firstMeaningfulLine(answer)
}
// Or in one call (auto-detects, throws .noProvider if none installed):
let reply = try await ai.run(prompt: "…")let keychain = Keychain(service: "mynewapp.tokens")
keychain.set(token, for: accountID) // also accepts a UUID
let token = keychain.get(accountID)Brandis configured, not hard-coded. Nothing about the theme or logo is baked into the package: each app provides its preference namespace + logo viaBrand.configure(or theCortexKit.configureshortcut).BrandConfigis the injection seam — so the package never reads another app'sUserDefaultskeys or bundles an icon. Until configured,Brandfalls back to a sensible default (Violet, SF Symbol logo) so previews and tests just work.- Robust AI CLI resolution.
AIProviderresolves the binary through an interactive login shell and a scan of common install dirs (Homebrew, nvm,~/.local/bin, …), so it findsclaude/codexeven when the app launched from Finder with a bare environment — and honours a user-pinned backend before falling back to auto-detection. - Performance is built in.
AuroraBackgroundthrottles from 60→10fps when the app loses focus (same look, far less idle CPU/GPU).NoiseOverlayuses a seeded PRNG so the speckle is computed deterministically, not re-randomised per frame.JSONHighlighteris a single hand-rolled pass that tolerates partial JSON.ShellRunnerdrains stderr concurrently so a full pipe can't deadlock. - Granular link cost. Need only the AI layer?
import CortexAIand you don't link SwiftUI.CortexInfrahas no dependencies at all.
CortexKit (umbrella, @_exported)
├─ CortexUI ───────┐
│ └─ CortexInfra │
├─ CortexAI │
│ └─ CortexInfra │
├─ CortexInfra ◄───┘ (no dependencies)
└─ CortexHelpers
└─ CortexUI
swift build
swift test16 unit tests cover the pure logic (AIText, AICLI argv, PrefsStore
namespacing/round-trips). The UI and process layers are exercised by the
consuming apps.
See API.md for the full public surface.
TBD.