Use the command line
Create, run, and drive machines with osmates in Terminal or a script.
Every command and option is in the Commands reference.
Set up Terminal
- Add the command line.
- Open a new Terminal window, then run
osmates --version.
Add --help to any command for its options. For an AI agent's shell, use osmates agent instead.
Create and start a machine
To list the images, create dev from the default one, and start it:
osmates vm images
osmates vm create dev
osmates vm start dev
Start a machine covers --no-window and --queue.
Commands take a machine's name or its identifier. osmates vm list lists your machines, and osmates vm info dev shows one. With --json, both give sizes in bytes.
To continue a creation that stopped, see If creating a machine stops. To delete a machine with its disk and snapshots, which you can't undo, run osmates vm delete dev.
Run a program
Put the program after --:
osmates vm exec dev -- uname -a
Add --desktop to run it as the user signed in at the screen. Control-C stops the program. The command exits with the program's status, as Read the exit status explains.
For long work, start a job with --detach, which prints a job identifier. Replace <job> with it to follow the job:
osmates vm exec --detach dev -- make -C /srv
osmates job status <job> --wait
osmates job output <job> --follow
osmates job cancel <job> stops a job, and osmates job list shows them all. Finished jobs stay for an hour.
Watch a machine
osmates vm events dev --follow
osmates vm logs dev --source console
osmates vm text dev
osmates vm wait dev --until stable
vm text reads the text on screen, with a bounding box for each piece.
Click and type in a machine
- Run
osmates vm screenshot dev --output screen.png. It prints a frame identifier. - Read the coordinates from the image, in pixels from the top-left corner.
- Click or type, with the frame identifier for
<frame>:
osmates vm click dev 250 150 --frame <frame>
osmates vm type dev "hello\n"
osmates vm key dev ctrl+c
The frame stops a click from landing after the display changed or the machine restarted. If the click is refused, take a new screenshot.
To act on a control by its reference instead, read the controls first. Wayland desktops return controls without positions.
osmates vm elements dev --mode interactive
osmates vm act dev <reference> set-value "hello"
If a command fails
An error lists commands that may fix it. For a failed machine, osmates vm info dev lists recovery steps.
If the error names another copy of the app, run the command it gives. Running the same command again fails.
To check an unfinished update, run osmates status, then see Update OSMates.
Commands
Every command of this build, with its options on its own page.
osmates statusShow whether osmatesd is running, the build it runs, the shared networks it owns, whether Time Machine backs up machines, where the image cache is, and what an update of OSMates waits for.osmates vmCreate, clone, start, list, change, suspend, stop and delete virtual machines, see and control them, and run programs, copy files and use the clipboard in their guests.osmates vm createCreate a machine from an image.osmates vm importImport a Windows, Linux or macOS machine another Mac app made, from its folder or a disk file.osmates vm exportWrite a shut-down machine's disk into a RAW or qcow2 file.osmates vm cloneMake a new machine from another, or from one of its snapshots, without copying its disk.osmates vm move-toMove a shut-down machine to the library on another volume.osmates vm volumesList the volumes machines are on or can go to.osmates vm startStart a machine by name, or from a spec file; a suspended machine resumes where it was.osmates vm listList virtual machines, and the machines being created with their progress or why they stopped.osmates vm infoDescribe a machine: its state, system, guest agent, addresses, whether macOS lets the agent use accessibility features, screen, snapshots, the space its disk, its bundle and each snapshot take, how busy a machine on the OSMates engine is and how much memory OSMates takes for it.osmates vm setChange a machine's settings, at once when it runs.osmates vm discInsert, change or eject the disc in a machine's DVD drive, while it runs or is shut down.osmates vm disc insertPut a disc in the drive, in place of the one there.osmates vm disc ejectTake the disc out of the drive.
osmates vm usbList, attach and detach the USB devices of this Mac a machine uses.osmates vm usb listList the devices given to OSMates and those the machine remembers.osmates vm usb attachAttach a device to a running machine, as if plugged in, and remember it.osmates vm usb detachDetach a device, as if unplugged, and forget it; a shut-down machine only forgets it.
osmates vm remount-sharesHave a running Linux or macOS guest mount its shares again.osmates vm suspendSave a running machine's memory and devices to its bundle and turn it off.osmates vm stopShut a virtual machine down.osmates vm restartShut a library machine down and start it again, with its window and network choice.osmates vm pauseHold a running machine's guest, its clock standing still, until it is resumed.osmates vm resumeLet a machine paused with its window or vm pause run again, with its clock set.osmates vm controlShow, pause, resume or end the agent's lease of a machine.osmates vm undo-sessionEnd the agent's session on a machine and return its disks to the snapshot it began with.osmates vm deleteDelete a stopped machine and its disk, or stop and delete a creation.osmates vm compactRewrite a stopped machine's disk image in fewer pieces, so snapshots and clones pause it for less time.osmates vm update-macosSave a running macOS machine, then install the macOS update Software Update offers it.osmates vm update-firmwareSave a stopped Windows machine, then update its firmware to Debian's newest EDK2.osmates vm egressShow or change what a machine may reach on the network.osmates vm imagesList the images machines can be created from, with their defaults.osmates vm sign-inType the account's password at a macOS or Windows machine's login or lock screen.osmates vm passwordKeep a new password for a macOS or Windows machine's account, read from standard input.osmates vm resizeChange the size of a machine's display, and a Windows or Linux machine's scale.osmates vm logsPrint the end of a machine's console, worker, event or egress log.osmates vm eventsPrint machines' events: state changes, resumes from saved memory, the guest agent, the login screen, prompts, compactions.osmates vm screenshotSave a PNG image of a machine's display.osmates vm textPrint the text on a machine's screen, each line with its box in display pixels.osmates vm elementsPrint the controls of a Windows, macOS or Linux desktop machine, each with its ref and box in display pixels.osmates vm actAct on a control of a Windows, macOS or Linux desktop machine by the refosmates vm elementsprinted.osmates vm waitWait until a machine's screen changes, or until it is still.osmates vm typeType text on the machine's keyboard, or paste it through the guest's clipboard.osmates vm keyPress keys, such as return, shift+a, ctrl+c, cmd+space or CTRL+ENTER.osmates vm moveMove the pointer.osmates vm clickClick at a point.osmates vm dragDrag through points.osmates vm scrollTurn the scroll wheel at a point.osmates vm execRun a program in a machine's guest.osmates vm copyCopy a file or a folder into or out of a machine's guest.osmates vm clipboardRead and write the clipboard of the user at a Windows, macOS or Linux machine's screen.osmates vm clipboard readPrint the text on the guest's clipboard, or save its image or copy its files.osmates vm clipboard writePut text, a PNG image or files on the guest's clipboard; text from standard input otherwise.
osmates snapshotTake, list, revert to, edit and delete snapshots of library machines.osmates snapshot createSnapshot a machine's disk, and its memory with --memory.osmates snapshot listList a machine's snapshots, oldest first.osmates snapshot revertReturn a machine to a snapshot.osmates snapshot deleteDelete a snapshot.osmates snapshot editRename a snapshot, or keep it from automatic deletion.osmates snapshot autoShow or change when a machine is snapshotted by itself.
osmates templateMake a shut-down machine a template that new machines are cloned from, list templates, turn one back into a machine, and push and pull templates through OCI registries.osmates template makeMake a shut-down machine a template.osmates template listList the templates, each with the machines made from it, or your organization's images.osmates template removeTurn a template back into a machine that starts and changes.osmates template pushPush a template to an OCI registry.osmates template pullPull a template from an OCI registry into the library.osmates template repositoriesShow or set the repositories your team's images come from.
osmates jobList, follow, read and cancel the long operations osmatesd runs as jobs.osmates job listList the jobs, oldest first.osmates job statusShow a job, or follow it to its end with --wait.osmates job outputPrint a job's output, and with --follow keep printing it until the job ends.osmates job cancelStop a job; a program it runs is killed.
osmates runRun a program in a throwaway clone of a machine.osmates codeOpen a coding agent in a Linux machine of its own, on a copy of a folder.osmates matrixRun one script in a throwaway clone of each of several machines, with a JUnit report.osmates runnerRun GitHub Actions and GitLab CI jobs, each in a throwaway clone of a machine or a template.osmates runner listList the GitHub runner pools and what each slot does.osmates runner addAdd a GitHub runner pool, whose slots fill at once.osmates runner removeRemove a GitHub runner pool, once its clones and runners are deleted.osmates runner gitlabThe stages of GitLab Runner's custom executor, each job in a throwaway clone.osmates runner gitlab configPrint the job's folders, clone and shell, as GitLab Runner's config stage reads them.osmates runner gitlab prepareClone the machine for the job and start it, as GitLab Runner's prepare stage.osmates runner gitlab runRun one of the job's scripts in its clone, as GitLab Runner's run stage.osmates runner gitlab cleanupDelete the job's clone, as GitLab Runner's cleanup stage, which runs after a failure too.
osmates workspaceCopy a folder into a machine, and take the guest's changes to it back as a git patch.osmates workspace pushCopy a folder of the Mac into a running machine as its workspace.osmates workspace diffTake what the guest changed in the machine's workspace as a git patch and a report.
osmates sshOpen a shell in a machine with ssh, or run a command there.osmates ssh-configShow, add or remove the Include that lets ssh reach your machines by name.osmates ssh-config showSay whether the Include is in ~/.ssh/config, and each machine's names.osmates ssh-config installAdd the Include for your machines at the top of ~/.ssh/config.osmates ssh-config uninstallRemove the Include for your machines from ~/.ssh/config.
osmates mcpServe the OSMates tools to AI agents over MCP, and register them with the agents.osmates mcp serveServe the OSMates tools to an AI agent over MCP on standard input and output.osmates mcp installRegister osmates as an MCP server with an AI agent.osmates mcp uninstallRemove osmates from an AI agent's MCP servers.osmates mcp clientsList the AI agents osmates can register with, and the profile each has.
osmates agentDrive machines as an AI agent, in an agent's session, with what the MCP tools return.osmates agent screenshotTake a screenshot, or zoom into a region; standard error names the image.osmates agent waitWait until the screen changes, or until it is still.osmates agent textRead the text on the screen, with a box for each line.osmates agent elementsList the controls on the screen, with refs and boxes, in Windows, macOS and a Linux desktop.osmates agent actAct on a control by the ref elements gave it.osmates agent clickClick at a point.osmates agent moveMove the pointer.osmates agent dragDrag through points.osmates agent scrollTurn the scroll wheel at a point.osmates agent keyPress keys, such as return, shift+a, ctrl+c or cmd+space.osmates agent actionsSend a batch of input actions, as input_actions takes them.osmates agent typeType text, as keystrokes or through the guest's clipboard.osmates agent clipboardRead or write a machine's clipboard.osmates agent clipboard readRead the clipboard; standard error names an image it holds.osmates agent clipboard writePut text, an image or both on the clipboard.
osmates agent resizeChange the display's size; take a new screenshot after.osmates agent sign-inSign in to the machine's desktop with its password.osmates agent callRun any OSMates tool with its MCP arguments, as one JSON object.osmates agent toolsList the OSMates tools, or print one's description and arguments.osmates agent guidePrint how to use the OSMates tools, as MCP clients read it.
osmates agentsList, allow and revoke what AI agents' programs may do with machines.osmates agents listList the agents' programs OSMates has seen, their grants and the questions open now.osmates agents allowAllow an agent's program to use a machine, or to make new ones.osmates agents revokeTake back what an agent's program may do, at its next call.osmates agents profileSet the profile that bounds every session of an agent's program, from its next call.
osmates auditShow, check and export the audit trail of what agents and you did with machines.osmates audit showShow the trail, or a machine's records, oldest first, or newest first with --newest-first.osmates audit machinesList every machine in the trail, deleted ones and throwaway clones among them.osmates audit verifyCheck the trail's chain, its heads in the system log and copies kept elsewhere.osmates audit exportExport the trail, or a time range of it, as JSON Lines with each record's hash.osmates audit scheduleShow, set or turn off the daily export of the trail into a folder.
osmates recordingsList, show and export recordings of agents' sessions.osmates recordings listList recordings, oldest first, or a machine's.osmates recordings showShow a recording's steps, a line each, without what its programs printed or its trees.osmates recordings exportExport a recording as an ATIF v1.6 trajectory.
osmates trajectoryRun an agent's task in throwaway clones as trajectories, and pack them for training.osmates trajectory runRun one task on several throwaway clones and write a trajectory entry for each.osmates trajectory captureWrite one recording as a trajectory entry, with its task and outcome.osmates trajectory exportPack trajectory entries for training, with a manifest and checksums.
osmates diagnosticsSave a zip of the logs, reports and versions of OSMates to attach to an issue.osmates backupsPut machines in Time Machine backups, or leave them out.osmates backups includeBack up every machine with Time Machine.osmates backups excludeLeave every machine out of Time Machine backups.
osmates settingsShow or change the settings of OSMates itself.osmates settings image-cacheShow where downloaded images are kept, or move them to another folder.osmates settings image-cache showSay where the image cache is and what it holds.osmates settings image-cache moveMove the image cache to a folder, or back to its default folder.
osmates remoteServe the MCP tools over HTTP on this Mac, pair it with your other Macs, and reach it from a browser.osmates remote statusSay whether Local and This Network are on, where clients connect, the paired Macs and this Mac's key.osmates remote setTurn MCP over HTTP on this Mac, This Network, the tailnet browser or Cloud Clients on or off.osmates remote tokensList the tokens you made, never their secrets.osmates remote tokenMake or revoke a token for an MCP client.osmates remote token createMake a token for an MCP client on this Mac, and print it once.osmates remote token revokeRevoke a token; its clients' sessions end at once, with their leases.
osmates remote connectionsList the sessions of MCP clients over HTTP and of agents on paired Macs.osmates remote devicesList the Macs and passkeys that may connect to this one and the Macs this one reaches, with their keys.osmates remote pairPair this Mac with another of yours.osmates remote unpairUnpair a Mac or remove a passkey, by its name or id asosmates remote deviceslists it.osmates remote keyAllow this Mac's device key again, or make a new one.osmates remote key allowShow the keychain's dialog for this Mac's device key, and listen again once you allow it.osmates remote key newMake a new device key for this Mac; every paired Mac pairs again.
osmates remote passkeyAdd a passkey for a browser in your tailnet.osmates remote passkey addPrint a link that adds a passkey; open it on the phone or computer within 10 minutes.
osmates remote clientsList the cloud clients you allowed, or revoke one.osmates remote clients listList the cloud clients you allowed, never their tokens.osmates remote clients revokeRevoke a cloud client; its sessions end at once, with their hold on machines.
osmates credentialKeep tokens and passwords for services in your Keychain, out of your machines.osmates credential listList your credentials, their hosts and the machines they are granted to, never their values.osmates credential addAdd a credential, reading its value from standard input or the terminal.osmates credential changeChange a credential's variable, its value, or its hosts with a new value.osmates credential removeRemove a credential from the Keychain, revoking it on every machine first.osmates credential grantGrant a credential to a machine, whose programs see only its placeholder.osmates credential revokeRevoke a credential from a machine, or from every machine with --all.osmates credential trustHave a running machine trust the OSMates credential authority, or remove it with --remove.
osmates accountShow this Mac's edition and account, sign in or out, and activate it without internet.osmates account showShow this Mac's edition, why it runs it, and its account.osmates account sign-inSign this Mac in to its TablePro Account.osmates account sign-outSign this Mac out of its account.osmates account macsList the Macs that use the account, this Mac first.osmates account remove-macRemove a Mac from the account, which frees its place for another Mac.osmates account refreshAsk the account service now rather than at osmatesd's next daily check.osmates account machine-idPrint the machine ID that an activation file is made for.osmates account importActivate this Mac without internet with an activation file.
osmates policyShow the keys your organization manages through its MDM.