Run a macOS VM in your terminal for AI agents with terminal-mac
By Flavio
Tagged: Mac
terminal-mac runs a macOS guest inside your terminal, so an agent drives that VM instead of your desktop. Install, setup, MCP tools and isolation limits.
The first time you let an agent use a computer, it clicks around in the same desktop where your email is signed in, your password manager is unlocked, and your bank tab is open.
On 3 November 2026, govi published terminal-mac, a tool that runs a full macOS virtual machine inside your terminal and gives an agent computer use inside that VM. As the announcement post puts it: “give your agent its own Mac, and keep yours”. It’s MIT licensed.

Both screenshots in this post are stills from the launch video. They show the interactive viewer rather than an agent driving the guest.
How it works
terminal-mac is a Swift app around Apple’s Virtualization framework, and it boots a real macOS guest rather than a container.

A small helper app installed inside the guest captures its screen and posts input events into it.
The viewer is what makes it feel different. The guest screen streams straight into your terminal using the Kitty graphics protocol or iTerm2 inline images, so the virtual Mac sits inline in Ghostty, Kitty, or iTerm2 right next to your shell. In any other terminal, you get a normal VM window instead.
In the launch video, you see the viewer in manual use: a header with the resolution and a live frame counter, and a footer logging each click and scroll. Connecting an agent is the part you set up yourself.
Agents talk to that same guest helper, so they never reach your host’s pointer, keyboard, clipboard, or screen APIs. Here’s how the pieces connect:
What you need
- An Apple silicon Mac running macOS 14 or later.
- Internet access on the first run, because the first boot downloads a macOS restore image from Apple. It’s several GB, and terminal-mac caches it after that.
- Disk space and memory to spare. The VM disk is 64 GiB sparse by default, and the guest uses your host CPU and RAM while it runs.
- No developer tools for a prebuilt release. Building from source needs Xcode 16 or later and Swift 6.
Install and first run
The installer verifies the SHA-256 checksum for the release it downloads, puts a launcher in ~/.local/bin, and stores the runtime in ~/.local/lib/terminal-mac. It doesn’t need administrator rights and won’t edit your shell config. To get started, run:
curl -fsSL https://github.com/govijr/terminal-mac/releases/latest/download/get.sh | bash
terminal-mac up
terminal-mac up downloads a compatible restore image, installs the virtual Mac, boots it, and opens the VM window. Later runs reuse the same machine and reconnect to it.
That first run takes a while. Packaging can’t skip downloading and installing a full copy of macOS.
The one-time setup inside the guest
This step isn’t automatic yet. Walk through macOS Setup Assistant in the VM window and create an account inside the guest. Then open Finder inside the VM, go to /Volumes/My Shared Files/tools, and open TerminalMacGuest.app. The helper installs itself in the guest’s ~/Applications and registers to start at login.
The helper app has two buttons for the permissions it needs, Screen Recording and Accessibility, which you grant inside the guest’s own System Settings. Your host Mac doesn’t need either permission. Once both are on, the CLI switches over to the terminal viewer.
Setup is guided rather than unattended because this build targets the macOS 26 SDK, while Apple’s automatic account provisioning is documented for macOS 27 guests.
If you want more than one machine, terminal-mac up work creates another. --offline skips the guest network device, --cpus, --memory, and --disk size it, and terminal-mac ls lists what you have.
Giving an agent control
The MCP server is the main way to connect an agent. It exposes screenshot, click, drag, scroll, type, key, and status.
For Claude Code, one plugin installs the server and a skill covering the observe, act, verify loop:
/plugin install terminal-mac --marketplace govijr/terminal-mac
For Cursor, Codex, VS Code, or any other MCP client, paste the output of this into the client’s MCP settings:
terminal-mac mcp --config
If you prefer the CLI, every action is a command that prints JSON, which makes it easy to script or read in a log:
terminal-mac action default screenshot --output /tmp/guest.png
terminal-mac action default click 640 400
terminal-mac action default type 'Hello from the agent'
terminal-mac action default key cmd+space
Coordinates are pixel positions in the last screenshot from a top-left origin. Screenshots use guest display points, so the same numbers work on a Retina display.
There’s also a standalone skill. terminal-mac skills install drops it in ~/.claude/skills/terminal-mac/ for Claude Code. For another agent’s skills folder, pass --dir with that folder’s path, or run npx skills add govijr/terminal-mac --skill terminal-mac. It teaches the same loop you’d write for an agent yourself: open apps with cmd+space, type the name and press return, and take a fresh screenshot after each step that mattered.
What the isolation covers
The guest is a separate Mac with its own apps, files, accounts, and permissions. It doesn’t inherit your host apps or your signed-in sessions. Your host home folder, project folders, clipboard, microphone, and camera aren’t attached. The guest sees two shares only: a read/write control share for requests, replies, and screenshots, and a read-only tools share holding the helper app.
The helper refuses to run unless the hardware model starts with VirtualMac. That stops you from running it on your own Mac by accident, though it isn’t hardware attestation or a defence against a compromised host.
There’s no remote-control network listener. The mailbox between host and guest pins its directory and rejects symlinks, hardlinks, and non-regular files.
Networking is the weak spot. Default NAT gives the guest internet access and may let it reach services on your host or local network, so this is not a network-isolated or hardened hostile-code environment. Passing --offline removes that network path, at the cost of some macOS setup flows and anything that needs the internet.
That keeps an agent out of your desktop, session cookies, and files, without turning the guest into a sandbox for code you already suspect is malicious.
What it costs
The VM uses your CPU, memory, and storage while it runs, so use pause and resume when you aren’t using it.
Releases are self-signed and aren’t notarized by Apple. The curl installer doesn’t need notarization, and a stable signing identity is what keeps the guest helper’s permissions across rebuilds.
The project is still an early release candidate, and live guest acceptance on a clean Mac is still pending. VM cloning, rollback checkpoints, accessibility snapshots, fully unattended guest setup, terminal splits, and tmux transport are all future work. Right now, snapshot is just a screenshot alias rather than an accessibility tree.
Where it fits
If your agent has to test a Mac app, walk through a website as a signed-out user, or try a flow you don’t want in your own account, a separate Mac is the straightforward answer.
There are other ways to get computer use on a Mac. agent-desktop drives your real desktop through the accessibility tree with stable refs, which is fast and precise, though it’s still your desktop. Browser-only work is better served by a dedicated browser setup. terminal-mac is the option for when the agent needs the whole Mac and the whole Mac should be disposable.
Whatever machine the agent is on, the rules in what I let agents do unattended still apply. A separate Mac lowers the cost of a mistake, but an email sent or a purchase made from the guest is still real.
Trying it
- Make sure you’re on Apple silicon and macOS 14 or later.
- Run the installer, then
terminal-mac up. Start the macOS download before you need the VM. - Do the guest setup, including both privacy permissions inside the guest.
- Register the MCP server with your agent, and ask it to take a screenshot and describe what it sees.
- Then ask it to open Safari and load a page, and watch the frames in your terminal.
The repo is at github.com/govijr/terminal-mac. There’s a sibling project, terminal-phone, that does the same thing for iOS simulators and real iPhones.
Want me to talk about your product? You can sponsor this site.
Related posts about mac: