Kira-Pgr/axiclick

AXI-compliant macOS mouse, keyboard, and screen automation for AI agents

8

stars

35

commits

JavaScript

primary language

Apr 10, 2026

updated

README

axiclick

Desktop automation for AI agents on macOS

See the screen. Find elements. Click precisely. No coordinate guessing.

npm macOS AXI License: MIT


axiclick demo — AI agent controlling iPhone Mirroring via SoM

Why axiclick?

Most desktop automation tools are built for humans scripting GUIs. axiclick is built for AI agents that need to control macOS apps — with token-efficient output, structured perception, and zero guesswork.

  • SoM (Set-of-Mark) perception — detects every UI element on screen, labels them with @id tags, and lets you click by ID instead of fragile pixel coordinates
  • Token-efficient — outputs TOON-formatted data designed for LLM context windows, not humans reading terminals
  • Full input control — mouse clicks, drags, keyboard shortcuts, text typing, scrolling — everything an agent needs
  • Accessibility tree access — query native macOS AXUIElement trees for apps that expose them
  • Agent session hooks — self-installs into Claude Code and Codex so agents start with axiclick context automatically

Quick Start

brew install cliclick        # required dependency
npm install -g axiclick      # install globally

Verify the install:

axiclick                     # shows mouse position, active window, display info

Your first SoM workflow

The core loop: screenshot → detect elements → click by ID → verify.

axiclick som-setup                    # one-time: download OmniParser V2 models (~2GB)
axiclick som-start                    # start the detection daemon

axiclick focus Safari                 # bring target app to front
axiclick wait 500
axiclick som /tmp/page.png            # detect all UI elements → labeled image
axiclick som-click @12                # click element #12 by ID
axiclick screenshot /tmp/verify.png   # confirm the result

Tip: If a nested surface like iPhone Mirroring is visible but not active, click inside that window first, then run som.

Install session hooks

Auto-inject axiclick context into every Claude Code and Codex session:

axiclick install

Commands

SoM — Set-of-Mark perception
CommandDescriptionExample
som-setupInstall OmniParser V2 models and venvaxiclick som-setup
som-startStart the warm SoM daemonaxiclick som-start
som-stopStop the warm SoM daemonaxiclick som-stop
som <path>Capture and annotate visible UI elementsaxiclick som /tmp/screen.png --no-caption
som-click @<id>Click a marked element from the last SoM passaxiclick som-click @3
Input — mouse, keyboard, text
CommandDescriptionExample
click <x>,<y>Left-clickaxiclick click 100,200
rclick <x>,<y>Right-clickaxiclick rclick 100,200
dclick <x>,<y>Double-clickaxiclick dclick 100,200
tclick <x>,<y>Triple-clickaxiclick tclick 100,200
move <x>,<y>Move cursoraxiclick move 500,300
drag <from> <to>Drag between pointsaxiclick drag 100,200 300,400
type <text>Type textaxiclick type "Hello"
key <key>Press a keyaxiclick key return
keydown <mods>Hold modifier keysaxiclick keydown cmd
keyup <mods>Release modifier keysaxiclick keyup cmd
combo <mod+key>Keyboard shortcutaxiclick combo cmd+c
submit [--at x,y]Submit input after dismissing suggestionsaxiclick submit --at 500,467
scroll <dir> [n]Scrollaxiclick scroll down 5
wait <ms>Waitaxiclick wait 500
run <raw>Raw cliclick passthroughaxiclick run "c:1,2 t:hi"

Coordinates support absolute (100,200), relative (+50,+0), and current position (.).

key <key> uses macOS System Events for web-relevant special keys like return, tab, and arrow keys so browsers receive real DOM key events reliably.

Perception — screenshots, windows, display
CommandDescriptionExample
screenshot <path>Capture screen to fileaxiclick screenshot /tmp/s.png
info <image>Show image dimensions and mapping metadataaxiclick info /tmp/s.png
probe <image> <x>,<y>Mark an image pixel and resolve screen coordsaxiclick probe /tmp/s.png 940,644
windowsList visible windowsaxiclick windows
activeShow focused app/windowaxiclick active
screenDisplay infoaxiclick screen
positionMouse coordinatesaxiclick position
color <x>,<y>Sample pixel coloraxiclick color 100,200
focusedShow the currently focused UI elementaxiclick focused

screenshot supports --region <x>,<y>,<w>,<h> and --display <n>. It writes a sidecar metadata file at <path>.json so info and probe can convert image pixels back into screen coordinates.

probe writes an annotated PNG with a crosshair. Add --click to click the resolved screen point.

windows supports --app <name> to filter.

Accessibility — AXUIElement tree
CommandDescriptionExample
snapshotAccessibility tree with UIDsaxiclick snapshot
ax-click @<uid>Click element by UIDaxiclick ax-click @5
ax-fill @<uid> <text>Set text field valueaxiclick ax-fill @7 "query"

snapshot supports --depth <n> to limit tree depth.

Note: Accessibility works best with native macOS apps (Finder, Safari, Xcode). Cross-platform apps (Electron, WeChat) may expose minimal trees — fall back to coordinate-based automation with screenshot + click.

Utilities — focus, session hooks
CommandDescription
focus <app>Bring app to foreground
installInstall Claude Code / Codex session hooks

When to Use axiclick

ScenarioWhy axiclick
Automate macOS apps with no CLI/APIFinder, WeChat, Xcode, System Settings
Sites that block headless browsersCloudflare, reCAPTCHA — real mouse/keyboard via actual display
iPhone Mirroring automationControl iOS apps through the macOS mirroring window
QA test any GUI applicationScreenshot → verify visual state programmatically

Agent Integration

Add to your CLAUDE.md or AGENTS.md:

Use `axiclick` for macOS desktop automation.

Requirements

RequirementDetails
OSmacOS 10.15+
RuntimeNode.js 18+
Dependenciescliclick (brew install cliclick)
SoM modelsPython 3, ~2GB disk (for som-setup)
Build toolsXcode Command Line Tools (compiles Swift helpers on first run)
PermissionsAccessibility for terminal app; Automation for System Events on first key use

Acknowledgments

  • cliclick by Carsten Blum — the macOS mouse/keyboard engine axiclick wraps. BSD 3-Clause licensed.
  • AXI — the agent ergonomic interface standard this tool follows.
  • OmniParser V2 by Microsoft — the vision model powering Set-of-Mark detection.

License

MIT — see LICENSE for details, including third-party notices.

Contributors

Kira-Pgr

35 commits

Kira-Pgr/axiclick

AXI-compliant macOS mouse, keyboard, and screen automation for AI agents

8

stars

35

commits

JavaScript

primary language

Apr 10, 2026

updated

README

axiclick

Desktop automation for AI agents on macOS

See the screen. Find elements. Click precisely. No coordinate guessing.

npm macOS AXI License: MIT


axiclick demo — AI agent controlling iPhone Mirroring via SoM

Why axiclick?

Most desktop automation tools are built for humans scripting GUIs. axiclick is built for AI agents that need to control macOS apps — with token-efficient output, structured perception, and zero guesswork.

  • SoM (Set-of-Mark) perception — detects every UI element on screen, labels them with @id tags, and lets you click by ID instead of fragile pixel coordinates
  • Token-efficient — outputs TOON-formatted data designed for LLM context windows, not humans reading terminals
  • Full input control — mouse clicks, drags, keyboard shortcuts, text typing, scrolling — everything an agent needs
  • Accessibility tree access — query native macOS AXUIElement trees for apps that expose them
  • Agent session hooks — self-installs into Claude Code and Codex so agents start with axiclick context automatically

Quick Start

brew install cliclick        # required dependency
npm install -g axiclick      # install globally

Verify the install:

axiclick                     # shows mouse position, active window, display info

Your first SoM workflow

The core loop: screenshot → detect elements → click by ID → verify.

axiclick som-setup                    # one-time: download OmniParser V2 models (~2GB)
axiclick som-start                    # start the detection daemon

axiclick focus Safari                 # bring target app to front
axiclick wait 500
axiclick som /tmp/page.png            # detect all UI elements → labeled image
axiclick som-click @12                # click element #12 by ID
axiclick screenshot /tmp/verify.png   # confirm the result

Tip: If a nested surface like iPhone Mirroring is visible but not active, click inside that window first, then run som.

Install session hooks

Auto-inject axiclick context into every Claude Code and Codex session:

axiclick install

Commands

SoM — Set-of-Mark perception
CommandDescriptionExample
som-setupInstall OmniParser V2 models and venvaxiclick som-setup
som-startStart the warm SoM daemonaxiclick som-start
som-stopStop the warm SoM daemonaxiclick som-stop
som <path>Capture and annotate visible UI elementsaxiclick som /tmp/screen.png --no-caption
som-click @<id>Click a marked element from the last SoM passaxiclick som-click @3
Input — mouse, keyboard, text
CommandDescriptionExample
click <x>,<y>Left-clickaxiclick click 100,200
rclick <x>,<y>Right-clickaxiclick rclick 100,200
dclick <x>,<y>Double-clickaxiclick dclick 100,200
tclick <x>,<y>Triple-clickaxiclick tclick 100,200
move <x>,<y>Move cursoraxiclick move 500,300
drag <from> <to>Drag between pointsaxiclick drag 100,200 300,400
type <text>Type textaxiclick type "Hello"
key <key>Press a keyaxiclick key return
keydown <mods>Hold modifier keysaxiclick keydown cmd
keyup <mods>Release modifier keysaxiclick keyup cmd
combo <mod+key>Keyboard shortcutaxiclick combo cmd+c
submit [--at x,y]Submit input after dismissing suggestionsaxiclick submit --at 500,467
scroll <dir> [n]Scrollaxiclick scroll down 5
wait <ms>Waitaxiclick wait 500
run <raw>Raw cliclick passthroughaxiclick run "c:1,2 t:hi"

Coordinates support absolute (100,200), relative (+50,+0), and current position (.).

key <key> uses macOS System Events for web-relevant special keys like return, tab, and arrow keys so browsers receive real DOM key events reliably.

Perception — screenshots, windows, display
CommandDescriptionExample
screenshot <path>Capture screen to fileaxiclick screenshot /tmp/s.png
info <image>Show image dimensions and mapping metadataaxiclick info /tmp/s.png
probe <image> <x>,<y>Mark an image pixel and resolve screen coordsaxiclick probe /tmp/s.png 940,644
windowsList visible windowsaxiclick windows
activeShow focused app/windowaxiclick active
screenDisplay infoaxiclick screen
positionMouse coordinatesaxiclick position
color <x>,<y>Sample pixel coloraxiclick color 100,200
focusedShow the currently focused UI elementaxiclick focused

screenshot supports --region <x>,<y>,<w>,<h> and --display <n>. It writes a sidecar metadata file at <path>.json so info and probe can convert image pixels back into screen coordinates.

probe writes an annotated PNG with a crosshair. Add --click to click the resolved screen point.

windows supports --app <name> to filter.

Accessibility — AXUIElement tree
CommandDescriptionExample
snapshotAccessibility tree with UIDsaxiclick snapshot
ax-click @<uid>Click element by UIDaxiclick ax-click @5
ax-fill @<uid> <text>Set text field valueaxiclick ax-fill @7 "query"

snapshot supports --depth <n> to limit tree depth.

Note: Accessibility works best with native macOS apps (Finder, Safari, Xcode). Cross-platform apps (Electron, WeChat) may expose minimal trees — fall back to coordinate-based automation with screenshot + click.

Utilities — focus, session hooks
CommandDescription
focus <app>Bring app to foreground
installInstall Claude Code / Codex session hooks

When to Use axiclick

ScenarioWhy axiclick
Automate macOS apps with no CLI/APIFinder, WeChat, Xcode, System Settings
Sites that block headless browsersCloudflare, reCAPTCHA — real mouse/keyboard via actual display
iPhone Mirroring automationControl iOS apps through the macOS mirroring window
QA test any GUI applicationScreenshot → verify visual state programmatically

Agent Integration

Add to your CLAUDE.md or AGENTS.md:

Use `axiclick` for macOS desktop automation.

Requirements

RequirementDetails
OSmacOS 10.15+
RuntimeNode.js 18+
Dependenciescliclick (brew install cliclick)
SoM modelsPython 3, ~2GB disk (for som-setup)
Build toolsXcode Command Line Tools (compiles Swift helpers on first run)
PermissionsAccessibility for terminal app; Automation for System Events on first key use

Acknowledgments

  • cliclick by Carsten Blum — the macOS mouse/keyboard engine axiclick wraps. BSD 3-Clause licensed.
  • AXI — the agent ergonomic interface standard this tool follows.
  • OmniParser V2 by Microsoft — the vision model powering Set-of-Mark detection.

License

MIT — see LICENSE for details, including third-party notices.

Contributors

Kira-Pgr

35 commits

Languages

JavaScript

48.1%

Swift

32.9%

Python

19.0%