[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-107916":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":9,"rankLanguage":9,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":9,"pushedAt":26,"updatedAt":27,"readmeContent":28,"aiSummary":29,"trendingCount":15,"starSnapshotCount":15,"syncStatus":30,"lastSyncTime":31,"discoverSource":32},107916,"terminal-mac","govijr\u002Fterminal-mac","govijr","Entire MacOS running in your terminal.",null,"Swift",2942,211,6,7,0,11,137,1075,52,108.98,"MIT License",false,"main",true,[],"2026-11-10 06:06:50","2026-11-23 18:58:46","# terminal-mac\n\n[![](https:\u002F\u002Fimg.shields.io\u002Fstatic\u002Fv1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86)](https:\u002F\u002Fgithub.com\u002Fsponsors\u002Fgovijr)\n\u003Ca href=\"https:\u002F\u002Fbuymeacoffee.com\u002Fgovijr\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Fwww.buymeacoffee.com\u002Fassets\u002Fimg\u002Fcustom_images\u002Forange_img.png\" alt=\"Buy Me A Coffee\" style=\"height: 21px !important;width: 108px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;\" >\u003C\u002Fa>\n\n\nA separate macOS desktop for computer-use agents, viewed and controlled from a terminal.\n\n`terminal-mac` is an early release candidate for Apple silicon. Apple Virtualization runs a real macOS guest. A bundled helper **inside that guest** captures its screen and posts input events. A terminal viewer streams that screen using Kitty or iTerm2 graphics. Agent commands use the same helper without moving the physical Mac's pointer or changing its clipboard.\n\nThe guest is a separate Mac: it has its own apps, files, accounts and permissions. It does not inherit your running host apps or signed-in sessions. The VM still consumes host CPU, memory and storage.\n\n## Requirements\n\n- Apple silicon Mac, macOS 14 or later.\n- No development tools are needed for a prebuilt release. Maintainers need Xcode 16 or later \u002F Swift 6 to build.\n- Internet on first run to download macOS directly from Apple, or an existing compatible `.ipsw`.\n- Space for the cached restore image and a growing VM disk (64 GiB logical size by default).\n- Ghostty, Kitty or iTerm2 for the inline viewer. Other terminals can use the native VM window and agent CLI. tmux passthrough and automatic terminal splits are not implemented.\n\n## Install and run\n\n```sh\ncurl -fsSL https:\u002F\u002Fgithub.com\u002Fgovijr\u002Fterminal-mac\u002Freleases\u002Flatest\u002Fdownload\u002Fget.sh | bash\n```\n\nThe installer downloads the latest release and verifies its SHA-256 before installing. You can also extract a release ZIP and run `bash install.sh` from it.\n\nThe installer places one launcher in `~\u002F.local\u002Fbin` and the bundled runtime under `~\u002F.local\u002Flib\u002Fterminal-mac`. Add `~\u002F.local\u002Fbin` to your PATH to use simply `terminal-mac`. It needs no administrator rights and does not edit your shell configuration. `bash install.sh --prefix \u002Fabsolute\u002Fpath` selects another location.\n\nRunning `terminal-mac` in an interactive terminal starts the guided flow. `terminal-mac up` does the same explicitly. It automatically downloads\u002Fcaches a compatible Apple restore image, installs a virtual Mac, boots it and checks the guest helper. Later runs reuse the existing VM and reconnect. Unsupported terminals get the native desktop window.\n\n**Current status:** early release candidate. Releases are self-signed (no Apple notarization), which the curl installer doesn't need. Live guest acceptance on a clean Mac is still pending.\n\n## Use with agents\n\nterminal-mac gives agents computer use in a separate virtual Mac, through MCP tools (`screenshot`, `click`, `drag`, `scroll`, `type`, `key`, `status`) and a skill that teaches the observe → act → verify loop.\n\n**Claude Code**, with the MCP server and skill in one plugin:\n\n```text\n\u002Fplugin install terminal-mac --marketplace govijr\u002Fterminal-mac\n```\n\nOr add them separately:\n\n```sh\nclaude mcp add terminal-mac -- terminal-mac mcp\nterminal-mac skills install                 # → ~\u002F.claude\u002Fskills\u002Fterminal-mac\u002FSKILL.md\n```\n\n**Other MCP clients** (Cursor, VS Code, Codex, Windsurf…): paste the output of `terminal-mac mcp --config` into the client's MCP settings. Use `terminal-mac mcp NAME` for a VM other than `default`.\n\n**Any agent with a skills folder:** `terminal-mac skills install --dir PATH`, or `npx skills add govijr\u002Fterminal-mac --skill terminal-mac`. In an `AGENTS.md`, a line like \"Before using the virtual Mac, run `terminal-mac skills get`\" gives the agent instructions that match the installed version.\n\nThe tools only drive the guest helper. They never touch your own desktop. When the guest is at its login screen, they say so, so the agent can ask you to sign in.\n\n## One-time guest setup\n\nThe first run opens the virtual Mac's window. Complete macOS setup and create its user account. Inside the guest, open Finder → `\u002FVolumes\u002FMy Shared Files\u002Ftools` → `TerminalMacGuest.app` once. The helper installs itself in the guest's `~\u002FApplications`, launches that installed copy and registers for future guest logins, subject to macOS approval.\n\nUse its two buttons to grant **Screen Recording** and **Accessibility** inside the guest. Reopen it if macOS asks. If needed, its **Guest Login Items** button opens the startup setting. The host needs neither privacy permission. Once both guest permissions are ready, the CLI automatically continues to the terminal desktop.\n\nThis is guided setup, not an unattended guest installation. Apple documents automatic account provisioning for macOS 27 guests; this build targets the APIs available in the installed macOS 26 SDK and does not implement that newer flow. See [Apple's provisioning documentation](https:\u002F\u002Fdeveloper.apple.com\u002Fdocumentation\u002Fvirtualization\u002Fvzmacguestprovisioningoptions).\n\n```sh\nterminal-mac up work                  # another virtual Mac\nterminal-mac up --ipsw \u002Fpath\u002Fmac.ipsw  # use a local image\nterminal-mac up --no-view             # wait for agent readiness, then return JSON\nterminal-mac up --detach              # install\u002Fboot, return without waiting for guest setup\nterminal-mac up --plan                # show steps without network access or disk changes\n```\n\nThe first download may take time; packaging cannot eliminate downloading and installing macOS. The image cache is reused, and URLSession resume data is retained after recoverable network failures. A hard process kill may require the current download to restart. An incomplete installation with recorded hardware can be retried by `up` using a compatible restore image; an already installed VM is never reinstalled by `up`.\n\n## Build from source\n\n```sh\nbash scripts\u002Fbuild.sh\n.\u002Fdist\u002Fterminal-mac doctor\n```\n\nThe build creates `dist\u002FTerminalMac.app`, including `TerminalMacGuest.app`, and the `dist\u002Fterminal-mac` launcher. Virtualization needs the host executable's `com.apple.security.virtualization` entitlement; use the packaged launcher instead of the unsigned Swift build product.\n\nIt is signed with the self-signed \"Govijr Code Signing\" identity when your keychain has it (`bash scripts\u002Fcreate-signing-identity.sh` makes one), and ad-hoc otherwise. A stable identity keeps the guest helper's permissions across rebuilds; ad-hoc builds need them granted again. [RELEASING.md](RELEASING.md) covers signing and publishing.\n\n## Create your first Mac\n\n```sh\n# Show the URL and version without downloading anything:\n.\u002Fdist\u002Fterminal-mac image\n\n# Explicitly download Apple's latest supported restore image (several GB):\n.\u002Fdist\u002Fterminal-mac image --output \u002Ftmp\u002FRestoreImage.ipsw\n\n# Install macOS. The disk is sparse, and the IPSW is not copied into the VM bundle.\n.\u002Fdist\u002Fterminal-mac create default --ipsw \u002Ftmp\u002FRestoreImage.ipsw\n.\u002Fdist\u002Fterminal-mac start default --window\n```\n\nComplete macOS Setup Assistant in the VM window and create a guest account. Inside the guest:\n\n1. Open Finder → `\u002FVolumes\u002FMy Shared Files\u002Ftools`.\n2. Open `TerminalMacGuest.app`. It installs itself to the guest's `~\u002FApplications` and opens the installed copy.\n3. Use the helper's buttons to grant **Screen Recording** and **Accessibility** in the guest's System Settings. Reopen the helper if macOS asks. The host does not need either permission.\n4. Keep the guest logged in and the helper running. It registers itself for guest login; approve that setting if macOS requests it.\n\nOn the host:\n\n```sh\n.\u002Fdist\u002Fterminal-mac action default status\n.\u002Fdist\u002Fterminal-mac hide default\n.\u002Fdist\u002Fterminal-mac view default\n```\n\nThe viewer supports typing, left\u002Fright clicks, double and triple clicks, dragging, scrolling, arrows and common control keys. **Ctrl+G** opens a palette of Mac shortcuts (Spotlight, Mission Control, copy\u002Fpaste, close\u002Fquit and more), because terminals keep ⌘ for themselves. **Ctrl+]** exits the viewer while the VM keeps running. Closing the native VM window hides it and also leaves the VM running.\n\nThe guest helper keeps a ScreenCaptureKit stream open while a viewer is watching. It sends a frame only when the screen changes (up to 30 fps), already sized to the pixels the terminal draws, as lossless lz4-compressed pixels. Kitty and Ghostty receive those frames through shared memory rather than the pty. An idle desktop costs nothing, and the stream stops 15 seconds after the viewer leaves. From build 4 on, the guest helper updates itself: within 30 seconds of a newer build appearing in the shared tools folder, it installs that build and relaunches. Helpers from build 3 and earlier still work but poll full screenshots, and the header shows \"snapshots\". Update those once by opening `\u002FVolumes\u002FMy Shared Files\u002Ftools\u002FTerminalMacGuest.app` in the guest. Releases are signed with one unchanging self-signed certificate, so the guest keeps its Screen Recording and Accessibility approvals across updates.\n\nAgents can drive the guest through an MCP server: `claude mcp add terminal-mac -- \"$PWD\u002Fdist\u002Fterminal-mac\" mcp default`. See [docs\u002FAGENT.md](docs\u002FAGENT.md).\n\nNew VMs use a 2x HiDPI display (for example 2560×1600 pixels at 220 ppi for the default 1280×800 points), so text stays sharp on Retina terminals. Switch a stopped VM with `terminal-mac display default --hidpi` or `--standard`.\n\nThe automounted volume is supplied by macOS virtio-fs. If it is absent, check the guest's macOS version and the VM log; this prototype has no fallback guest transport.\n\n## Give an agent computer control\n\n```sh\n.\u002Fdist\u002Fterminal-mac action default screenshot --output \u002Ftmp\u002Fguest.png\n.\u002Fdist\u002Fterminal-mac action default click 640 400\n.\u002Fdist\u002Fterminal-mac action default type 'Hello from the agent'\n.\u002Fdist\u002Fterminal-mac action default key cmd+space\n.\u002Fdist\u002Fterminal-mac action default key return\n.\u002Fdist\u002Fterminal-mac action default scroll --dy -300 --x 640 --y 400\n```\n\nCommands return JSON and a nonzero exit status on failure. Screenshots return a local host PNG path. Coordinates start at the top-left and match the screenshot's dimensions; screenshots use guest display points to keep input coordinates consistent on Retina displays. `snapshot` is currently a screenshot alias, not an accessibility-tree snapshot.\n\nThe agent instructions are in [docs\u002FAGENT.md](docs\u002FAGENT.md). No global agent settings are modified.\n\n## Lifecycle and resources\n\n```sh\n.\u002Fdist\u002Fterminal-mac ls\n.\u002Fdist\u002Fterminal-mac status default\n.\u002Fdist\u002Fterminal-mac pause default\n.\u002Fdist\u002Fterminal-mac resume default\n.\u002Fdist\u002Fterminal-mac show default\n.\u002Fdist\u002Fterminal-mac stop default          # request a normal guest shutdown\n.\u002Fdist\u002Fterminal-mac stop default --force  # immediate power-off; unsaved guest work can be lost\n```\n\nCustomize a new VM with `--cpus 4 --memory 4 --disk 64 --width 1280 --height 800` (width and height are in points; add `--standard` for a 1x display). CPU, memory and disk arguments are logical CPUs, GiB and GiB respectively. `--offline` omits the guest network device; the shared-folder control channel still works, though some macOS setup workflows may require networking.\n\nVM data lives in `~\u002FLibrary\u002FApplication Support\u002Fterminal-mac\u002Fmachines\u002FNAME\u002F`. `TERMINAL_MAC_HOME` overrides the data root. Each VM has an exclusive file lock, a sparse disk, hardware identity, auxiliary boot storage, `machine.json`, a private host-control mailbox, the guest exchange directory, and `runtime.log`. A VM boot runs as a separate background process. Lifecycle commands must use the same `TERMINAL_MAC_HOME` as the process that started it.\n\nAn interrupted or failed installation leaves its directory and `installed: false` for diagnosis. It is never silently overwritten. To retry, ensure no installer\u002FVM is running, move that incomplete directory aside, then create the VM again. There is deliberately no destructive VM-delete command yet.\n\n## Isolation model\n\n- Host input and screen APIs are not used for agent actions. The helper refuses to run unless `hw.model` starts with `VirtualMac`. That check prevents accidental host execution; it is not hardware attestation or a defense against a compromised host.\n- The guest sees two explicit shares: `control` (read\u002Fwrite, containing request\u002Freply JSON and screenshots) and `tools` (read-only helper app). Host home, project folders, clipboard, microphone, and camera are not attached.\n- There is no remote-control network listener. The flat mailbox pins its directory, rejects symlinks, hardlinks and nonregular files on reads, bounds message sizes, checks request IDs, and expires pending actions. The host never executes guest-provided content.\n- Default NAT networking permits guest internet access and may reach services on the host or local network. This is **not** a network-isolated or hardened hostile-code environment. `--offline` removes that network path.\n- A logged-out\u002Flocked guest, missing helper, denied guest permissions, or paused VM prevents normal computer use. TCC grants are interactive guest setup, not bypassed by the CLI.\n\nVM cloning, rollback checkpoints, accessibility snapshots, fully unattended guest setup, terminal splits and tmux transport remain future work. The native Virtualization framework does not itself render a Mac into a terminal or offer an agent input API; this project supplies the guest transport and terminal presentation layers.\n\n## Development and validation\n\n```sh\nCLANG_MODULE_CACHE_PATH=\u002Ftmp\u002Fterminal-mac-modules \\\nSWIFTPM_MODULECACHE_OVERRIDE=\u002Ftmp\u002Fterminal-mac-modules \\\nswift test --disable-sandbox --scratch-path \u002Ftmp\u002Fterminal-mac-build \\\n  --cache-path \u002Ftmp\u002Fterminal-mac-cache \\\n  --config-path \u002Ftmp\u002Fterminal-mac-config --security-path \u002Ftmp\u002Fterminal-mac-security\n```\n\nTests cover mailbox round trips, expiry and cleanup, file-boundary defenses, name\u002Foption validation, fragmented UTF-8 and terminal input sequences. These are automated protocol checks, not evidence that a guest was installed, booted, granted permissions, or controlled successfully. See [docs\u002FVALIDATION.md](docs\u002FVALIDATION.md) for recorded results and the live checklist.\n\nReferences: [terminal-browser](https:\u002F\u002Fterminal-browser.com\u002F), [Apple's macOS virtualization sample](https:\u002F\u002Fdeveloper.apple.com\u002Fdocumentation\u002Fvirtualization\u002Frunning-macos-in-a-virtual-machine-on-apple-silicon), [VZVirtualMachineView](https:\u002F\u002Fdeveloper.apple.com\u002Fdocumentation\u002Fvirtualization\u002Fvzvirtualmachineview), [ScreenCaptureKit](https:\u002F\u002Fdeveloper.apple.com\u002Fdocumentation\u002Fscreencapturekit).\n\n## Sponsor\n\nterminal-mac is free and maintained in my own time. [Sponsoring](https:\u002F\u002Fgithub.com\u002Fsponsors\u002Fgovijr) keeps it that way.\n","terminal-mac 是一个在终端中运行完整 macOS 虚拟机的工具，专为 AI 计算机使用代理（Computer Use Agents）设计。它基于 Apple Silicon 的虚拟化框架启动真实 macOS 客户机，通过内置助手捕获屏幕并转发输入事件，支持 Kitty、iTerm2 或 Ghostty 等终端的内联图形流；所有操作隔离于宿主机，具备独立应用、账户与权限。项目采用 Swift 编写，无需开发环境即可安装运行，适用于需要沙箱化、可编程控制的 macOS 桌面环境的自动化测试、AI 代理训练与交互式脚本任务。",2,"2026-11-24 04:32:57","CREATED_QUERY"]