Ghost OS: AI-Powered Mac Automation
Ghost OS: A Revolutionary AI-Powered Operating System for Mac
Introduction
Ghost OS is an innovative software solution designed to bridge the gap between artificial intelligence (AI) agents and real-world computer operations. Unlike traditional AI assistants that are confined within chat interfaces, Ghost OS enables AI agents—such as Claude Code, Cursor, or any other Model Context Protocol (MCP)-compatible tool—to interact with macOS applications seamlessly. By leveraging structured data from the macOS accessibility tree and a local vision model (ShowUI-2B), Ghost OS allows AI agents to perform tasks like sending emails, downloading files, managing documents, and interacting with native apps without requiring manual screenshots or complex visual recognition.
This article explores how Ghost OS works, its key features, self-learning capabilities, installation process, and the broader impact it has on AI-driven automation.
Key Features of Ghost OS
1. Self-Learning Workflows
One of Ghost OS’s most groundbreaking features is its ability to learn and store workflows dynamically. Users can demonstrate a task (e.g., sending an email or organizing files) once, and Ghost OS records the sequence of actions in a structured JSON format called a "recipe." This recipe can then be executed by AI agents without requiring repeated manual input.
How It Works
- When a user initiates learning mode with
ghost_learn_start, Ghost OS begins capturing every action (keyboard inputs, mouse movements, app switches) through the macOS accessibility tree. - The system enriches these actions with metadata such as element roles, positions, and interactive states.
- Once the task is completed, users can stop recording with
ghost_learn_stop. The AI agent then synthesizes a reusable recipe containing: - A sequence of steps (e.g., opening Gmail, typing recipient details).
- Parameters like subject lines or body text.
- Wait conditions to ensure smooth execution.
Example Workflow
User: "Watch me send an email."
Agent: ghost_learn_start task_description:"send email in Gmail"
→ User opens Gmail, types recipient (e.g., bob@example.com), subject ("Q4 Report"), and body.
Agent: ghost_learn_stop → Recipe saved as "gmail-send-learned" with parameters {recipient, subject, body}
Later, an AI agent can execute this recipe instantly:
User: "Send an email to sarah@company.com about the Q4 report."
Agent: ghost_run recipe:"gmail-send-learned" params:{recipient: "sarah@company.com", subject: "Q4 Report", body: "Attached findings..."}
→ Email is sent automatically.
2. Accessibility Tree & Vision Fallback
Ghost OS relies on the macOS accessibility tree, a structured database of UI elements (buttons, text fields, dropdowns) that describes their roles, positions, and interactions. This approach ensures precision without relying on pixel-based recognition.
For web apps or dynamic content where the accessibility tree fails (e.g., Gmail’s complex UI), Ghost OS integrates a local vision model (ShowUI-2B) to visually ground elements. This hybrid system guarantees reliability across all applications.
3. 29 Tools for AI Agents
Ghost OS provides an extensive set of tools to interact with macOS apps programmatically:
| Tool | Description |
|------------------------|--------------------------------------------------------------------------------|
| ghost_context | Retrieves app name, window title, URL, and focused elements. |
| ghost_find | Searches for UI elements by name, role, or DOM ID. |
| ghost_inspect | Extracts metadata (position, actions, editable state) of a specific element. |
| ghost_click | Simulates mouse clicks on an element. |
| ghost_type | Types text into a field by name or cursor position. |
| ghost_wait | Pauses execution until a condition (e.g., URL change, element appearance) is met.|
| ghost_learn_start/stop| Records user actions for self-learning workflows. |
Example Use Cases
- Automated Email Management:
ghost_run recipe:"gmail-send" params:{recipient: "team@example.com", subject: "Project Update"}
- File Organization in Finder:
ghost_drag source: "/Downloads/Report.pdf" target: "/Documents/Project"
4. Transparency & Open-Source Nature
Unlike black-box automation tools, Ghost OS recipes are stored as JSON files, making them fully auditable and shareable. This transparency ensures that AI agents can debug workflows before execution.
Ghost OS is also open-source under the MIT License, allowing developers to integrate it with any MCP-compatible AI agent (e.g., Claude Code, Cursor).
5. Local Execution & Data Privacy
All operations occur on the user’s Mac without sending data to external servers. This privacy-focused design aligns with modern security concerns.
Installation Process
Ghost OS can be installed via Homebrew or manually for macOS betas:
Option 1: Homebrew Installation (Recommended)
brew install ghostwright/ghost-os/ghost-os
ghost setup
The ghost setup command handles:
- Input Monitoring permissions.
- MCP configuration.
- Recipe and vision model installation.
Option 2: Manual Install for macOS Betas
If Homebrew fails due to Xcode compatibility issues, users can download the prebuilt binary from GitHub:
curl -sL https://github.com/ghostwright/ghost-os/releases/latest/download/ghost-os-2.2.1-macos-arm64.tar.gz | tar xz
sudo cp ghost /opt/homebrew/bin/
sudo cp ghost-vision /opt/homebrew/bin/
mkdir -p /opt/homebrew/share/ghost-os
cp GHOST-MCP.md /opt/homebrew/share/ghost-os/
cp -r recipes /opt/homebrew/share/ghost-os/
cp -r vision-sidecar /opt/homebrew/share/ghost-os/
ghost setup
How Ghost OS Works Under the Hood
Ghost OS operates through a Swift-based MCP server that connects to AI agents via the Model Context Protocol. The architecture consists of four key components:
- Perception Layer:
- Uses the macOS accessibility tree (AXTree) to parse UI elements.
- Falls back to ShowUI-2B vision model for web apps.
- Vision Sidecar:
- A Python-based module that processes visual data and maps it to interactive elements.
- Actions Layer:
- Executes keyboard/mouse inputs (e.g.,
ghost_click,ghost_type).
- Recipes Engine:
- Stores workflows as JSON files for reuse.
- Enables dynamic parameter substitution.
Self-Learning in Action
Step-by-Step Demonstration
- User Initiates Learning Mode:
User: "Watch me open Slack and send a message."
Agent: ghost_learn_start task_description:"send message in Slack"
- Ghost OS Records Actions:
- Opens Slack, types recipient ("@team").
- Types message body.
- User Stops Recording:
User: "Done."
Agent: ghost_learn_stop → Recipe saved as "slack-send"
- AI Agent Executes Later:
User: "Send a reminder to @team about the meeting."
Agent: ghost_run recipe:"slack-send" params:{recipient: "@team", message: "Reminder: 3 PM meeting"}
→ Message is sent automatically.
Comparison with Other Tools
| Feature | Ghost OS | Anthropic Computer Use | OpenAI Operator | OpenClaw | |-----------------------|-----------------------------------|----------------------------------|----------------------------------|-------------------------------| | How It Sees | AX Tree + Vision Model | Screenshots Only | Screenshots Only | Browser DOM | | Native Apps | Any macOS app | Limited (via pixels) | Browser only | Browser only | | Self-Learning | ✅ JSON Recipes | ❌ No | ❌ No | ❌ No | | Data Privacy | ✅ Local | Depends on setup | Cloud-based | Cloud-based | | Open-Source | ✅ MIT License | ❌ Proprietary | ❌ Proprietary | ❌ Proprietary |
Diagnostics & Troubleshooting
Before running Ghost OS, users can check its health status:
ghost doctor
Expected output:
[ok] Accessibility: granted
[ok] Screen Recording: granted
[ok] Input Monitoring: granted (for learning mode)
[ok] Processes: 1 ghost MCP process
[ok] AX Tree: 12/12 apps readable
[ok] ShowUI-2B model: ~3.0 GB downloaded
If issues arise, common fixes include:
- Granting Input Monitoring permissions in macOS Privacy settings.
- Ensuring the ShowUI-2B vision model is installed (
~/.ghost-os/models/). - Updating Homebrew and Swift dependencies.
Building Ghost OS from Source
For developers interested in contributing, Ghost OS can be compiled from source:
git clone https://github.com/ghostwright/ghost-os.git
cd ghost-os
swift build .build/debug/ghost setup
Requirements:
- macOS 14+ (Sonoma)
- Swift 6.2+
Contributing to Ghost OS
Ghost OS thrives on community contributions, including:
- Writing new recipes for popular apps.
- Testing workflows across different macOS versions.
- Reporting bugs and optimizing performance.
The project’s CONTRIBUTING.md guide provides detailed instructions for contributors. A heartfelt thank you goes out to the 500+ contributors who have helped shape Ghost OS into a powerful tool for AI automation.
Conclusion
Ghost OS represents a paradigm shift in AI-driven computer use by enabling seamless, self-learning interactions with macOS applications. By combining structured accessibility data with local vision models and transparent JSON recipes, it provides an unparalleled level of precision and reliability compared to traditional screenshot-based automation tools.
For developers, researchers, and power users looking to build AI agents capable of performing real-world tasks—from email management to file organization—Ghost OS offers a robust, open-source solution. Whether installed via Homebrew or built from source, Ghost OS empowers AI agents to operate like human users, unlocking new possibilities in automation and productivity.
Image References:
Enjoying this project?
Discover more amazing open-source projects on TechLogHub. We curate the best developer tools and projects.
Repository:https://github.com/ghostwright/ghost-os
GitHub - ghostwright/ghost-os: Ghost OS: AI-Powered Mac Automation
Ghost OS is an open-source AI assistant that enables AI agents to interact with macOS applications seamlessly, leveraging the macOS accessibility tree and a loc...
github - ghostwright/ghost-os