A terminal-based macOS automation agent written in Rust. It uses Ollama and the Rig library to translate natural language commands into AppleScript, allowing you to control your Mac using conversational AI.
- Natural Language Control: Ask your Mac to perform tasks like "display a notification", "Spotify next track", or "create a reminder".
- Local AI Execution: Powered by Ollama for fast, private, and local execution.
- AppleScript Integration: Seamlessly interacts with macOS native applications and system settings.
- Rust & Tokio: Built for performance and reliability using async Rust.
- macOS: Required since the agent uses AppleScript (
osascript) to execute commands. - Rust: Set up via rustup.
- Ollama: Install from ollama.com and ensure it is running in the background.
rig-coreandrigfor the LLM agent framework.tokiofor async runtime execution.serdeandserde_jsonfor serialization.anyhowandthiserrorfor error handling.
cargo install mac-agent-rust
mac-agent-rust run-
Clone the repository:
git clone https://github.com/Tejas1Koli/mac-agent-rust.git cd mac-agent-rust -
Pull the LLM text model: The default model is
gemma4:e4b-mlx"ollama pull gemma4:e4b-mlx
Configuration cant be changed for now (for only cli interface)
OLLAMA_HOST: URL to your Ollama instance (default:http://localhost:11434)MODEL: The LLM model to useTEMPERATURE: The creativity/randomness of the model (default:0.7)
quitorexit: Stop the agent.reset: Clear the chat history context.