Skip to content

Instantly share code, notes, and snippets.

@eonist
Created December 28, 2025 12:13
Show Gist options
  • Select an option

  • Save eonist/99e24be368ce8db6b8e7b5b32cf4901b to your computer and use it in GitHub Desktop.

Select an option

Save eonist/99e24be368ce8db6b8e7b5b32cf4901b to your computer and use it in GitHub Desktop.
apple intelligence and appkit in go

For a terminal binary executable app in Go, you do not need AppKit unless you're building GUI elements. AppKit is macOS's graphical user interface framework, which is unnecessary for command-line applications.[1][2][3]

Accessing AppKit from Go (if needed)

If you do need AppKit for some reason, Go can access it through bindings like DarwinKit (formerly MacDriver), which provides native Mac API access. DarwinKit offers bindings for 33 frameworks including AppKit, with over 2,353 classes and 23,822 methods. It works by wrapping Objective-C runtime calls in Go APIs, allowing you to write native macOS code without CGO in many cases.[2][4][1]

Apple Intelligence API Access

Apple Intelligence and the Foundation Models framework are currently primarily accessible through Swift. The Foundation Models framework provides on-device access to Apple's LLMs with as few as three lines of Swift code. There's no official Go API for Apple Intelligence yet.[5][6][7]

Workarounds for Go

If you need Apple Intelligence in a Go terminal app, you could:

  • Build a Swift wrapper that exposes the functionality via a local API/IPC and call it from Go[8]
  • Use the Go terminal app without AI features and rely on external APIs instead[9][10]
  • Wait for community bindings (though DarwinKit focuses on UI frameworks currently)[2]

For a pure terminal app without GUI or Apple Intelligence features, standard Go with the os and flag packages is sufficient.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

@eonist
Copy link
Author

eonist commented Dec 28, 2025

TypeScript with Bun is fully cross-platform on Windows, Linux, and macOS as of Bun v1.1, which passes 98% of tests across all three platforms. The Bun shell works as a multi-platform shell eliminating the need for platform-specific commands.[1][2]

GUI Popup Solutions

For basic UI window popups from a terminal app, you have several options:

Electron/Tauri: Build your TypeScript terminal app as an Electron or Tauri app, which gives you native window popup capabilities and works cross-platform. This is the most common approach for terminal apps needing occasional GUI elements.

Native dialog commands: Call platform-specific native dialogs from TypeScript:

  • macOS: osascript for AppleScript dialogs
  • Linux: zenity or kdialog
  • Windows: PowerShell dialogs

These can be executed via Bun's shell or Node's child_process, but require different commands per platform.

Terminal UI libraries: Libraries like console-gui-tools provide popup-style interfaces within the terminal itself (not native windows). This works cross-platform but stays in the terminal.[3]

Apple Intelligence API Access

There's a TypeScript wrapper available: @meridius-labs/apple-on-device-ai provides TypeScript library access to Apple's on-device foundation models with full Vercel AI SDK compatibility. It supports both streaming and non-streaming text generation directly from TypeScript.[4]

Additionally, someone built a web API wrapper that mimics the OpenAI API format, allowing Apple Intelligence access from any language including JavaScript/TypeScript by simply changing the API URL. This runs a Swift server locally that exposes Apple's Foundation Models via HTTP.[5]

Limitation: Both solutions still require running on Apple Silicon macOS, as Apple Intelligence only works on those devices.[5]

1
2
3
4
5
6
7
8
9
10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment