unity-mcp-cli 0.52.0 → 0.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +85 -66
- package/dist/commands/configure.js +17 -13
- package/dist/commands/configure.js.map +1 -1
- package/dist/commands/create-project.js +17 -5
- package/dist/commands/create-project.js.map +1 -1
- package/dist/commands/install-plugin.js +20 -6
- package/dist/commands/install-plugin.js.map +1 -1
- package/dist/commands/install-unity.d.ts +2 -0
- package/dist/commands/install-unity.js +72 -0
- package/dist/commands/install-unity.js.map +1 -0
- package/dist/commands/open.js +82 -10
- package/dist/commands/open.js.map +1 -1
- package/dist/commands/remove-plugin.d.ts +2 -0
- package/dist/commands/remove-plugin.js +29 -0
- package/dist/commands/remove-plugin.js.map +1 -0
- package/dist/index.js +34 -11
- package/dist/index.js.map +1 -1
- package/dist/utils/manifest.d.ts +12 -3
- package/dist/utils/manifest.js +53 -29
- package/dist/utils/manifest.js.map +1 -1
- package/dist/utils/ui.d.ts +70 -0
- package/dist/utils/ui.js +288 -0
- package/dist/utils/ui.js.map +1 -0
- package/dist/utils/unity-editor.d.ts +5 -0
- package/dist/utils/unity-editor.js +49 -3
- package/dist/utils/unity-editor.js.map +1 -1
- package/dist/utils/unity-hub.d.ts +29 -1
- package/dist/utils/unity-hub.js +291 -22
- package/dist/utils/unity-hub.js.map +1 -1
- package/docs/README.es.md +333 -0
- package/docs/README.ja.md +333 -0
- package/docs/README.zh-CN.md +333 -0
- package/package.json +3 -3
- package/dist/commands/connect.d.ts +0 -2
- package/dist/commands/connect.js +0 -81
- package/dist/commands/connect.js.map +0 -1
- package/dist/commands/install-editor.d.ts +0 -2
- package/dist/commands/install-editor.js +0 -49
- package/dist/commands/install-editor.js.map +0 -1
package/README.md
CHANGED
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
|
|
11
11
|
</div>
|
|
12
12
|
|
|
13
|
+
<b>[中文](https://github.com/IvanMurzak/Unity-MCP/blob/main/cli/docs/README.zh-CN.md) | [日本語](https://github.com/IvanMurzak/Unity-MCP/blob/main/cli/docs/README.ja.md) | [Español](https://github.com/IvanMurzak/Unity-MCP/blob/main/cli/docs/README.es.md)</b>
|
|
14
|
+
|
|
13
15
|
Cross-platform CLI tool for **[Unity MCP](https://github.com/IvanMurzak/Unity-MCP)** — create projects, install plugins, configure MCP tools, and launch Unity with active MCP connections. All from a single command line.
|
|
14
16
|
|
|
15
17
|
## 
|
|
@@ -17,9 +19,12 @@ Cross-platform CLI tool for **[Unity MCP](https://github.com/IvanMurzak/Unity-MC
|
|
|
17
19
|
- :white_check_mark: **Create projects** — scaffold new Unity projects via Unity Editor
|
|
18
20
|
- :white_check_mark: **Install editors** — install any Unity Editor version from the command line
|
|
19
21
|
- :white_check_mark: **Install plugin** — add Unity-MCP plugin to `manifest.json` with all required scoped registries
|
|
22
|
+
- :white_check_mark: **Remove plugin** — remove Unity-MCP plugin from `manifest.json`
|
|
20
23
|
- :white_check_mark: **Configure** — enable/disable MCP tools, prompts, and resources
|
|
21
|
-
- :white_check_mark: **Connect** — launch Unity with MCP environment variables for automated server connection
|
|
24
|
+
- :white_check_mark: **Open & Connect** — launch Unity with optional MCP environment variables for automated server connection
|
|
22
25
|
- :white_check_mark: **Cross-platform** — Windows, macOS, and Linux
|
|
26
|
+
- :white_check_mark: **CI-friendly** — auto-detects non-interactive terminals and disables spinners/colors
|
|
27
|
+
- :white_check_mark: **Verbose mode** — use `--verbose` on any command for detailed diagnostic output
|
|
23
28
|
- :white_check_mark: **Version-aware** — never downgrades plugin versions, resolves latest from OpenUPM
|
|
24
29
|
|
|
25
30
|

|
|
@@ -48,11 +53,12 @@ unity-mcp-cli install-plugin /path/to/unity/project
|
|
|
48
53
|
- [Quick Start](#quick-start)
|
|
49
54
|
- [Commands](#commands)
|
|
50
55
|
- [`create-project`](#create-project) — Create a new Unity project
|
|
51
|
-
- [`install-
|
|
56
|
+
- [`install-unity`](#install-unity) — Install Unity Editor via Unity Hub
|
|
52
57
|
- [`open`](#open) — Open a Unity project in the Editor
|
|
53
58
|
- [`install-plugin`](#install-plugin) — Install Unity-MCP plugin into a project
|
|
59
|
+
- [`remove-plugin`](#remove-plugin) — Remove Unity-MCP plugin from a project
|
|
54
60
|
- [`configure`](#configure) — Configure MCP tools, prompts, and resources
|
|
55
|
-
|
|
61
|
+
- [Global Options](#global-options)
|
|
56
62
|
- [Full Automation Example](#full-automation-example)
|
|
57
63
|
- [How It Works](#how-it-works)
|
|
58
64
|
|
|
@@ -81,44 +87,76 @@ npx unity-mcp-cli create-project ./MyGame --unity 2022.3.62f1
|
|
|
81
87
|
|
|
82
88
|

|
|
83
89
|
|
|
84
|
-
## `install-
|
|
90
|
+
## `install-unity`
|
|
85
91
|
|
|
86
92
|
Install a Unity Editor version via Unity Hub CLI.
|
|
87
93
|
|
|
88
94
|
```bash
|
|
89
|
-
npx unity-mcp-cli install-
|
|
95
|
+
npx unity-mcp-cli install-unity 6000.3.1f1
|
|
90
96
|
```
|
|
91
97
|
|
|
92
|
-
| Option | Required | Description |
|
|
98
|
+
| Argument / Option | Required | Description |
|
|
93
99
|
|---|---|---|
|
|
94
|
-
|
|
|
100
|
+
| `[version]` | No | Unity Editor version to install (e.g. `6000.3.1f1`) |
|
|
95
101
|
| `--path <path>` | No | Read the required version from an existing project |
|
|
96
102
|
|
|
97
|
-
If neither option is provided, the command
|
|
103
|
+
If neither argument nor option is provided, the command installs the latest stable release from Unity Hub's releases list.
|
|
98
104
|
|
|
99
105
|
**Example — install the editor version that a project needs:**
|
|
100
106
|
|
|
101
107
|
```bash
|
|
102
|
-
npx unity-mcp-cli install-
|
|
108
|
+
npx unity-mcp-cli install-unity --path ./MyGame
|
|
103
109
|
```
|
|
104
110
|
|
|
105
111
|

|
|
106
112
|
|
|
107
113
|
## `open`
|
|
108
114
|
|
|
109
|
-
Open a Unity project in the Unity Editor.
|
|
115
|
+
Open a Unity project in the Unity Editor. By default, sets MCP connection environment variables if connection options are provided. Use `--no-connect` to open without MCP connection.
|
|
110
116
|
|
|
111
117
|
```bash
|
|
112
118
|
npx unity-mcp-cli open ./MyGame
|
|
113
119
|
```
|
|
114
120
|
|
|
115
|
-
| Option | Required | Description |
|
|
116
|
-
|
|
117
|
-
| `[path]` | Yes | Path to the Unity project (positional or `--path`) |
|
|
118
|
-
| `--unity <version>` | No | Specific Unity Editor version to use (defaults to version from project settings, falls back to highest installed) |
|
|
121
|
+
| Option | Env Variable | Required | Description |
|
|
122
|
+
|---|---|---|---|
|
|
123
|
+
| `[path]` | — | Yes | Path to the Unity project (positional or `--path`) |
|
|
124
|
+
| `--unity <version>` | — | No | Specific Unity Editor version to use (defaults to version from project settings, falls back to highest installed) |
|
|
125
|
+
| `--no-connect` | — | No | Open without MCP connection environment variables |
|
|
126
|
+
| `--url <url>` | `UNITY_MCP_HOST` | No | MCP server URL to connect to |
|
|
127
|
+
| `--keep-connected` | `UNITY_MCP_KEEP_CONNECTED` | No | Force keep the connection alive |
|
|
128
|
+
| `--token <token>` | `UNITY_MCP_TOKEN` | No | Authentication token |
|
|
129
|
+
| `--auth <option>` | `UNITY_MCP_AUTH_OPTION` | No | Auth mode: `none` or `required` |
|
|
130
|
+
| `--tools <names>` | `UNITY_MCP_TOOLS` | No | Comma-separated list of tools to enable |
|
|
131
|
+
| `--transport <method>` | `UNITY_MCP_TRANSPORT` | No | Transport method: `streamableHttp` or `stdio` |
|
|
132
|
+
| `--start-server <value>` | `UNITY_MCP_START_SERVER` | No | Set to `true` or `false` to control MCP server auto-start |
|
|
119
133
|
|
|
120
134
|
The editor process is spawned in detached mode — the CLI returns immediately.
|
|
121
135
|
|
|
136
|
+
**Example — open with MCP connection:**
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
npx unity-mcp-cli open ./MyGame \
|
|
140
|
+
--url http://localhost:8080 \
|
|
141
|
+
--keep-connected
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**Example — open without MCP connection (simple open):**
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
npx unity-mcp-cli open ./MyGame --no-connect
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
**Example — open with authentication and specific tools:**
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
npx unity-mcp-cli open ./MyGame \
|
|
154
|
+
--url http://my-server:8080 \
|
|
155
|
+
--token my-secret-token \
|
|
156
|
+
--auth required \
|
|
157
|
+
--tools gameobject-create,gameobject-find
|
|
158
|
+
```
|
|
159
|
+
|
|
122
160
|

|
|
123
161
|
|
|
124
162
|
## `install-plugin`
|
|
@@ -149,6 +187,27 @@ npx unity-mcp-cli install-plugin ./MyGame --plugin-version 0.51.6
|
|
|
149
187
|
|
|
150
188
|

|
|
151
189
|
|
|
190
|
+
## `remove-plugin`
|
|
191
|
+
|
|
192
|
+
Remove the Unity-MCP plugin from a Unity project's `Packages/manifest.json`.
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
npx unity-mcp-cli remove-plugin ./MyGame
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
| Option | Required | Description |
|
|
199
|
+
|---|---|---|
|
|
200
|
+
| `[path]` | Yes | Path to the Unity project (positional or `--path`) |
|
|
201
|
+
|
|
202
|
+
This command:
|
|
203
|
+
1. Removes `com.ivanmurzak.unity.mcp` from `dependencies`
|
|
204
|
+
2. **Preserves scoped registries and scopes** — other packages may depend on them
|
|
205
|
+
3. **No-op** if the plugin is not installed
|
|
206
|
+
|
|
207
|
+
> After running this command, open the project in Unity Editor to apply the change.
|
|
208
|
+
|
|
209
|
+

|
|
210
|
+
|
|
152
211
|
## `configure`
|
|
153
212
|
|
|
154
213
|
Configure MCP tools, prompts, and resources in `UserSettings/AI-Game-Developer-Config.json`.
|
|
@@ -193,61 +252,20 @@ npx unity-mcp-cli configure ./MyGame \
|
|
|
193
252
|
|
|
194
253
|

|
|
195
254
|
|
|
196
|
-
##
|
|
255
|
+
## Global Options
|
|
197
256
|
|
|
198
|
-
|
|
257
|
+
These options are available on all commands:
|
|
199
258
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
259
|
+
| Option | Description |
|
|
260
|
+
|---|---|
|
|
261
|
+
| `-v, --verbose` | Enable verbose diagnostic output for troubleshooting |
|
|
262
|
+
| `--version` | Display CLI version |
|
|
263
|
+
| `--help` | Display help for the command |
|
|
205
264
|
|
|
206
|
-
|
|
207
|
-
|---|---|---|---|
|
|
208
|
-
| `--url <url>` | `UNITY_MCP_HOST` | Yes | MCP server URL to connect to |
|
|
209
|
-
| `--path <path>` | — | Yes | Path to the Unity project |
|
|
210
|
-
| `--keep-connected` | `UNITY_MCP_KEEP_CONNECTED` | No | Force keep the connection alive |
|
|
211
|
-
| `--token <token>` | `UNITY_MCP_TOKEN` | No | Authentication token |
|
|
212
|
-
| `--auth <option>` | `UNITY_MCP_AUTH_OPTION` | No | Auth mode: `none` or `required` |
|
|
213
|
-
| `--tools <names>` | `UNITY_MCP_TOOLS` | No | Comma-separated list of tools to enable |
|
|
214
|
-
| `--transport <method>` | `UNITY_MCP_TRANSPORT` | No | Transport method: `streamableHttp` or `stdio` |
|
|
215
|
-
| `--start-server` / `--no-start-server` | `UNITY_MCP_START_SERVER` | No | Start or prevent MCP server auto-start in Unity Editor (only applies to `streamableHttp` transport) |
|
|
216
|
-
| `--unity <version>` | — | No | Specific Unity Editor version to use (defaults to version from project settings, falls back to highest installed) |
|
|
217
|
-
|
|
218
|
-
This command launches the Unity Editor with the corresponding `UNITY_MCP_*` environment variables so the plugin picks them up automatically on startup. The environment variables override values from the project's `UserSettings/AI-Game-Developer-Config.json` config file at runtime.
|
|
219
|
-
|
|
220
|
-
**Example — connect with authentication and specific tools:**
|
|
265
|
+
**Example — run any command with verbose output:**
|
|
221
266
|
|
|
222
267
|
```bash
|
|
223
|
-
npx unity-mcp-cli
|
|
224
|
-
--path ./MyGame \
|
|
225
|
-
--url http://my-server:8080 \
|
|
226
|
-
--token my-secret-token \
|
|
227
|
-
--auth required \
|
|
228
|
-
--keep-connected \
|
|
229
|
-
--tools gameobject-create,gameobject-find,script-execute
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
**Example — connect with stdio transport (server managed by AI agent):**
|
|
233
|
-
|
|
234
|
-
```bash
|
|
235
|
-
npx unity-mcp-cli connect \
|
|
236
|
-
--path ./MyGame \
|
|
237
|
-
--url http://localhost:8080 \
|
|
238
|
-
--transport stdio \
|
|
239
|
-
--no-start-server
|
|
240
|
-
```
|
|
241
|
-
|
|
242
|
-
**Example — connect with streamableHttp and auto-start server:**
|
|
243
|
-
|
|
244
|
-
```bash
|
|
245
|
-
npx unity-mcp-cli connect \
|
|
246
|
-
--path ./MyGame \
|
|
247
|
-
--url http://localhost:8080 \
|
|
248
|
-
--transport streamableHttp \
|
|
249
|
-
--start-server \
|
|
250
|
-
--keep-connected
|
|
268
|
+
npx unity-mcp-cli install-plugin ./MyGame --verbose
|
|
251
269
|
```
|
|
252
270
|
|
|
253
271
|

|
|
@@ -267,8 +285,7 @@ npx unity-mcp-cli install-plugin ./MyAIGame
|
|
|
267
285
|
npx unity-mcp-cli configure ./MyAIGame --enable-all-tools
|
|
268
286
|
|
|
269
287
|
# 4. Open the project with MCP connection
|
|
270
|
-
npx unity-mcp-cli
|
|
271
|
-
--path ./MyAIGame \
|
|
288
|
+
npx unity-mcp-cli open ./MyAIGame \
|
|
272
289
|
--url http://localhost:8080 \
|
|
273
290
|
--keep-connected
|
|
274
291
|
```
|
|
@@ -303,4 +320,6 @@ Commands that manage editors or create projects use the **Unity Hub CLI** (`--he
|
|
|
303
320
|
- **macOS** — downloads the DMG, mounts it, and copies `Unity Hub.app` to `/Applications`
|
|
304
321
|
- **Linux** — downloads `UnityHub.AppImage` to `~/Applications/`
|
|
305
322
|
|
|
323
|
+
> For the full Unity-MCP project documentation, see the [main README](https://github.com/IvanMurzak/Unity-MCP/blob/main/README.md).
|
|
324
|
+
|
|
306
325
|

|
|
@@ -2,6 +2,8 @@ import { Command } from 'commander';
|
|
|
2
2
|
import * as path from 'path';
|
|
3
3
|
import * as fs from 'fs';
|
|
4
4
|
import { getOrCreateConfig, writeConfig, updateFeatures } from '../utils/config.js';
|
|
5
|
+
import * as ui from '../utils/ui.js';
|
|
6
|
+
import { verbose } from '../utils/ui.js';
|
|
5
7
|
function parseCommaSeparated(value) {
|
|
6
8
|
return value.split(',').map((s) => s.trim()).filter(Boolean);
|
|
7
9
|
}
|
|
@@ -25,30 +27,31 @@ export const configureCommand = new Command('configure')
|
|
|
25
27
|
.action(async (positionalPath, options) => {
|
|
26
28
|
const resolvedPath = positionalPath ?? options.path;
|
|
27
29
|
if (!resolvedPath) {
|
|
28
|
-
|
|
30
|
+
ui.error('Path is required. Usage: unity-mcp-cli configure <path> or --path <path>');
|
|
29
31
|
process.exit(1);
|
|
30
32
|
}
|
|
31
33
|
const projectPath = path.resolve(resolvedPath);
|
|
32
34
|
if (!fs.existsSync(projectPath)) {
|
|
33
|
-
|
|
35
|
+
ui.error(`Project path does not exist: ${projectPath}`);
|
|
34
36
|
process.exit(1);
|
|
35
37
|
}
|
|
38
|
+
verbose(`Loading config for project: ${projectPath}`);
|
|
36
39
|
const config = getOrCreateConfig(projectPath);
|
|
37
40
|
if (options.list) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const printFeatures = (
|
|
41
|
+
ui.heading('Current configuration');
|
|
42
|
+
ui.label('Host', config.host ?? 'not set');
|
|
43
|
+
ui.label('Keep Connected', String(config.keepConnected ?? false));
|
|
44
|
+
ui.label('Transport', config.transportMethod ?? 'streamableHttp');
|
|
45
|
+
ui.label('Auth', config.authOption ?? 'none');
|
|
46
|
+
const printFeatures = (featureLabel, features) => {
|
|
44
47
|
if (!features || features.length === 0) {
|
|
45
|
-
|
|
48
|
+
ui.heading(featureLabel);
|
|
49
|
+
ui.info('(none configured - all enabled by default)');
|
|
46
50
|
return;
|
|
47
51
|
}
|
|
48
|
-
|
|
52
|
+
ui.heading(featureLabel);
|
|
49
53
|
for (const f of features) {
|
|
50
|
-
|
|
51
|
-
console.log(` ${status} ${f.name}`);
|
|
54
|
+
ui.featureRow(f.name, f.enabled);
|
|
52
55
|
}
|
|
53
56
|
};
|
|
54
57
|
printFeatures('Tools', config.tools);
|
|
@@ -83,7 +86,8 @@ export const configureCommand = new Command('configure')
|
|
|
83
86
|
disableAll: options.disableAllResources,
|
|
84
87
|
});
|
|
85
88
|
}
|
|
89
|
+
verbose('Writing updated configuration');
|
|
86
90
|
writeConfig(projectPath, config);
|
|
87
|
-
|
|
91
|
+
ui.success('Configuration updated successfully.');
|
|
88
92
|
});
|
|
89
93
|
//# sourceMappingURL=configure.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configure.js","sourceRoot":"","sources":["../../src/commands/configure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"configure.js","sourceRoot":"","sources":["../../src/commands/configure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpF,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,SAAS,mBAAmB,CAAC,KAAa;IACxC,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,C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,CAAC,gBAAgB;YACtC,SAAS,EAAE,OAAO,CAAC,kBAAkB;YACrC,UAAU,EAAE,OAAO,CAAC,mBAAmB;SACxC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,CAAC,+BAA+B,CAAC,CAAC;IACzC,WAAW,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IACjC,EAAE,CAAC,OAAO,CAAC,qCAAqC,CAAC,CAAC;AACpD,CAAC,CAAC,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import * as path from 'path';
|
|
3
3
|
import { ensureUnityHub, createProject, listInstalledEditors, findHighestEditor } from '../utils/unity-hub.js';
|
|
4
|
+
import * as ui from '../utils/ui.js';
|
|
5
|
+
import { verbose } from '../utils/ui.js';
|
|
4
6
|
export const createProjectCommand = new Command('create-project')
|
|
5
7
|
.description('Create a new Unity project')
|
|
6
8
|
.argument('[path]', 'Path where the project will be created')
|
|
@@ -9,23 +11,33 @@ export const createProjectCommand = new Command('create-project')
|
|
|
9
11
|
.action(async (positionalPath, options) => {
|
|
10
12
|
const resolvedPath = positionalPath ?? options.path;
|
|
11
13
|
if (!resolvedPath) {
|
|
12
|
-
|
|
14
|
+
ui.error('Path is required. Usage: unity-mcp-cli create-project <path> or --path <path>');
|
|
13
15
|
process.exit(1);
|
|
14
16
|
}
|
|
15
|
-
const
|
|
17
|
+
const spinner = ui.startSpinner('Locating Unity Hub...');
|
|
18
|
+
let hubPath;
|
|
19
|
+
try {
|
|
20
|
+
hubPath = await ensureUnityHub();
|
|
21
|
+
}
|
|
22
|
+
catch (err) {
|
|
23
|
+
spinner.error('Failed to locate Unity Hub');
|
|
24
|
+
throw err;
|
|
25
|
+
}
|
|
26
|
+
spinner.success('Unity Hub located');
|
|
16
27
|
let editorVersion = options.unity;
|
|
17
28
|
if (!editorVersion) {
|
|
18
|
-
// Use the highest installed editor version
|
|
19
29
|
const editors = listInstalledEditors(hubPath);
|
|
20
30
|
if (editors.length === 0) {
|
|
21
|
-
|
|
31
|
+
ui.error('No Unity editors installed. Install one with: unity-mcp-cli install-unity [version]');
|
|
22
32
|
process.exit(1);
|
|
23
33
|
}
|
|
24
34
|
const highest = findHighestEditor(editors);
|
|
25
35
|
editorVersion = highest.version;
|
|
26
|
-
|
|
36
|
+
ui.info(`No Unity version specified, using highest installed: ${editorVersion}`);
|
|
27
37
|
}
|
|
28
38
|
const projectPath = path.resolve(resolvedPath);
|
|
39
|
+
verbose(`Creating project at: ${projectPath} with editor version: ${editorVersion}`);
|
|
40
|
+
verbose(`Unity Hub path: ${hubPath}`);
|
|
29
41
|
createProject(hubPath, projectPath, editorVersion);
|
|
30
42
|
});
|
|
31
43
|
//# sourceMappingURL=create-project.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-project.js","sourceRoot":"","sources":["../../src/commands/create-project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"create-project.js","sourceRoot":"","sources":["../../src/commands/create-project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/G,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,OAAO,CAAC,gBAAgB,CAAC;KAC9D,WAAW,CAAC,4BAA4B,CAAC;KACzC,QAAQ,CAAC,Q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AC,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/C,OAAO,CAAC,wBAAwB,WAAW,yBAAyB,aAAa,EAAE,CAAC,CAAC;IACrF,OAAO,CAAC,mBAAmB,OAAO,EAAE,CAAC,CAAC;IACtC,aAAa,CAAC,OAAO,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC;AACrD,CAAC,CAAC,CAAC"}
|
|
@@ -2,6 +2,8 @@ import { Command } from 'commander';
|
|
|
2
2
|
import * as path from 'path';
|
|
3
3
|
import * as fs from 'fs';
|
|
4
4
|
import { addPluginToManifest, resolveLatestVersion } from '../utils/manifest.js';
|
|
5
|
+
import * as ui from '../utils/ui.js';
|
|
6
|
+
import { verbose } from '../utils/ui.js';
|
|
5
7
|
export const installPluginCommand = new Command('install-plugin')
|
|
6
8
|
.description('Install Unity-MCP plugin into a Unity project')
|
|
7
9
|
.argument('[path]', 'Path to the Unity project')
|
|
@@ -10,23 +12,35 @@ export const installPluginCommand = new Command('install-plugin')
|
|
|
10
12
|
.action(async (positionalPath, options) => {
|
|
11
13
|
const resolvedPath = positionalPath ?? options.path;
|
|
12
14
|
if (!resolvedPath) {
|
|
13
|
-
|
|
15
|
+
ui.error('Path is required. Usage: unity-mcp-cli install-plugin <path> or --path <path>');
|
|
14
16
|
process.exit(1);
|
|
15
17
|
}
|
|
16
18
|
const projectPath = path.resolve(resolvedPath);
|
|
17
19
|
// Validate project exists
|
|
18
20
|
const manifestPath = path.join(projectPath, 'Packages', 'manifest.json');
|
|
19
21
|
if (!fs.existsSync(manifestPath)) {
|
|
20
|
-
|
|
22
|
+
ui.error(`Not a valid Unity project (missing Packages/manifest.json): ${projectPath}`);
|
|
21
23
|
process.exit(1);
|
|
22
24
|
}
|
|
23
25
|
// Resolve version
|
|
24
26
|
let version = options.pluginVersion;
|
|
27
|
+
const isExplicitVersion = !!version;
|
|
25
28
|
if (!version) {
|
|
26
|
-
|
|
29
|
+
const spinner = ui.startSpinner('Resolving latest plugin version...');
|
|
30
|
+
try {
|
|
31
|
+
version = await resolveLatestVersion();
|
|
32
|
+
spinner.success(`Resolved plugin version: ${version}`);
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
spinner.error('Failed to resolve plugin version');
|
|
36
|
+
ui.error(err.message);
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
27
39
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
40
|
+
verbose(`Plugin version: ${version} (explicit: ${isExplicitVersion})`);
|
|
41
|
+
verbose(`Manifest path: ${manifestPath}`);
|
|
42
|
+
ui.info(`Installing Unity-MCP plugin v${version} into: ${projectPath}`);
|
|
43
|
+
addPluginToManifest(projectPath, version, isExplicitVersion);
|
|
44
|
+
ui.success('Done! Open the project in Unity Editor to complete installation.');
|
|
31
45
|
});
|
|
32
46
|
//# sourceMappingURL=install-plugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install-plugin.js","sourceRoot":"","sources":["../../src/commands/install-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"install-plugin.js","sourceRoot":"","sources":["../../src/commands/install-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,MA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GAAG,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;YAClD,EAAE,CAAC,KAAK,CAAE,GAAa,CAAC,OAAO,CAAC,CAAC;YACjC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;IAED,OAAO,CAAC,mBAAmB,OAAO,eAAe,iBAAiB,GAAG,CAAC,CAAC;IACvE,OAAO,CAAC,kBAAkB,YAAY,EAAE,CAAC,CAAC;IAC1C,EAAE,CAAC,IAAI,CAAC,gCAAgC,OAAO,UAAU,WAAW,EAAE,CAAC,CAAC;IACxE,mBAAmB,CAAC,WAAW,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC;IAC7D,EAAE,CAAC,OAAO,CAAC,kEAAkE,CAAC,CAAC;AACjF,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import * as fs from 'fs';
|
|
4
|
+
import { ensureUnityHub, installEditor, listInstalledEditors, listAvailableReleases, findLatestStableRelease } from '../utils/unity-hub.js';
|
|
5
|
+
import { getProjectEditorVersion } from '../utils/unity-editor.js';
|
|
6
|
+
import * as ui from '../utils/ui.js';
|
|
7
|
+
import { verbose } from '../utils/ui.js';
|
|
8
|
+
export const installUnityCommand = new Command('install-unity')
|
|
9
|
+
.description('Install Unity Editor via Unity Hub')
|
|
10
|
+
.argument('[version]', 'Unity Editor version to install (e.g. 6000.3.1f1). Omit to install latest stable release.')
|
|
11
|
+
.option('--path <path>', 'Read version from an existing Unity project')
|
|
12
|
+
.action(async (positionalVersion, options) => {
|
|
13
|
+
verbose(`install-unity invoked with version=${positionalVersion ?? '(auto)'}, path=${options.path ?? '(none)'}`);
|
|
14
|
+
const spinner = ui.startSpinner('Locating Unity Hub...');
|
|
15
|
+
let hubPath;
|
|
16
|
+
try {
|
|
17
|
+
hubPath = await ensureUnityHub();
|
|
18
|
+
}
|
|
19
|
+
catch (err) {
|
|
20
|
+
spinner.error('Failed to locate Unity Hub');
|
|
21
|
+
throw err;
|
|
22
|
+
}
|
|
23
|
+
spinner.success('Unity Hub located');
|
|
24
|
+
verbose(`Unity Hub path: ${hubPath}`);
|
|
25
|
+
let version = positionalVersion;
|
|
26
|
+
if (!version && options.path) {
|
|
27
|
+
const projectPath = path.resolve(options.path);
|
|
28
|
+
if (!fs.existsSync(projectPath)) {
|
|
29
|
+
ui.error(`Project path does not exist: ${projectPath}`);
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
version = getProjectEditorVersion(projectPath) ?? undefined;
|
|
33
|
+
if (version) {
|
|
34
|
+
ui.info(`Detected editor version from project: ${version}`);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
ui.error('Could not read editor version from ProjectSettings/ProjectVersion.txt');
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
// Fetch available releases once — reused for latest-stable lookup and install
|
|
42
|
+
let releases;
|
|
43
|
+
// No version specified — resolve latest stable release from Unity Hub
|
|
44
|
+
if (!version) {
|
|
45
|
+
releases = listAvailableReleases(hubPath);
|
|
46
|
+
const latest = findLatestStableRelease(releases);
|
|
47
|
+
if (!latest) {
|
|
48
|
+
ui.error('No stable releases found');
|
|
49
|
+
const editors = listInstalledEditors(hubPath);
|
|
50
|
+
if (editors.length > 0) {
|
|
51
|
+
ui.heading('Currently installed editors:');
|
|
52
|
+
for (const editor of editors) {
|
|
53
|
+
ui.label(editor.version, editor.path);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
process.exit(1);
|
|
57
|
+
}
|
|
58
|
+
ui.success(`Latest stable release: ${latest.version}`);
|
|
59
|
+
version = latest.version;
|
|
60
|
+
}
|
|
61
|
+
// Check if already installed
|
|
62
|
+
const editors = listInstalledEditors(hubPath);
|
|
63
|
+
const alreadyInstalled = editors.find((e) => e.version === version);
|
|
64
|
+
if (alreadyInstalled) {
|
|
65
|
+
ui.success(`Unity Editor ${version} is already installed at: ${alreadyInstalled.path}`);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
verbose(`Installing Unity Editor version: ${version}`);
|
|
69
|
+
await installEditor(hubPath, version, releases);
|
|
70
|
+
ui.success(`Unity Editor ${version} installed successfully`);
|
|
71
|
+
});
|
|
72
|
+
//# sourceMappingURL=install-unity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-unity.js","sourceRoot":"","sources":["../../src/commands/install-unity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAC5I,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,OAAO,CAAC,eAAe,CAAC;KAC5D,WAAW,CAAC,oCAAoC,CAAC;KACjD,QAAQ,CAAC,WAAW,EAAE,2FAA2F,CAAC;KAClH,MAAM,CAAC,eAAe,EAAE,6CAA6C,CAAC;KACtE,MAAM,CAAC,KAAK,EAAE,iBAAqC,EAAE,OAA0B,EAAE,EAAE;IAClF,OAAO,CAAC,sCAAsC,iBAAiB,IAAI,QAAQ,UAAU,OAAO,CAAC,IAAI,IAAI,QAAQ,EAAE,CAAC,CAAC;IACjH,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,uBAAuB,CAAC,CAAC;IACzD,IAAI,OAAe,CAAC;IACpB,IAAI,CAAC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