Graphrt

Computer Control

Control macOS apps (incl. WhatsApp Desktop) via the Accessibility tree, read UI, click, type, keys, clipboard, screenshots — limited to an app allowlist

Experimental v0.1.0 Node.js 17 actions ToS risk medium
Use in Graphrt Desktop

About

A Graphrt plugin that controls macOS desktop apps. It reads an app's UI from the macOS Accessibility tree, which is text, so agents can "see" it. It can then click elements, type, press key combos, use the clipboard and save screenshots. Every operation is a workflow node and, except quit_app and whatsapp_desktop_send, an agent tool.

What it can do

  • Apps and windows: list_apps, open_app, focus_app, quit_app (node only), list_windows.
  • Reading the UI: - read_ui returns elements {ref, role, title, value, description, placeholder, enabled, focused, position, size}, plus data.text, a compact indented outline that agents read. - find_elements finds elements by role and/or text.
  • Acting on elements: click_element uses AXPress and falls back to a mouse click at the element's centre. Also set_value and focus_element.
  • Keyboard and pointer: type_text (key by key, inserted through Accessibility, or pasted), press_keys (cmd+f, enter, cmd+shift+n, cmd+a delete), click_at.
  • Clipboard: get_clipboard (opt-in), set_clipboard (plain text).
  • Screen: take_screenshot saves one app window (or, opt-in, the whole screen) as a PNG and returns its path.
  • WhatsApp Desktop: whatsapp_desktop_send (chat name, text) is a recipe built on the operations above. It is a workflow node only.
  • Guardrails: - An app allowlist is required. - Every action is logged to stderr. Typed text is logged as its length only. - Operations run one at a time. - There is no "run arbitrary AppleScript" operation. - The manifest asks for no network access and no secrets (localOnly).

Actions

Each action is a step you can add to a workflow. Agents can also use most of them as tools.

  • List running apps computer-control.list_apps
  • Open app computer-control.open_app
  • Focus app computer-control.focus_app
  • Quit app computer-control.quit_app
  • List windows computer-control.list_windows
  • Read app UI computer-control.read_ui
  • Find UI elements computer-control.find_elements
  • Click element computer-control.click_element
  • Set element value computer-control.set_value
  • Focus element computer-control.focus_element
Show all 17 actions
  • Type text computer-control.type_text
  • Press keys computer-control.press_keys
  • Click at point computer-control.click_at
  • Get clipboard computer-control.get_clipboard
  • Set clipboard computer-control.set_clipboard
  • Take screenshot computer-control.take_screenshot
  • Send WhatsApp Desktop message computer-control.whatsapp_desktop_send

Settings

Graphrt starts plugins with a clean environment. Only these values reach the plugin, and secrets stay out of logs.

  • COMPUTER_CONTROL_ALLOWED_APPS Required
    Comma-separated app names or bundle ids the plugin may control, e.g. Finder,TextEdit,net.whatsapp.WhatsApp. ASCII letters are case-insensitive. * allows every app. That is risky: an agent could then type into your terminal or password manager.
  • COMPUTER_CONTROL_ALLOW_CLIPBOARD_READ Optional
    Set to 1 to allow get_clipboard. The clipboard holds whatever was last copied in any app, passwords included.
  • COMPUTER_CONTROL_ALLOW_FULL_SCREENSHOT Optional
    Set to 1 to allow take_screenshot without app (the whole screen, which shows every app). Window screenshots don't need it.
  • COMPUTER_CONTROL_SCREENSHOT_DIR Optional
    Where screenshots go (default $TMPDIR/graphrt-computer-control)

How to use it

In Graphrt Desktop

  1. Open Plugins and search for Computer Control.
  2. Click Install and approve it.
  3. Follow the setup steps on the plugin's page, then paste the settings it needs.
  4. Describe a job that needs it, and the builder adds the steps.
Plugins in Graphrt Desktop

With the CLI

terminal
$ graphrt plugin install computer-control --yes
workflow.yaml
- id: ui
  type: computer-control.find_elements
  app: TextEdit
  role: textarea
- id: focus
  type: computer-control.focus_element
  app: TextEdit
  ref: "{{#ui.data.elements.0.ref#}}"
- id: type
  type: computer-control.type_text
  app: TextEdit
  text: "Hello from graphrt"
  method: insert
Plugins in the docs