Apple has introduced a native command-line utility in macOS 27 that provides software developers with direct local access to the system's underlying Apple Foundation Models. Located at /usr/bin/fm, the new tool allows users to query, test, and integrate on-device artificial intelligence directly inside the Terminal application without relying on external cloud APIs or complex third-party runtimes.

The addition expands Apple's developer ecosystem by bridging the gap between high-level Swift app frameworks and shell-based command-line workflows. Developers can now execute zero-latency text generation, run structured data extraction scripts, and host localized API servers directly from Apple Silicon hardware running macOS 27 Golden Gate.

Local Foundation Models CLI Added to macOS 27 Terminal

With macOS 27, Apple introduced a dedicated command-line interface designed to streamline access to its on-device language models. Known simply as the fm tool, this utility allows developers to interact with the same localized generative models that drive system-wide features like Writing Tools and smart notifications.

The utility features several core subcommands tailored for local AI scripting and rapid prototyping:

  • fm respond: Generates immediate single-shot completions for specified prompt inputs.
  • fm chat: Initiates interactive, multi-turn conversational shell sessions with context persistence.
  • fm serve: Launches a local OpenAI-compatible REST server to connect local scripts and development environments seamlessly.
  • fm schema: Enforces structured JSON output generation adhering to precise schema definitions.
  • fm token-count: Provides token accounting to assist developers in optimizing prompt lengths and evaluating context window limits.

Key Capabilities and Hardware Requirements

The native fm tool runs locally on Apple Silicon Macs equipped with M1 processors or newer. Context window allocations dynamically scale depending on system memory configuration, providing up to 4,000 tokens on baseline 16GB machines and expanding up to 8,192 tokens on high-end hardware, such as systems equipped with M5 Pro chips.

To use the tool, users must ensure Apple Intelligence is enabled in System Settings and accept the CLI license terms via a administrator shell command (sudo fm license). While the primary execution target is the offline on-device engine, requests can optionally route to Apple's Private Cloud Compute infrastructure when specialized entitlements and active internet connections are present.

Privacy Advantages of On-Device Execution

By executing generative AI inference locally via the Neural Engine and Unified Memory Architecture, the fm utility eliminates outbound network calls for routine workloads. Developer prompts, local source code snippets, and automated script outputs remain strictly on the host machine.

This completely offline pipeline helps teams adhere to enterprise compliance standards while protecting sensitive code repositories. It also complements recent OS security enhancements, such as stricter macOS Full Disk Access controls designed to prevent automated background agents from reading private file systems without permission.

Impact on Developer Workflows and Local Automation

The introduction of direct terminal access drastically reduces friction for programmers who rely on shell scripts, terminal multiplexers, and custom automation tools. Developers can pipe terminal outputs, git commit histories, or error logs directly into the fm tool to receive instant summaries, code reviews, and structured bug reports.

Because the utility offers built-in REST server capabilities, developer teams can plug Apple's native models into popular local coding assistants and IDE plugins without writing custom Swift bridges. This brings a lightweight, royalty-free local alternative to cloud-bound services like OpenAI and Anthropic for everyday coding tasks.

Moreover, local developers can combine the system fm command with third-party open-source runtimes. While tools like Apple's MLX library cater to custom open-weights models from Hugging Face on specialized setups like the Mac Studio, the built-in fm utility provides an out-of-the-box framework that requires zero installation or model weight downloading.

Apple Intelligence Developer Strategy Outlook

The release of a dedicated Terminal interface reflects Apple's broader ambition to make artificial intelligence a core utility layer across macOS. By making these models accessible in standard shell environments, Apple is addressing long-standing developer requests for flexible, scriptable access to on-device hardware acceleration.

As Apple continues rolling out incremental updates, such as macOS 27.2 beta features and expanded SDK support, local model execution will likely become a fundamental component of Mac automation workflows. Software creators can expect deeper integration between terminal tools, Xcode development environments, and system-level automation frameworks in future system builds.

Overall, the fm tool establishes a privacy-focused foundation for local command-line intelligence, equipping software engineers with powerful built-in language capabilities directly from their Mac terminal.