You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cli/README.md
+14-1Lines changed: 14 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -255,8 +255,21 @@ cd ./MyGame && unity-mcp-cli open
255
255
|`--tools <names>`|`UNITY_MCP_TOOLS`| No | Comma-separated list of tools to enable |
256
256
|`--transport <method>`|`UNITY_MCP_TRANSPORT`| No | Transport method: `streamableHttp` or `stdio`|
257
257
|`--start-server <value>`|`UNITY_MCP_START_SERVER`| No | Set to `true` or `false` to control MCP server auto-start |
258
+
|`--no-auto-dismiss-launch-errors`| — | No | Disable auto-dismissal of the Unity Editor "compile errors at launch" dialog (default: enabled) |
259
+
|`--launch-dismiss-timeout-ms <ms>`| — | No | Overall timeout (milliseconds) for the launch-errors auto-dismiss polling loop (default: `30000`) |
260
+
|`--launch-dismiss-poll-interval-ms <ms>`| — | No | Polling tick interval (milliseconds) for the launch-errors auto-dismiss loop (default: `1500`) |
258
261
259
-
The editor process is spawned in detached mode — the CLI returns immediately.
262
+
The editor process is spawned in detached mode. By default, after spawning the editor, `open` polls for Unity's "compile errors at launch" dialog and clicks `Ignore` so the editor finishes initialising — without this, any in-Editor automation that needs to run after a state where Unity itself can't compile (e.g. the NuGet dependency resolver) cannot self-heal. The dialog appears within seconds of editor launch when it appears at all, so when no dialog has been seen within a short grace window after polling starts the loop exits early — the no-dialog case adds at most that grace window's delay, never the full `--launch-dismiss-timeout-ms`. If the dialog is observed (and successfully dismissed), polling continues until the overall timeout so a re-appearing dialog (resolver fixes one error → dialog re-surfaces with the next) is dismissed again. Library-mode callers can supply an `AbortSignal` (`launchDismissAbortSignal` on `OpenProjectOptions`) to abort the loop the instant their own readiness signal fires.
263
+
264
+
### Auto-dismiss platform requirements
265
+
266
+
| Platform | Requirement | Notes |
267
+
|---|---|---|
268
+
|**Windows**| Built-in (Win32 API) | Uses `EnumWindows` / `EnumChildWindows` / `SendMessageW(BM_CLICK)` driven from PowerShell. No extra setup required. |
269
+
|**macOS**|**Accessibility permission** must be granted to the terminal (or `unity-mcp-cli` binary). System Settings → Privacy & Security → Accessibility. | Implemented via AppleScript / `osascript`. Without this permission, `osascript` reports an error every poll tick and the dialog cannot be dismissed. |
270
+
|**Linux/X11**|`xdotool` on `PATH` (e.g. `sudo apt-get install xdotool`). | Wayland is **not** supported in the first cut — track upstream issues for Wayland support. |
271
+
272
+
To opt out entirely, pass `--no-auto-dismiss-launch-errors`.
.option('--transport <method>','Transport method: streamableHttp or stdio (sets UNITY_MCP_TRANSPORT)')
94
129
.option('--start-server <value>','Set to true/false to control server auto-start (sets UNITY_MCP_START_SERVER)',undefined)
130
+
.option(
131
+
'--no-auto-dismiss-launch-errors',
132
+
'Disable auto-dismissal of the Unity Editor "compile errors at launch" dialog (default: enabled). On macOS, requires Accessibility permission for the terminal / unity-mcp-cli binary. On Linux/X11, requires `xdotool` on PATH (Wayland not supported).',
133
+
)
134
+
.option(
135
+
'--launch-dismiss-timeout-ms <ms>',
136
+
'Overall timeout (milliseconds) for the launch-errors auto-dismiss polling loop (default: 30000)',
137
+
'30000',
138
+
)
139
+
.option(
140
+
'--launch-dismiss-poll-interval-ms <ms>',
141
+
'Polling tick interval (milliseconds) for the launch-errors auto-dismiss loop (default: 1500)',
0 commit comments