ghost-os

ghostwrightMIT更新放缓

让 AI 代理直接操控 macOS 桌面完成各类操作,靠系统辅助功能接口而非截图识别界面,还能自我学习并复用操作流程。

Full computer-use for AI agents. Self-learning workflows. Native macOS. No screenshots required.

v2.2.1发布于 2026-03-12 05:27 UTC1,684star157fork同步于 2026-11-07 07:31 UTC

怎么上手

由 README 提炼,执行前请确认
brew install ghostwright/ghost-os/ghost-os
ghost setup
硬件要求按 README 说明

README 未说明显存或 GPU 要求;平台要求 macOS 14+,视觉回退使用本地 ShowUI-2B 模型,需运行 ghost setup 完成视觉模型配置。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

让 AI 代理直接操作 Mac 上任意原生应用,靠无障碍树而非截图,还能把学会的流程存成可复用配方

让 AI 代理直接操控 macOS 桌面完成各类操作,靠系统辅助功能接口而非截图识别界面,还能自我学习并复用操作流程。

核心能力

  • 读取 macOS 无障碍树获取结构化元素信息,而非截图猜测
  • AX 树不足时回退到本地 ShowUI-2B 视觉模型做视觉定位
  • 录制用户手动操作,合成带参数的 JSON 配方供小模型反复执行
  • 通过 MCP 协议接入 Claude Code、Cursor 等任意 MCP 客户端
  • 提供 29 个工具覆盖点击、输入、滚动、按键等操作

容易踩的坑

学习功能需在系统设置中授予输入监控(Input Monitoring)权限;macOS 开发者 beta 版上 brew install 可能因要求不存在的 Xcode 版本而失败,需改用 release 包手动安装;视觉回退依赖本地 ShowUI-2B 模型,需通过 ghost setup 单独下载配置。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v2.2.1
  1. v2.2.1Ghost OS v2.2.1最新正式版2026-03-12 · 2026-03-12 05:27 UTC

    Complete recipe JSON schema documentation and verify-before-save workflow.

    What changed:

    • Documented the full recipe JSON schema in GHOST-MCP.md (all 10 action types, all params, target/Locator fields, wait conditions)
    • Added verify-before-save flow: agents must test recipes end-to-end before saving
    • Fixed codesign issue in release binary (linker-signed adhoc broke on copy)
    • Updated README: star count, line count

    Agents can now author recipes correctly on the first attempt. Previously required reverse-engineering the schema from bundled recipes.

    Upgrade:

    brew upgrade ghost-os
    

    Or manual install:

    curl -sL https://github.com/ghostwright/ghost-os/releases/download/v2.2.1/ghost-os-2.2.1-macos-arm64.tar.gz | tar xz
    cp ghost /opt/homebrew/bin/
    cp ghost-vision /opt/homebrew/bin/
    

    Fixes #11, fixes #12

  2. v2.2.0Ghost OS v2.2.02026-03-12 · 2026-03-12 04:33 UTC
    查看更新说明

    Self-Learning Recipes

    Ghost OS can now watch you work and learn from it.

    Say "watch me send an email" -- Ghost OS observes every click, keystroke, and app switch with full accessibility context. Then Claude synthesizes your actions into a replayable recipe.

    New tools

    ToolPurpose
    ghost_learn_startBegin recording user actions
    ghost_learn_stopStop recording, return enriched action sequence
    ghost_learn_statusCheck recording state and stats

    29 tools total (was 26).

    How it works

    You: "Watch me send an email in Gmail"
    Claude: calls ghost_learn_start
    You: manually compose and send the email
    You: "Done"
    Claude: calls ghost_learn_stop -> gets 12 enriched actions with AX context
    Claude: synthesizes a parameterized recipe from the recording
    Claude: calls ghost_recipe_save -> recipe installed
    You: "Send an email to [email protected]"
    Claude: calls ghost_run with the learned recipe
    

    What gets captured

    • Clicks with element role, title, DOM id, computed name, parent role
    • Keystrokes coalesced into typed text (500ms grouping)
    • Hotkeys (Cmd+C, Cmd+V, etc.)
    • App switches (Cmd+Tab, Dock clicks, gestures)
    • Scroll events coalesced (300ms grouping)
    • Right-clicks and double-clicks detected

    Privacy

    • Password fields detected via 3-tier check (role, subrole, name patterns)
    • Keystrokes in secure fields replaced with placeholder
    • Restricted apps silently skipped (Keychain Access, System Preferences)
    • All data ephemeral -- never written to disk

    Requirements

    • Input Monitoring permission (System Settings > Privacy & Security > Input Monitoring)
    • This is separate from Accessibility and optional -- only needed for learning mode
    • ghost doctor checks this, ghost setup walks you through it

    Install

    Homebrew (recommended):

    brew update && brew upgrade ghost-os
    

    Manual:

    curl -L https://github.com/ghostwright/ghost-os/releases/download/v2.2.0/ghost-os-2.2.0-macos-arm64.tar.gz | tar xz -C /tmp/ghost-install
    sudo cp /tmp/ghost-install/ghost /opt/homebrew/bin/
    sudo cp /tmp/ghost-install/ghost-vision /opt/homebrew/bin/
    ghost doctor
    
  3. v2.1.2Ghost OS v2.1.22026-03-11 · 2026-03-11 04:48 UTC
    查看更新说明

    Pin vision sidecar dependencies for reliable ghost_ground.

    What changed:

    • Pin mlx-vlm==0.1.15 (with --no-deps) and transformers==4.48.3
    • transformers>=4.49 requires PyTorch for Qwen2VL video processor, breaking MLX-only environments
    • ghost setup now recreates the Python venv on upgrade (version stamp)
    • ghost doctor flags incompatible transformers versions
    • Vision sidecar diagnoses dependency errors at startup

    Upgrade:

    brew upgrade ghost-os
    ghost setup
    

    ghost setup will recreate the Python environment with pinned deps. Verify with ghost doctor.

    Fixes #7

  4. v2.1.1Ghost OS v2.1.12026-03-11 · 2026-03-11 03:37 UTC
    查看更新说明

    Bug fix release. Fixes ghost_ground for all new users.

    Bug Fixes

    • Fix model download: use mlx-community/ShowUI-2B-bf16-8bit (MLX safetensors) instead of showlab/ShowUI-2B (PyTorch)
    • Fix vision sidecar error caching that prevented retry after model fix
    • Fix ghost doctor: detect wrong model format with clear fix instructions
    • Fix ghost setup: validate model after download, fail on wrong format
    • Fix ghost setup: detect and remove broken PyTorch model from previous installs

    Improvements

    • Python 3.10+ version check during setup (MLX requirement)
    • Versioned Python candidates to avoid Xcode's bundled 3.9
    • Better model path diagnostics in vision sidecar
    • Tighten mlx-vlm version to >= 0.1.14

    Upgrading

    If you already ran ghost setup on v2.1.0, just run it again:

    brew upgrade ghost-os
    ghost setup
    

    ghost setup will detect the broken model, remove it, and re-download the correct one (~3 GB).

  5. v2.1.0Ghost OS v2.1.02026-03-10 · 2026-03-10 07:06 UTC
    查看更新说明

    What's New

    4 new MCP tools (26 total):

    • ghost_annotate — Screenshot with numbered labels on every interactive element. Returns click coordinates. No ML needed. Instant.
    • ghost_hover — Move cursor to trigger tooltips, CSS :hover effects, and dropdown menus.
    • ghost_long_press — Press and hold for context menus, Force Touch previews, drag initiation.
    • ghost_drag — Drag files between folders, adjust sliders, reorder lists, select text, resize panes.

    Also in this release

    • Fixed python3 path resolution in vision setup (thanks @mcheemaa, #2)
    • Updated GHOST-MCP.md agent instructions for all new tools
    • Coordinate clamping in ghost_annotate for scrollable content areas
    • Duration clamping in ghost_long_press and ghost_drag for safety

    Upgrade

    brew upgrade ghostwright/ghost-os/ghost-os
    

    Or manual install:

    curl -sL https://github.com/ghostwright/ghost-os/releases/download/v2.1.0/ghost-os-2.1.0-macos-arm64.tar.gz | tar xz
    sudo cp ghost /opt/homebrew/bin/
    sudo cp ghost-vision /opt/homebrew/bin/
    sudo cp -r recipes /opt/homebrew/share/ghost-os/
    sudo cp GHOST-MCP.md /opt/homebrew/share/ghost-os/
    

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Your AI agent can write code, run tests, search files. But it can't click a button, send an email, or fill out a form. It lives inside a chat box.

    Ghost OS changes that. One install, and any AI agent can see and operate every app on your Mac.

    Meet Specter

    Ghost OS gives AI agents eyes and hands. Shadow gives them memory. Specter gives them a home.

    Deploy persistent AI agents to dedicated VMs in 90 seconds. Automatic DNS, TLS, systemd hardening. Interactive TUI dashboard. You own the infrastructure.

    AI agents that earn your trust.

    Meet Shadow

    Shadow is the other half of the story. Ghost OS gives AI agents eyes and hands on your Mac. Shadow gives them memory and intelligence.

    14-modality capture. Proactive suggestions. Episode generation. On-device LLM inference. Computer-use training data. All local, all open source.

    Your computer was paying attention the whole time.


    What's New  

    Self-learning recipes. Show Ghost OS how to do something once, and it remembers forever.

    • ghost_learn_start -- Begin watching the user perform a task
    • ghost_learn_stop -- Stop and return the enriched action sequence
    • ghost_learn_status -- Check recording progress

    The user performs the task manually (clicking, typing, switching apps). Ghost OS observes every action through a CGEvent tap enriched with accessibility tree context. Claude synthesizes the raw observation into a parameterized, replayable recipe.

    No screenshots needed. No vision model. Just the accessibility tree and your keyboard/mouse.

    User:    "Watch me send an email."
    Agent:   ghost_learn_start task_description:"send email in Gmail"
             ...user performs the task...
    Agent:   ghost_learn_stop
             -> 8 actions with full AX context
             -> Synthesizes recipe with 3 parameters: recipient, subject, body
             -> ghost_recipe_save
    User:    "Send an email to bob about the Q4 report"
    Agent:   ghost_run recipe:"gmail-send-learned" params:{...}
    

    Requires Input Monitoring permission (System Settings > Privacy & Security > Input Monitoring). Run ghost setup to configure.

    4 new tools. ghost_annotate, ghost_hover, ghost_long_press, ghost_drag. Pinned vision sidecar dependencies, fixed vision model download, Chinese/CJK input support (thanks @junshi5218).

    Thank you to the 500+ people who have starred this project. You are why we keep building. If you want to contribute directly, we would love that. See CONTRIBUTING.md.

    You:     "Send an email to [email protected] about the Q4 report"
    Agent:   ghost_run recipe:"gmail-send" params:{recipient, subject, body}
             → Compose opens, fields fill, email sends. Done.
    

    Setup

    Ghost OS Setup Demo

    Recipes in Action

    Send emails and download papers. Any app. Any workflow.

    Ghost OS Recipes Demo

    Beyond the Browser

    Slack messages, Finder folders — Ghost OS operates native macOS apps, not just browsers.

    Ghost OS Slack + Finder Demo

    Why Ghost OS?

    Other computer-use tools take screenshots and guess what's on screen. Ghost OS reads the macOS accessibility tree — structured, labeled data about every element in every app. When the AX tree isn't enough (web apps, dynamic content), it falls back to a local vision model (ShowUI-2B) for visual grounding.

    And when it figures out a workflow, it saves it. Other tools repeat the same expensive reasoning every time.

    • Self-learning — A frontier model figures out the workflow once. A small model runs it forever.
    • Transparent — Recipes are JSON. Read every step before running. No black box.
    • Native — Accessibility tree first. Vision fallback when needed. Structured data over pixel guessing.
    • Any app — Not just browsers. Slack, Finder, Messages — anything on your Mac.
    • Local — Your data never leaves your machine.
    • Open — MCP protocol. Works with Claude Code, Cursor, VS Code, or any MCP client.
    Ghost OSAnthropic Computer UseOpenAI OperatorOpenClaw
    👀How it seesAccessibility tree + local VLMScreenshots onlyScreenshots onlyBrowser DOM
    🖥️Native appsAny macOS appAny (via pixels)Browser onlyBrowser only
    🧠Learns workflowsJSON recipesNoNoNo
    🔒Data stays localYesDepends on setupNo (cloud)Yes
    📖Open sourceMITNoNoMIT

    Install

    brew install ghostwright/ghost-os/ghost-os
    ghost setup
    

    That's it. ghost setup handles permissions, MCP configuration, recipe installation, and vision model setup.

    Homebrew has a known issue on macOS developer betas where it demands an Xcode version that doesn't exist yet. If brew install fails, install directly:

    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/
    sudo mkdir -p /opt/homebrew/share/ghost-os
    sudo cp GHOST-MCP.md /opt/homebrew/share/ghost-os/
    sudo cp -r recipes /opt/homebrew/share/ghost-os/
    sudo cp -r vision-sidecar /opt/homebrew/share/ghost-os/
    ghost setup
    

    How It Works

    Ghost OS connects to your AI agent through MCP and gives it 29 tools to see and operate your Mac. It reads the macOS accessibility tree for structured data about every app. For web apps where the AX tree falls short (Gmail, Slack), a local vision model (ShowUI-2B) finds elements visually. Click, type, hover, drag, scroll, press keys, manage windows. Any app, not just browsers.

    You:     "Download the latest paper on chain-of-thought prompting from arXiv"
    Agent:   ghost_run recipe:"arxiv-download" params:{query:"chain of thought prompting"}
             → Navigates to arXiv, searches, opens PDF, downloads to Desktop. Done.
    

    Works with Claude Code, Cursor, VS Code, or anything that speaks MCP.

    Recipes

    When your agent figures out a workflow, it saves it as a recipe. A recipe is a JSON file with steps, parameters, and wait conditions. Transparent and auditable.

    A frontier model figures out the workflow once. A small model runs it forever.

    # One command sends an email
    ghost_run recipe:"gmail-send" params:{"recipient":"[email protected]","subject":"Hello","body":"World"}
    
    # 7 steps, 30 seconds, 100% reliable
    
    • Recipes are just JSON. Read every step before running.
    • Share with your team. One person learns the workflow, everyone benefits.
    • Chain recipes together. The agent knows when to call what.
    • Write once with Claude or GPT-4. Run forever with Haiku.

    29 Tools

    ToolWhat it does
    🔍ghost_contextGet the current app, window title, URL, focused element, and all interactive elements on screen
    🔍ghost_stateList every running app with its windows, positions, and sizes
    🔍ghost_findSearch for elements by name, role, DOM id, or CSS class across the entire UI
    🔍ghost_readExtract text content from any app, with depth control for nested content
    🔍ghost_inspectGet complete metadata for one element: role, position, actions, DOM id, editable state
    🔍ghost_element_atIdentify what element is at a specific screen coordinate
    📸ghost_screenshotCapture a window screenshot for visual debugging
    📸ghost_annotateScreenshot with numbered labels on interactive elements and click coordinates
    👁️ghost_groundFind element coordinates using vision (ShowUI-2B). Works when AX tree can't find web elements
    👁️ghost_parse_screenDetect all interactive elements via vision
    🎯ghost_clickClick an element by name, DOM id, or screen coordinates
    🎯ghost_hoverMove cursor to an element or position to trigger tooltips and hover effects
    🎯ghost_long_pressPress and hold for context menus, Force Touch previews, and drag initiation
    🎯ghost_dragDrag from one point to another for file moves, sliders, list reordering, text selection
    ⌨️ghost_typeType text into a specific field by name, or at the current cursor
    ⌨️ghost_pressPress a single key like Return, Tab, Escape, or arrow keys
    ⌨️ghost_hotkeyPress key combinations like Cmd+L, Cmd+Return, Cmd+Shift+P
    🎯ghost_scrollScroll up, down, left, or right in any app window
    🪟ghost_focusBring any app or specific window to the front
    🪟ghost_windowMinimize, maximize, close, move, or resize any window
    ⏳ghost_waitWait for a URL change, element to appear or disappear, or title change
    📦ghost_recipesList all installed recipes with descriptions and parameters
    ▶️ghost_runExecute a recipe with parameter substitution
    📦ghost_recipe_showView the full steps and configuration of a recipe
    📦ghost_recipe_saveInstall a new recipe from JSON
    📦ghost_recipe_deleteRemove an installed recipe
    🎓ghost_learn_startStart observing the user's actions for workflow learning
    🎓ghost_learn_stopStop observing and return the enriched action sequence
    🎓ghost_learn_statusCheck if learning mode is active and recording stats

    Diagnostics

    $ ghost doctor
    
      [ok] Accessibility: granted
      [ok] Screen Recording: granted
      [ok] Input Monitoring: granted (for learning mode)
      [ok] Processes: 1 ghost MCP process
      [ok] MCP Config: ghost-os configured
      [ok] Recipes: 5 installed
      [ok] AX Tree: 12/12 apps readable
      [ok] ghost-vision: /opt/homebrew/bin/ghost-vision
      [ok] ShowUI-2B model: ~/.ghost-os/models/ShowUI-2B (3.0 GB)
      [ok] Vision Sidecar: not running (auto-starts when needed)
    
      All checks passed. Ghost OS is healthy.
    

    Build From Source

    git clone https://github.com/ghostwright/ghost-os.git
    cd ghost-os
    swift build
    .build/debug/ghost setup
    

    Requires Swift 6.2+ and macOS 14+.

    Architecture

    AI Agent (Claude Code, Cursor, any MCP client)
        │
        │ MCP Protocol (stdio)
        │
    Ghost OS MCP Server (Swift)
        │
        ├── Perception ──── see what's on screen (AX tree)
        ├── Vision ──────── visual grounding (ShowUI-2B, local)
        ├── Actions ─────── click, type, scroll, keys
        ├── Recipes ─────── self-learning workflows
        └── AXorcist ────── macOS accessibility engine
    

    ~7,000 lines of Swift + Python vision sidecar. Built on AXorcist by @steipete.

    Contributing

    See CONTRIBUTING.md. We need recipes for more apps, testing on different setups, and bug reports. If you're building AI agents that do real things, this is the project.

    Contributors

    Thanks to everyone who has contributed to Ghost OS.

    License

    MIT