apfel
Command-line tool, chat mode and local OpenAI-compatible server for the on-device model in Apple's FoundationModels framework. Needs macOS 26 and Apple silicon.
View on GitHub ↗- Stars
- ★ 6,499
- Last commit
- 5 Oct 2026
- Maintenance
- Active
- Licence
- MIT
- Category
- Other
- GitHub
- Arthur-Ficial/apfel
Overview
apfel is a command-line tool that gives you access to the AI model already on your Mac through Apple Intelligence, at no cost. You can use it as a UNIX tool in shell scripts, run it as an OpenAI-compatible local server or chat with it in a small REPL. It can read files, PDFs and images you attach to a prompt.
Features
- Single prompts, streaming output and piped input
- Attach text files, PDFs and images, with on-device text extraction and OCR
- Code-only output, JSON output and schema-valid JSON through guided generation
- Token counting before large prompts
- OpenAI-compatible server on localhost, which can run in the background with brew services
- apfel --chat REPL for testing prompts or MCP servers
Requirements
- macOS 26 Tahoe or later
- Apple silicon (M1 or later)
- Apple Intelligence turned on
- To build from source: Command Line Tools with the macOS 26.4 SDK and Swift 6.3
Install
Install with Homebrew
brew install apfel
Example
Pipe a diff in for a quick review: git diff HEAD~1 | apfel -f CONVENTIONS.md "Review this diff against our conventions".
Works with
Listed in
Read the code before you install anything. SwiftAgents doesn't review or endorse the tools listed here. Active: a commit in the last 90 days. Slowing: last commit within the past year. Stale: older than a year, or archived.
More in this category
MCP Swift SDK
The official Swift SDK for building MCP clients and servers.
iCTRL
Runs a long-lived XCUITest on a real iPhone and exposes an HTTP API so agents can tap, type, read the UI and take screenshots. Meant for testing on your own devices.
asc-cli
Swift command-line tool for App Store Connect (builds, TestFlight, subscriptions, screenshots), with JSON output made for agents.