Loading...
Loading...
Control macOS applications with Pi agents using semantic Accessibility API targets and optional screenshots
npx skill4agent add aradotso/trending-skills pi-computer-useSkill by ara.so — Daily 2026 Skills collection.
pi-computer-use@e1pi install git:github.com/injaneity/pi-computer-use#v0.2.1pi install -l git:github.com/injaneity/pi-computer-use#v0.2.1npm install @injaneity/pi-computer-use
# or pin a version
npm install @injaneity/pi-computer-use@0.2.1pi remove git:github.com/injaneity/pi-computer-use#v0.2.1
npm remove @injaneity/pi-computer-use~/.pi/agent/helpers/pi-computer-use/bridgeextensions/computer-use.ts/computer-usesrc/bridge.tsnative/macos/bridge.swift| Tool | Purpose |
|---|---|
| List running apps |
| List windows for an app |
| Capture window + return AX state |
| Click element or coordinate |
| Double-click element or coordinate |
| Move cursor |
| Drag from point to point |
| Scroll element or coordinate |
| Press key combination |
| Type raw text |
| Replace element value via AX |
| Pause execution |
| Position/resize window |
| Batch multiple actions |
screenshot// 1. Discover apps and windows if target is ambiguous
list_apps()
list_windows({ app: "Safari" })
// 2. Select the window and get AX state
screenshot({ window: "@w1" })
// 3. Act on AX refs returned from screenshot
click({ window: "@w1", ref: "@e1" })
set_text({ ref: "@e2", text: "https://example.com" })
keypress({ keys: ["Enter"] })@e1@e2screenshotcanSetValueset_textcanPressclickcanFocuscanScrollscrolladjust// Click by AX ref — no coordinates needed
click({ ref: "@e1" })
// Scroll a specific element
scroll({ ref: "@e3", scrollY: 600 })
// Replace text field value atomically
set_text({ ref: "@e2", text: "hello world" })stateIdclick({ x: 320, y: 180, stateId: "abc123" })computer_actionscomputer_actions({
stateId: "abc123",
actions: [
{ type: "click", ref: "@e1" },
{ type: "set_text", ref: "@e2", text: "https://example.com" },
{ type: "keypress", keys: ["Enter"] }
]
})stealthdefault// List windows for a specific app
list_windows({ app: "Finder" })
// Target a specific window in all subsequent calls
screenshot({ window: "@w2" })
// Arrange window by preset
arrange_window({ window: "@w1", preset: "left-half" })
// Arrange window with explicit frame
arrange_window({ window: "@w1", frame: { x: 0, y: 0, width: 1280, height: 800 } })imagescreenshot({ window: "@w1", image: "auto" }) // default: attach when AX coverage is weak
screenshot({ window: "@w1", image: "always" }) // always attach
screenshot({ window: "@w1", image: "never" }) // never attach, AX state onlylist_windows({ app: "Safari" })
screenshot({ window: "@w1" })
// @e1 = address bar (from AX state)
set_text({ ref: "@e1", text: "https://example.com" })
keypress({ keys: ["Enter"] })screenshot({ window: "@w1" })
// Use refs from AX state
set_text({ ref: "@e3", text: "Jane Doe" })
set_text({ ref: "@e4", text: "jane@example.com" })
click({ ref: "@e5" }) // Submit buttonkeypress({ keys: ["Cmd", "T"] }) // New tab
keypress({ keys: ["Cmd", "Shift", "N"] }) // New incognito window
keypress({ keys: ["Escape"] })scroll({ ref: "@e2", scrollY: 800 }) // Scroll element down
scroll({ ref: "@e2", scrollY: -400 }) // Scroll updrag({ fromX: 100, fromY: 200, toX: 400, toY: 200 })// Via config (see Configuration section)
// Actions will report `stealth` in execution metadata when successful/computer-use| Option | Description |
|---|---|
| |
| Enable background-safe strict AX mode |
| Browser-aware targeting preference |
docs/configuration.md# Install dependencies
npm install
# Run checks
npm test
# Run local checkout without loading installed copy
pi --no-extensions -e .# Default QA benchmark
npm run benchmark:qa
# Full benchmark (may open apps)
npm run benchmark:qa:fullbenchmarks/README.md~/.pi/agent/helpers/pi-computer-use/bridgescreenshotstateIdstateIdlist_windows({ app: "Safari" })window: "@wN"screenshotcanPresscanSetValuels ~/.pi/agent/helpers/pi-computer-use/bridgepi install git:github.com/injaneity/pi-computer-use#v0.2.1@e1@e2@w1@w2list_windows