macos-harness README

The project's README from github.com/browser-use/macos-harness. As one markdown file: README.md.

macOS Harness

macOS Harness ⌘

Give any coding agent the apps on your Mac. One shell command per step. It works in the background: your pointer does not move and your front app stays in front.

● agent: needs something only an app's UI can do
│
● macos-harness get_app_state --app "TextEdit"       the window as numbered text
│
● macos-harness click --app "TextEdit" --element_index 12
│
● macos-harness get_app_state --app "TextEdit"       only what changed
│
✓ task complete                                      you kept working the whole time

Your agent now has a Mac.

Give it to your agent

Paste this into Claude Code, Codex, Pi or OpenCode:

Install or upgrade macOS Harness from https://github.com/browser-use/macos-harness with uv using Python 3.12. Then run `macos-harness install --agent NAME`, where NAME is the agent CLI you are (claude, codex, pi or opencode), and `macos-harness doctor`. Explain any missing macOS permission and ask before requesting it. Finally read one app that is already running, without bringing it to the front: `macos-harness get_app_state --app Finder`.

That is it. The agent installs the package, gets the skill, checks permissions and reads its first app. Manual setup is available too. To go back to an older release, run macos-harness uninstall --agent all first.

Eleven tools. Any app.

macos-harness get_app_state --app "TextEdit"
macos-harness click --app "TextEdit" --element_index 12
macos-harness type_text --app "TextEdit" --text "hello world"
macos-harness press_key --app "TextEdit" --key "super+s"
macos-harness set_value --app "TextEdit" --element_index 7 --value "report.txt"
macos-harness scroll --app "TextEdit" --element_index 3 --direction down --pages 1
macos-harness get_app_state --app "TextEdit"

Read, act, read again. get_app_state prints one line per thing on screen, each with a number, and the path of a screenshot. Every other tool takes that number, or a pixel of that screenshot. The rest of the eleven: list_apps, drag, paste, select_text and perform_secondary_action.

There are no Spotify tools, Slack tools or Final Cut tools. The model gets the same eleven commands for every app. The skill is one page, and it is all an agent needs to read.

How it works

   agent's shell                      helper (starts on the first call)
        │                                         │
  macos-harness click ...  ── local socket ──▶  numbers, last state, sessions
        │                                         │
   text on stdout          ◀──────────────  accessibility tree + window screenshot
                                                  │
                                    accessibility actions first, else events
                                    sent to the app's own process

Permissions and privacy

macos-harness doctor reports the macOS permissions: Accessibility and Screen Recording, which every call needs, and two optional ones, for the app that starts the harness.

While paste runs, what was on your clipboard is kept in a file only you can read (in the state folder) for about four seconds, so that it can be put back, also after a crash.

Anonymous telemetry is enabled by default. It records only the CLI command category, success, duration, package version, OS/architecture, and detected agent client. It never records prompts, app names, screenshots, UI text, scripts, paths, or window titles.

macos-harness telemetry disable

Experimental. macOS only. MIT licensed.

macos-harness (browser-use/macos-harness)

Searching Database…

What is this?macos-harness is a thin Python harness that gives an LLM agent direct control of a Mac through a handful of raw primitives instead of prebuilt app-specific tools.
Is this a framework with built-in recipes, or something simpler?It is deliberately not a framework: there are no Spotify, Slack, or Final Cut tools and no predefined workflows. It just exposes six primitives (see, key, type, click, ax, script) in a single Python process and lets the model write the rest.
How do I get it running?You paste a short prompt into Codex or Claude Code, and the agent installs the package, teaches itself the workflow, checks permissions, and verifies the connection itself. A manual setup path is also available.
Which coding agents does it work with?It is designed to be handed to Codex or Claude Code, which install and bootstrap it themselves; the harness itself runs as a Python process alongside your real browser.
Is this ready for everyday, production use?No, the README labels the project experimental and macOS-only, so it should be treated as an early-stage tool rather than something hardened for daily driving.
Does it work on other operating systems too?No, it is built specifically around macOS's Accessibility and Apple Events APIs, so it only runs on a Mac.
What data does it send home?Anonymous telemetry is on by default but only logs the CLI command category, success, duration, package version, OS/architecture, and detected agent client; it never records prompts, app names, screenshots, UI text, scripts, paths, or window titles.
Does it move my actual mouse cursor while the agent works?No, it draws an animated, click-through pointer overlay and sends input directly to the target app's process, so your real cursor and the window's stacking order stay untouched.
Can it see and interact with apps running in the background?Yes, it captures background app windows without bringing them forward and sends keyboard and coordinate input directly to an app's PID.
How does it handle a real logged-in browser?It uses Browser Harness via CDP to control your actual logged-in browser session rather than spinning up a separate automated browser.
What are the six primitives the agent is given?see, key, type, click, ax (Accessibility/Apple Events), and script, plus ordinary Python with browser, Path, and subprocess available in the same process.
Size
6 MB
Stars
1K
Age
3mo
Commits · 90 Days