Terminal
Terminal/Skill
Lets an agent control a whole Mac from one Python session, with screenshots and background input that does not move your cursor.
By Browser Use
Works with
npx skills add browser-use/macos-harness --skill macos-harnessUse one CLI call per decision point, not per primitive:
macos-harness <<'PY'
app = "Spotify"
mac.see(app)
mac.key("cmd+k", app=app)
mac.type("Alessia Cara", app=app)
print(mac.see(app))
PY
The CLI preloads mac, browser, Path, and subprocess. Prefer bounded stdin
programs; reserve macos-harness repl for manual exploration and always exit it.
Think in six verbs: see, key, type, click, ax, script.
frame = mac.see("Spotify")
mac.key("cmd+k", app="Spotify")
mac.type("Alessia Cara", app="Spotify")
mac.click(640, 420, app="Spotify")
item = mac.ax.at(640, 420, app="Spotify")
mac.ax.perform(item["element_index"], "AXPress")
mac.script('tell application "Spotify" to play')
Use ordinary Python for local context and one-off logic. Do not add app-specific helpers when a short program can resolve the task.
my, friend, or prior activity),
inspect that context and correlate stable fields; a loose text hit is not enough.mac.script() for a known exact, focus-safe app command.mac.see(app) and vision.mac.ax only when semantic identity or state matters. Do not dump
a full AX tree before trying the direct route.After a failed verified burst, switch mode or stop. Never repair uncertainty with repeated keys, clicks, deletion loops, or bulk input.
FocusChangedError; never
manipulate focus to restore it.mac.click() is raw PID-targeted input. It never guesses an AX action.mac.move() moves only that pointer; it cannot produce native hover.mac.see() and preserve window
bounds and Retina scaling.Secondary primitives are mac.move, drag, scroll, show_pointer, and
hide_pointer. mac.ax.query() returns compact matches and bounds fallback
traversal; lower max_nodes for especially large apps.
Use browser for DOM, tabs, network, downloads, and uploads. Do not substitute AX
for CDP inside a web page. While Browser Harness connects, macOS Harness accepts
Chrome's exact Allow remote debugging? sheet through system-wide AX. It never
activates Chrome or emits a mouse event.
Run macos-harness doctor to inspect permissions without prompting. Run
macos-harness doctor --request only with user approval. Accessibility, screen
recording, and event posting are global; Apple Events Automation is per target.