Docs/Features/Computer Use
Features

Computer Use

Control your macOS desktop β€” mouse, keyboard, screen capture, and UI automation β€” through the `computer` tool, driving apps via the macOS Accessibility tree and screen capture.

Flowly can capture the screen on its own through the screenshot tool. Computer use drives applications via the macOS Accessibility (AX) tree and screen capture, backed by the Desktop helper.

Requirements

  • macOS for the full experience. The rich AX-direct automation (reading and acting on the Accessibility tree) is macOS-only. The computer tool also registers on Linux and Windows with OS-native fallbacks (xdotool on Linux, PowerShell on Windows) for pointer, keyboard, and capture β€” but without the structured AX workflow.
  • The Desktop helper. On macOS, AX automation and screen capture go through the native helper.
  • tools.computer.enabled must be true in ~/.flowly/config.json. The tool registers only when this gate is set. Two optional knobs sit alongside it: tools.computer.actionDelayMs (pause between synthetic actions, default 100) and tools.computer.failsafe (abort if the pointer is slammed into a screen corner, default true).

computer

A single action parameter selects the operation. The primary workflow is AX-direct: read a window's accessibility tree as structured JSON, then address elements by their index inside that snapshot β€” never by guessing pixel coordinates.

AX-direct workflow (preferred)

ActionPurpose
activate_appBring an app to the foreground (always do this first)
launch_appStart an app if it is not running
read_window_stateJSON snapshot: {snapshot_id, elements: [{index, role, title, description, value, actions, enabled}]}
find_elementRead-only lookup; returns the element's index + snapshot_id
press_by_titleFind an element by AX title/description/value and dispatch an AX action (preferred for buttons)
click_element_axDispatch an AX action on an element you already located, by pid + snapshot_id + element_index
set_element_valueWrite to a specific text field by index
clear_and_typeReplace the focused element's content
set_valueSet a value
keyKeystroke combos (Return, cmd+a, tab)
read_focused_textRead the focused element's text
read_window_textDump a window's AX-tree text
waitWait

Semantic AX action shortcuts β€” press, open, show_menu, pick, confirm, cancel β€” route internally to click_element_ax, so the agent can express intent with a single action.

Pointer, keyboard, and capture

ActionPurpose
click / double_click / movePointer actions (AX-direct, or real screen coordinates)
type / pasteEnter text
scrollScroll
dragDrag
cursor_position / screen_sizePointer / display geometry
clipboard_read / clipboard_writeRead or write the clipboard
screenshot / capture_windowCapture the screen or a specific window

Environment introspection

ActionPurpose
list_appsList running apps
list_windows / window_listList windows
list_displaysList displays
frontmost_window_idID of the frontmost window

A typical flow: activate_app (or launch_app) β†’ read_window_state to find the target field by role/title β†’ click_element_ax or press_by_title to focus it β†’ clear_and_type β†’ key('Return') to submit β†’ read_focused_text / read_window_text to verify.

screenshot

Captures a display to an image file under ~/.flowly/screenshots/ and attaches it to the agent's reply automatically β€” it returns a media-envelope summary, not a raw file path. Parameters:

ParameterDescription
displayDisplay number to capture. 0 is the main monitor, 1 the secondary, etc. Default 0.
filenameOptional custom filename (without extension). Defaults to a timestamp-based name.
formatpng or jpg. Default png.

The capture rides the agent's own reply, so the agent does not call the message tool to send it β€” the tool's own description says so explicitly. (See Image generation for the same reply-media delivery on generated images.)

Limitations

Warning

Tool success means the helper call landed, not that the user-visible effect happened. Especially in terminal / TUI apps, a clear_and_type may be swallowed by the app's input handler. The agent should verify with read_focused_text / read_window_text rather than trust a success flag alone.

Note

FOCUS_LOST errors mean the target app dropped out of the foreground; the app must be re-activated and read_window_state re-issued before retrying.

Warning

Coordinate clicks are a fallback only. Clicking without an AX snapshot can fall into a legacy resolver that defaults to the screen origin.