Open SourceAiBrowserKit
Swift Package · Swift · MIT

A browser your agent app doesn't have to build.

AiBrowserKit provides SwiftUI + WKWebView browser components for macOS agent applications. Embed a full multi-tab browser panel, pinned-site sidebar, bookmarks, JS console capture, and screenshot tooling — or pull in the WebKit primitives alone and build custom chrome around your own automation bridge.

$.package(url: "https://github.com/NerdSnipe-Inc/AiBrowserKit.git", from: "1.0.0")
0
Dependencies
macOS 26+
Full UI
MIT
License
What's inside

Multi-tab browser, out of the box

BrowserView + BrowserViewModel + BrowserTab give you a tab bar, load progress, and a smart URL bar — inject a shared BrowserEnvironment at app root and drop in BrowserView.

Bookmarks and pinned sites

A folder-tree bookmark system with JSONL persistence and a slide-out panel, plus a pinned-sites sidebar with groups, SF Symbols, favicons, auto-refresh, and localhost reachability checks.

Console capture

Intercepts console.log/info/warn/error/debug into a ring buffer, viewable in a detached panel or inline — useful for debugging pages an agent is driving.

Screenshot tooling

Visible-area snapshot or drag-select region, routed to clipboard, file, or a host clipboard callback (onAddToClipboard) that plugs screenshots straight into your app's own clipboard or memory pipeline.

Agent bridge mode

For apps that drive the browser via tools (browserNavigate, browserGetContent, browserExecute), skip BrowserView entirely — use WebViewFactory.makeWebView and register the active WKWebView with your own host controller.

No dependencies

Built entirely on system frameworks (SwiftUI, WebKit, AppKit) — nothing to resolve, nothing to audit beyond Apple's own frameworks.

Add to your Package.swift
Package
$.package(url: "https://github.com/NerdSnipe-Inc/AiBrowserKit.git", from: "1.0.0")
Target
$.target(name: "MyApp", dependencies: ["AiBrowserKit"])

The full browser UI (BrowserView, pinned sites, screenshots, console panel) is macOS-only. iOS and visionOS get the cross-platform WebKit primitives — WebViewFactory, WebViewRepresentable, WebViewState, BookmarkService — for building custom chrome.

Design

Two ways in: full UI, or just the primitives.

Apps that want a complete browser panel use BrowserView and BrowserEnvironment directly. Agent apps that already have their own automation bridge can use WebViewFactory and WebViewRepresentable alone and build custom chrome around them — both paths share the same underlying WebKit state.

Frequently asked

Does the full browser UI work on iOS?

No — BrowserView, the pinned-sites UI, screenshots, and the console panel are macOS-only (#if canImport(AppKit)). iOS and visionOS get the cross-platform WebKit primitives (WebViewFactory, BookmarkService, ConsoleLogView) for custom integrations.

What's the 'stealth injection' feature?

A document-start script that reduces automation fingerprinting when a web view is being driven by an agent — see the Security & Privacy section of the repo's README for details.

Can I lower the macOS 26 deployment target?

Yes — most APIs are standard WebKit/SwiftUI and work on earlier macOS versions. The default target matches Apple Intelligence / Tahoe SDK apps in the NerdSnipe stack; lower it in Package.swift if you need broader support.

Add a real browser to your agent app.

Drop in BrowserView for a complete multi-tab browser panel, or use the WebKit primitives alone to build custom chrome around your own automation bridge.