npx ghosthand --help
-l.ghosthand list (which iPhones, locked, leased by whom)ghosthand acquire -d <id> --label <session id> --reason "<task>" (prints e.g. studio:42 (42 below))ghosthand screentext -l 42 (read text and boxes (cheap, no image))ghosthand screenshot -l 42 -o s.png (or look at the screen (~500 tokens))ghosthand tap -l 42 --text "Label" --screenshot s.png --screentextghosthand tap -l 42 <x> <y> --screenshot s.png --screentext (x,y read from s.png)ghosthand release -l 42 (when the task is done)| Option | Description |
-l, --lease [id] | Lease id from ghosthand acquire (or GHOSTHAND_LEASE) with its Mac, e.g. studio:42 for an iPhone on Mac studio. Every command that uses an iPhone needs it and runs on its iPhone |
-h, --help | Display this message |
-v, --version | Display version number |
ghosthand file push. MCP tool names join the words with -.| Command | What it does |
list | List iPhones connected over USB, to this Mac and to the account's other Macs |
acquire | Take exclusive use of an iPhone for a task. Prints a short lease id; pass it explicitly with -l to every other command |
wait | Wait until another lease on the iPhone ends, then acquire it. Use only after acquire said it is busy and you decided to wait |
release | End the lease from -l or GHOSTHAND_LEASE, so another client can acquire the iPhone |
| Command | What it does |
screenshot | Save the current iPhone screen as PNG (or JPG) over USB, in about 0.3s |
screentext | Read the text on the iPhone screen with on-device OCR. One line per text: x,y wxh text in screenshot coordinates (same space as tap) |
| Command | What it does |
tap | Tap at screenshot coordinates or on text found by OCR, via the AssistiveTouch mouse pointer |
double-tap | Double tap at screenshot coordinates or on text found by OCR, via the AssistiveTouch mouse pointer |
triple-tap | Triple tap at screenshot coordinates or on text found by OCR, via the AssistiveTouch mouse pointer |
hold | Press and hold (long press) at screenshot coordinates or on text found by OCR, via the AssistiveTouch mouse pointer |
swipe | Swipe a finger like a person from (x1,y1) to (x2,y2) in screenshot coordinates: fast, lifted while moving. For TikTok, feeds, lists, carousels, Home Screen pages |
hold-drag | Long press at (x1,y1), then drag to (x2,y2) with the button still held: moves items that need a long press first, like Home Screen icons |
scroll | Scroll with the Bluetooth mouse wheel over a point (default: screen center). Use this to scroll web pages and lists; one tick is about 100 points |
key | Press a key on the Bluetooth keyboard: home (Home Screen), enter, backspace, esc, arrows, volumeup. cmd+space opens Spotlight to open apps |
type | Type text on the Bluetooth keyboard (US-ASCII) |
| Command | What it does |
task | Do a task in plain words: a fast agent on ghosthand.dev reads the screen with OCR and taps until it is done, then answers |
| Command | What it does |
wake | Turn the display on with a Bluetooth click at the status bar, then check that USB frames arrive |
lock | Lock the iPhone over Bluetooth with Control-Command-Q; verify over USB |
unlock | Unlock with the Bluetooth keyboard: Enter, Enter, passcode, then check the lock state over USB (~3s). A wrong passcode is not retried |
mute | Mute all iPhone sound (media in every app too) with the Bluetooth keyboard Mute key, confirmed from the iPhone log over USB |
unmute | Turn iPhone sound back on after mute, confirmed from the iPhone log over USB |
assistivetouch | Show, or turn on or off, AssistiveTouch over USB (no touch on the phone, also while locked). acquire turns it on, release turns it off |
rename | Set the iPhone's name over USB (Settings > General > About > Name), no touch needed |
forget | Remove this Mac's Bluetooth bond with the iPhone, to pair again from scratch |
control | Show or switch how input reaches the iPhone: Bluetooth mouse and keyboard (default) or XCTest (WebDriverAgent). Switch only when the user asks |
info | Show battery, storage, iOS build, serial number, language, time zone and SIM over USB (works while locked) |
logs | Read the iPhone system log over USB for a few seconds, filtered by process or text |
restart | Restart the iPhone over USB. Afterwards a person must type the passcode once |
shutdown | Turn the iPhone off over USB. Only a person can turn it on again |
| Command | What it does |
record start | Start recording the iPhone screen and sound to a new .mov or .mp4 file. Stops by itself after 5 minutes; stop earlier with record stop |
record stop | Stop the screen recording and wait until the file is complete. Prints path, duration, size, resolution and fps |
| Command | What it does |
file list | List a folder on the iPhone over USB (AFC): /DCIM, /Downloads, or an app's /Documents with --app |
file pull | Copy a file or folder from the iPhone to this Mac over USB |
file push | Copy a file from this Mac to the iPhone over USB, replacing it and making missing folders |
file remove | Remove a file, or a folder with everything in it, on the iPhone over USB |
photo list | List the newest Camera Roll files (photos, videos, screenshots) on the iPhone, newest first |
photo pull | Copy the newest Camera Roll files (photos, videos, screenshots) from the iPhone to this Mac |
photo delete | Delete photos from the iPhone's Photos library by file name (from photo list), over USB |
upload | Upload a photo or video to a 1-day link that Safari on the iPhone saves to Photos (Save Video, Save Image) |
app list | List installed apps over USB, with where each icon is on the Home Screen |
app install | Install an .ipa signed for this iPhone over USB (ad hoc, enterprise or development signing) |
app uninstall | Uninstall an app and its data over USB, like Remove App > Delete App |
| Command | What it does |
setup | Open the setup window: connect a new iPhone over USB and Bluetooth, step by step |
setup status | Read setup readiness as JSON, including missing permissions and disconnected phones; no lease needed |
account | Show this Mac's ghosthand.dev account: who is signed in, the plan, and the subscribe link |
account login | Sign this Mac in to ghosthand.dev in the browser. For people; agents run ghosthand setup instead |
account logout | Sign this Mac out of ghosthand.dev; leases fail until it signs in again |
dashboard | Open the control plane window: every iPhone, which agent uses it and why, and its live screen |
| Command | What it does |
tunnel url | Print this Mac's tunnel URL, to call the HTTP API from a script (curl, Linux). --new-token also creates the API token |
tunnel revoke | Revoke an API token made with tunnel url --new-token; scripts that use it get 401 |
| Command | What it does |
daemon start | Start the background daemon. Other commands start it on demand |
daemon stop | Stop the daemon |
daemon restart | Restart the daemon |
daemon status | Show daemon state, listeners, Bluetooth state and the log path |
daemon run | Run the daemon in the foreground (for launchd or debugging) |
| Command | What it does |
random | Make a random name, lastname, username, birthdate (18+) or password for a new account, saved with the lease. random list shows every saved value |
ghosthand --help, and as the MCP server instructions.ghosthand setup once and tell
the user to complete setup in the small Ghosthand window. Poll setup status
every 2 seconds until ready is true, then continue automatically. Do not request
permissions yourself. No normal command or preview shows permission dialogs.ghosthand wait. Never --force unless its holder is
gone. A lease ends after 10 min without a command.
Pass -l explicitly: tool-call environments may not persist. --label is display only.type, read a screenshot: the cursor must be in the field you want. Keys go
to the focused field (in Messages, Enter in To: keeps focus there).ghosthand setup, tell the user to sign in there, poll
setup status. subscription-required: show the user the links in the error, acquire
again after they change the plan; never retry in a loop. Do not run account login yourself.ghosthand random <kind>
(name, lastname, username, birthdate, password). Never invent a password. Every
value is saved: ghosthand random list finds one you forgot.key: cmd+a then backspace clears a field, alt+backspace,
cmd+shift+left, cmd+c, cmd+z, fn+h (Home), fn+up (App Switcher), fn+c (Control
Center), fn+n (notifications). Full list: ghosthand key --help.key home, not the AssistiveTouch menu.tap 207 100) to restore it. Check this before anything else.screenshot --native takes a real iOS screenshot (cmd+shift+3) that shows it, at the
same coordinates tap takes. A button that ignores tap: press it once more (tap or
hold x y --duration 400); a just-opened alert can ignore the first press.hold x y. Move an
item that needs a long press first (Home Screen icons): hold-drag --hold 2500.ghosthand upload <file>, then Safari (upload --help).lock, then unlock once
to dismiss it without accepting an option (tested on an XR, iOS 18.7).
First obtain a user-confirmed passcode and pipe it to unlock --stdin.
Without one, ask the user before locking. Check the screen afterward; this may
not dismiss every dialog. Never retry a failed passcode or guess hidden taps.scroll down <ticks> (mouse wheel, ~100 pt per tick). swipe
moves content by the drag length (no momentum): use it for pages and short moves.key cmd+space, type <app name>, key enter (works from any app;
tested on an SE2, iOS 18.6). Faster than swiping Home Screen pages.list shows xctest) takes the same commands through
Apple's UI testing instead of Bluetooth. No lock, unlock, mute or shortcuts there; see
control --help. Switch modes only when the user asks.list, or errors about USB, Trust, a never-paired iPhone, or
Bluetooth that never connects: the user must connect or fix the phone. Run
ghosthand setup once (MCP: use the setup tool). Tell the user to complete setup
in the small Ghosthand window. All actions in the Ghosthand app window are user-only. Agents must not interact with the window or complete setup for the user. Poll ghosthand setup status (MCP: setup-status) every 2 seconds until ready is true. Pass --device (MCP: device) for the intended iPhone if known or if several are connected; use the returned device id on later polls. When ready, acquire that phone using its captureId from overview. Wait while the user completes setup, then continue automatically when ready. Do not reopen setup, request permissions, or retry input while waiting. If setup is still incomplete after 10 minutes, report the current status instead of retrying forever. Do not tap Trust or pair for them. A locked iPhone that is trusted
and paired is not a setup problem: use unlock only with a passcode the user
confirmed, otherwise ask the user to unlock it. ghosthand dashboard is a window to
watch every iPhone and its agent; open it only if the user asks to see it.