uloop-cli 0.54.1 → 0.54.3
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 +132 -0
- package/dist/cli.bundle.cjs +19 -7
- package/dist/cli.bundle.cjs.map +2 -2
- package/package.json +1 -1
- package/src/cli.ts +18 -4
- package/src/default-tools.json +1 -1
- package/src/execute-tool.ts +5 -1
- package/src/version.ts +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# uloop-cli
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/uloop-cli)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://nodejs.org/)
|
|
6
|
+
|
|
7
|
+
**CLI companion for [uLoopMCP](https://github.com/hatayama/uLoopMCP)** - Let AI agents compile, test, and operate your Unity project.
|
|
8
|
+
|
|
9
|
+
> **Prerequisites**: This CLI requires [uLoopMCP](https://github.com/hatayama/uLoopMCP) to be installed in your Unity project and the server running. See the [main repository](https://github.com/hatayama/uLoopMCP) for setup instructions.
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install -g uloop-cli
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
### Step 1: Install Skills
|
|
20
|
+
|
|
21
|
+
Skills allow LLM tools (Claude Code, Cursor, etc.) to automatically invoke Unity operations.
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# Install for Claude Code (project-level)
|
|
25
|
+
uloop skills install --claude
|
|
26
|
+
|
|
27
|
+
# Install for OpenAI Codex (project-level)
|
|
28
|
+
uloop skills install --codex
|
|
29
|
+
|
|
30
|
+
# Or install globally
|
|
31
|
+
uloop skills install --claude --global
|
|
32
|
+
uloop skills install --codex --global
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Step 2: Use with LLM Tools
|
|
36
|
+
|
|
37
|
+
After installing Skills, LLM tools can automatically handle instructions like:
|
|
38
|
+
|
|
39
|
+
| Your Instruction | Skill Used |
|
|
40
|
+
|---|---|
|
|
41
|
+
| "Fix the compile errors" | `/uloop-compile` |
|
|
42
|
+
| "Run the tests and tell me why they failed" | `/uloop-run-tests` |
|
|
43
|
+
| "Check the scene hierarchy" | `/uloop-get-hierarchy` |
|
|
44
|
+
| "Search for prefabs" | `/uloop-unity-search` |
|
|
45
|
+
|
|
46
|
+
> **No MCP configuration required!** As long as the server is running in the uLoopMCP Window, LLM tools communicate directly with Unity through Skills.
|
|
47
|
+
|
|
48
|
+
## Available Skills
|
|
49
|
+
|
|
50
|
+
Skills are dynamically loaded from the uLoopMCP package in your Unity project. These are the default skills provided by uLoopMCP:
|
|
51
|
+
|
|
52
|
+
- `/uloop-compile` - Execute compilation
|
|
53
|
+
- `/uloop-get-logs` - Get console logs
|
|
54
|
+
- `/uloop-run-tests` - Run tests
|
|
55
|
+
- `/uloop-clear-console` - Clear console
|
|
56
|
+
- `/uloop-focus-window` - Bring Unity Editor to front
|
|
57
|
+
- `/uloop-get-hierarchy` - Get scene hierarchy
|
|
58
|
+
- `/uloop-unity-search` - Unity Search
|
|
59
|
+
- `/uloop-get-menu-items` - Get menu items
|
|
60
|
+
- `/uloop-execute-menu-item` - Execute menu item
|
|
61
|
+
- `/uloop-find-game-objects` - Find GameObjects
|
|
62
|
+
- `/uloop-capture-window` - Capture EditorWindow
|
|
63
|
+
- `/uloop-control-play-mode` - Control Play Mode
|
|
64
|
+
- `/uloop-execute-dynamic-code` - Execute dynamic C# code
|
|
65
|
+
- `/uloop-get-provider-details` - Get search provider details
|
|
66
|
+
|
|
67
|
+
Custom skills defined in your project are also automatically detected.
|
|
68
|
+
|
|
69
|
+
## Direct CLI Usage
|
|
70
|
+
|
|
71
|
+
You can also call the CLI directly without using Skills:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# List available tools
|
|
75
|
+
uloop list
|
|
76
|
+
|
|
77
|
+
# Sync tool definitions from Unity to local cache
|
|
78
|
+
uloop sync
|
|
79
|
+
|
|
80
|
+
# Execute compilation
|
|
81
|
+
uloop compile
|
|
82
|
+
|
|
83
|
+
# Get logs
|
|
84
|
+
uloop get-logs --max-count 10
|
|
85
|
+
|
|
86
|
+
# Run tests
|
|
87
|
+
uloop run-tests --filter-type all
|
|
88
|
+
|
|
89
|
+
# Execute dynamic code
|
|
90
|
+
uloop execute-dynamic-code --code 'using UnityEngine; Debug.Log("Hello from CLI!");'
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Shell Completion
|
|
94
|
+
|
|
95
|
+
Install Bash/Zsh/PowerShell completion for tab-completion support:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# Auto-detect shell and install
|
|
99
|
+
uloop completion --install
|
|
100
|
+
|
|
101
|
+
# Explicitly specify shell
|
|
102
|
+
uloop completion --shell bash --install # Git Bash / MINGW64
|
|
103
|
+
uloop completion --shell powershell --install # PowerShell
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Port Specification
|
|
107
|
+
|
|
108
|
+
You can operate multiple Unity instances by specifying the `--port` option:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
uloop compile --port 8700
|
|
112
|
+
uloop compile --port 8701
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
If `--port` is omitted, the port configured for the current project is automatically used.
|
|
116
|
+
|
|
117
|
+
You can find the port number in each Unity's uLoopMCP Window.
|
|
118
|
+
|
|
119
|
+
## Requirements
|
|
120
|
+
|
|
121
|
+
- **Node.js 20.0 or later**
|
|
122
|
+
- **Unity 2022.3 or later** with [uLoopMCP](https://github.com/hatayama/uLoopMCP) installed
|
|
123
|
+
- uLoopMCP server running (Window > uLoopMCP > Start Server)
|
|
124
|
+
|
|
125
|
+
## Links
|
|
126
|
+
|
|
127
|
+
- [uLoopMCP Repository](https://github.com/hatayama/uLoopMCP) - Main package and documentation
|
|
128
|
+
- [Tool Reference](https://github.com/hatayama/uLoopMCP/blob/main/Packages/src/TOOL_REFERENCE.md) - Detailed tool specifications
|
|
129
|
+
|
|
130
|
+
## License
|
|
131
|
+
|
|
132
|
+
MIT License
|
package/dist/cli.bundle.cjs
CHANGED
|
@@ -5759,7 +5759,7 @@ var import_path3 = require("path");
|
|
|
5759
5759
|
|
|
5760
5760
|
// src/default-tools.json
|
|
5761
5761
|
var default_tools_default = {
|
|
5762
|
-
version: "0.54.
|
|
5762
|
+
version: "0.54.3",
|
|
5763
5763
|
tools: [
|
|
5764
5764
|
{
|
|
5765
5765
|
name: "compile",
|
|
@@ -6190,7 +6190,7 @@ function getCacheFilePath() {
|
|
|
6190
6190
|
}
|
|
6191
6191
|
|
|
6192
6192
|
// src/version.ts
|
|
6193
|
-
var VERSION = "0.54.
|
|
6193
|
+
var VERSION = "0.54.3";
|
|
6194
6194
|
|
|
6195
6195
|
// src/spinner.ts
|
|
6196
6196
|
var SPINNER_FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
@@ -6260,7 +6260,7 @@ function isRetryableError(error) {
|
|
|
6260
6260
|
return false;
|
|
6261
6261
|
}
|
|
6262
6262
|
const message = error.message;
|
|
6263
|
-
return message.includes("ECONNREFUSED") || message === "UNITY_NO_RESPONSE";
|
|
6263
|
+
return message.includes("ECONNREFUSED") || message.includes("EADDRNOTAVAIL") || message === "UNITY_NO_RESPONSE";
|
|
6264
6264
|
}
|
|
6265
6265
|
function isVersionOlder(v1, v2) {
|
|
6266
6266
|
const parsed1 = semver.valid(v1);
|
|
@@ -7328,6 +7328,15 @@ function extractGlobalOptions(options) {
|
|
|
7328
7328
|
port: options["port"]
|
|
7329
7329
|
};
|
|
7330
7330
|
}
|
|
7331
|
+
function isConnectionError(message) {
|
|
7332
|
+
return message.includes("ECONNREFUSED") || message.includes("EADDRNOTAVAIL");
|
|
7333
|
+
}
|
|
7334
|
+
function printConnectionError() {
|
|
7335
|
+
console.error("\x1B[31mError: Cannot connect to Unity.\x1B[0m");
|
|
7336
|
+
console.error("Make sure Unity Editor is open and uLoopMCP server is running.");
|
|
7337
|
+
console.error("");
|
|
7338
|
+
console.error("[For AI] Please report the above to the user.");
|
|
7339
|
+
}
|
|
7331
7340
|
async function runWithErrorHandling(fn) {
|
|
7332
7341
|
try {
|
|
7333
7342
|
await fn();
|
|
@@ -7353,9 +7362,8 @@ async function runWithErrorHandling(fn) {
|
|
|
7353
7362
|
console.error("Unity may be compiling, reloading, or starting. Please wait and try again.");
|
|
7354
7363
|
process.exit(1);
|
|
7355
7364
|
}
|
|
7356
|
-
if (message
|
|
7357
|
-
|
|
7358
|
-
console.error("Make sure Unity is running with uLoopMCP installed.");
|
|
7365
|
+
if (isConnectionError(message)) {
|
|
7366
|
+
printConnectionError();
|
|
7359
7367
|
process.exit(1);
|
|
7360
7368
|
}
|
|
7361
7369
|
console.error(`\x1B[31mError: ${message}\x1B[0m`);
|
|
@@ -7659,7 +7667,11 @@ async function main() {
|
|
|
7659
7667
|
}
|
|
7660
7668
|
} catch (error) {
|
|
7661
7669
|
const message = error instanceof Error ? error.message : String(error);
|
|
7662
|
-
|
|
7670
|
+
if (isConnectionError(message)) {
|
|
7671
|
+
printConnectionError();
|
|
7672
|
+
} else {
|
|
7673
|
+
console.error(`\x1B[31mError: Failed to sync tools: ${message}\x1B[0m`);
|
|
7674
|
+
}
|
|
7663
7675
|
process.exit(1);
|
|
7664
7676
|
}
|
|
7665
7677
|
}
|