Skip to content

luishramorim/fm-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fm-cli

macOS Swift SwiftPM Homebrew

fm-cli is a lightweight Swift command-line tool powered by FoundationModels, allowing you to interact with Apple’s on-device language models directly from the terminal.

It provides a simple prompt-based interface, built-in help commands, and uses modern Swift features such as async/await.
The tool is designed for macOS on Apple Silicon and can be installed globally using Homebrew.


Features

  • Native Swift CLI using async/await
  • Access to Apple Foundation Models from the terminal
  • Built-in help command (help, --help, -h)
  • Short and concise model responses
  • Easy global installation via Homebrew
  • Built with Swift Package Manager

Requirements

  • macOS 26 or newer
  • Apple Silicon (M1 or newer)
  • Swift 5.9+
  • Apple Intelligence enabled
  • Homebrew installed

Installation

Install via Homebrew (recommended)

brew install luishramorim/tap/fm-cli

After installation, the command will be available globally:

fm-cli --help

Usage

Basic prompt

fm-cli "Explain async/await in Swift in 3 bullets"

Math / reasoning example

fm-cli "What is the result of 14124124214 / 1231234?"

Help

fm-cli help
fm-cli --help
fm-cli -h

Example Output

• async/await simplifies asynchronous code by making it look synchronous • It improves readability and error handling • It is built into Swift’s concurrency model

Development

Clone the repository

git clone https://github.com/luishramorim/fm-cli.git
cd fm-cli

Run locally

swift run fm-cli "Write a haiku about Swift"

Build release binary

swift build -c release

Project Structure

fm-cli/
├── Package.swift
├── Sources/
│   └── fm-cli/
│       ├── fm_cli.swift
│       └── HelpCommand.swift
└── README.md

Tech Stack

•	Swift
•	FoundationModels
•	Swift Package Manager
•	Homebrew

License

MIT License © 2026 Luis Amorim

Motivation

This project was created as an exploration of building professional Swift CLIs using modern Apple frameworks and distributing them via Homebrew, showcasing how Apple Foundation Models can be integrated into developer workflows.

About

A Swift CLI for interacting with Apple Foundation Models directly from the terminal.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages