Click on screen (macOS)¶
gravity click is in the macOS package since 0.1.6.
gravity click "INSTRUCTION" takes a screenshot of your main display and asks a running Granite Vision or Qwen3.5-4B server where INSTRUCTION is. It then shows a red dot there. You press Return to click on the dot. It runs on macOS only.
1. Start a model server¶
gravity click never starts a server. It sends the screenshot to one that is already running, at http://127.0.0.1:9931 unless you pass --server (see A server on another machine).
It picks a profile (prompt and answer format) from the model name the server reports: a name containing qwen gets the Qwen profile, any other name gets Granite. --profile granite or --profile qwen overrides.
Granite: ibm-granite/granite-vision-5.0-4b (Apache-2.0). Convert it with convert_hf_to_gguf.py from the gravity source: once with --outtype f16 for the text model, then again with --mmproj added for the vision projector. Serve the two files:
Add --lora ADAPTER.gguf to load an adapter. We have not published a grounding adapter yet. How close the dot lands depends on the model and adapter you load.
Qwen3.5-4B: gravity run qwen3.5-4b downloads the model (Q8_0) and its vision projector, checks both by sha256, and serves them at http://127.0.0.1:9931. To serve your own GGUFs, use the gravity serve command above.
2. Click¶
A red dot appears with the label "Return: click Esc: cancel". The terminal prints the point and waits; you do not type anything there.
- Return clicks on the dot.
- Esc, any other key, or 60 s without a key cancels. Nothing is clicked.
- Before the click,
gravity clickcaptures the screen under the dot again. If it changed since the screenshot, nothing is clicked. - If the dot cannot take keyboard focus, nothing is clicked.
- Ctrl-C in the terminal removes the dot. Nothing is clicked.
To see where it would click without clicking:
--dry-run prints one JSON line with no dot: the model's reply, profile, preset, the box (Granite only) and the screen point. --show 5 shows the dot for 5 s, then exits.
A server on another machine¶
On main, not in a release yet: 0.1.6 does not have --server or --api-key, so you need a build of main for this section.
--server URL sends the screenshot to a server on another machine, for example one you host on your own GPU. --api-key KEY adds Authorization: Bearer KEY to each request.
GRAVITY_BASE_URLandGRAVITY_API_KEYset the same from the environment; the flags win. A key in the environment does not show in the process list.--urlstill works and is the same as--server. A trailing/v1is fine.- Every run sends a screenshot of your screen to that server. The first time for each server (
scheme://host:port), gravity click asks in the terminal; typeyesto allow it. The answer is kept in~/Library/Application Support/gravity/remote-hosts. Without it, nothing is sent and gravity click exits. - With a key over plain
http, gravity click warns that the key and the screenshots are not encrypted. Use anhttpsURL. - Redirects are not followed, so the screenshot and the key go only to the server you allowed.
- A server on this machine (127.x,
localhost,::1) needs no answer.
Speed and precision¶
By default gravity click asks twice: once on the whole screenshot, then on a zoomed-in crop around the first answer. The second pass lands more often on small targets and takes longer. --no-zoom asks once.
Qwen has three presets. --preset fast is the default:
--preset |
s/click | ScreenSpot-Pro |
|---|---|---|
fast |
8.3 | 0.523 |
balanced |
13.7 | 0.609 |
precise |
40.6 | 0.671 |
Measured on M3 Pro, f16 model, 3024×1964 desktop, idle server, median of 10 prompts (gravity#123). Higher ScreenSpot-Pro score is better.
Granite has no presets: any --preset with Granite exits 2 ("--preset is for Qwen only").
Permissions¶
gravity click runs as the app "Gravity Click" (libexec/gravity/Gravity Click.app, no Dock icon). macOS gives the permissions to "Gravity Click", not to your terminal. Both are in System Settings > Privacy & Security:
- Screen Recording, for the screenshot.
- System & App Protection Override on macOS 27.3 and later (Accessibility before 27.3), for the click.
--dry-runand--showdo not need it.
The first run asks macOS for what is missing, opens System Settings, prints which toggles to switch on, and exits with code 3. Switch them on for "Gravity Click", then run gravity click again. You do not need to restart the terminal.
Release builds sign "Gravity Click" with the project's self-signed certificate, the same one every release, so the toggles stay on across updates. If you used an ad-hoc build before the first signed release, switch the toggles on once more after updating: macOS sees a new signature. A build from source is ad-hoc signed, and macOS treats each new build as a new app; if gravity click asks again after a rebuild, switch the toggles off and on again.
Options¶
| Option | What it does |
|---|---|
--server URL |
server to ask (default http://127.0.0.1:9931, or GRAVITY_BASE_URL); --url is the same |
--api-key KEY |
send Authorization: Bearer KEY (or GRAVITY_API_KEY) |
--dry-run |
print the result as one JSON line; no dot, no click |
--show SECONDS |
show the dot that long, then exit; never clicks |
--no-zoom |
ask once; skip the zoomed second pass |
--profile NAME |
granite or qwen (default: from the server's model name) |
--preset NAME |
Qwen only: fast (default), balanced or precise |
--image PNG |
use this image instead of a screenshot (tests) |
--scale S |
pixels per screen point (tests, with --image) |
gravity click --help prints the full list.
Exit codes¶
| Code | Meaning |
|---|---|
| 0 | clicked, or --dry-run / --show finished |
| 1 | cancelled; nothing clicked |
| 2 | usage error, no server at the URL, or the request failed |
| 3 | permission missing |
| 4 | the model's reply holds no box (Granite) or point (Qwen) |