OpenClawKit is a Swift-native SDK for building OpenClaw-style agents, channels, and app integrations on Apple platforms, with cross-platform runtime modules that also build for Linux services.
The repository currently ships:
- layered SwiftPM products for protocol, core runtime, gateway, agents, plugins, channels, memory, media, models, and skills
- an Apple-facing
OpenClawKitfacade for app integrations and an optionalOpenClawChatUISwiftUI surface - provider routing across direct OpenAI/Codex, OpenAI-compatible, Anthropic-compatible, Gemini, xAI, Bedrock, and local runtimes
- channel adapters, secret-aware config, session storage, diagnostics, replay, and security audit tooling
- a published Swift-DocC site plus CI, SwiftLint, and release automation
Current baseline:
- latest tagged release:
2026.2.4 - OpenClaw parity target: upstream
2026.3.13 - direct OpenAI and Codex-backed OpenAI paths run through
OpenAIKit 3.0.0 - public docs site: marcodotio.github.io/OpenClawKit
- Swift-DocC site: OpenClawKit Documentation
- Architecture notes: docs/architecture.md
- High-level SDK API index: docs/api-surface.md
- Testing and validation guide: docs/testing.md
Add the package with Swift Package Manager:
dependencies: [
.package(url: "https://github.com/MarcoDotIO/OpenClawKit.git", from: "2026.2.4")
]For Apple apps, most integrations should depend on OpenClawKit:
targets: [
.target(
name: "MyApp",
dependencies: [
.product(name: "OpenClawKit", package: "OpenClawKit")
]
)
]For Linux services or lower-level integrations, depend on the specific runtime products you need instead of the Apple-only facade.
import OpenClawKit
let sdk = OpenClawSDK.shared
let diagnostics = sdk.makeDiagnosticsPipeline(eventLimit: 500)
let reply = try await sdk.getReplyFromConfig(
config: OpenClawConfig(),
sessionStoreURL: URL(fileURLWithPath: "./state/sessions.json"),
inbound: InboundMessage(
channel: .webchat,
peerID: "user-1",
text: "Plan a concise project update."
),
diagnosticsPipeline: diagnostics
)
print(reply.text)
print(await diagnostics.usageSnapshot().runsCompleted)OpenClawProtocol: transport models, generated gateway/session schema, protocol constantsOpenClawCore: config, secrets, auth storage, diagnostics, replay, security, platform shimsOpenClawGateway: transport client, reconnect lifecycle, typed gateway flowsOpenClawAgents: embedded runtime orchestration, tools, streaming executionOpenClawPlugins: plugin hooks and service lifecycle integrationOpenClawChannels: channel adapters and auto-reply routingOpenClawMemory: conversation memory and indexing primitivesOpenClawMedia: attachment normalization, limits, and media handlingOpenClawModels: provider routing, auth resolution, OpenAIKit-backed OpenAI integrationsOpenClawSkills: skill discovery and JS/WASM execution
OpenClawKit: high-level SDK facade plus Apple app helpers such as gateway discovery, TLS pinning, device auth, and command surfacesOpenClawChatUI: optional SwiftUI chat components built on top ofOpenClawKit
- Swift tools:
6.2 - iOS:
17+ - macOS:
14+ - tvOS:
17+ - visionOS:
26+ - watchOS:
10+ - Linux: supported for the cross-platform runtime products
The repo includes example apps in Examples/iOS and Examples/tvOS. These are used in CI and are the best reference for end-to-end app integration, diagnostics surfaces, and local skill packaging.
For code or docs changes, this is the recommended local gate:
swift build -Xswiftc -warnings-as-errors
Scripts/lint-swift.sh
Scripts/check-networking-concurrency.sh
swift test
Scripts/build-docs-site.shIf you are touching Linux runtime behavior, run the Docker-backed Linux scripts from docs/testing.md before pushing.
Keep public-facing conceptual documentation in the DocC catalog under Sources/OpenClawKit/OpenClawKit.docc, and keep the markdown files in docs/ focused on stable SDK usage notes rather than release-history tracking.
If you are changing protocol models, sync them from the pinned upstream snapshot instead of hand-maintaining divergent copies.
OpenClawKit is released under the MIT License.
