uloop-cli 0.44.1
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/.prettierrc.json +28 -0
- package/CLAUDE.md +61 -0
- package/dist/cli.bundle.cjs +4761 -0
- package/dist/cli.bundle.cjs.map +7 -0
- package/eslint.config.mjs +72 -0
- package/jest.config.cjs +19 -0
- package/package.json +61 -0
- package/src/__tests__/cli-e2e.test.ts +349 -0
- package/src/__tests__/setup.ts +24 -0
- package/src/arg-parser.ts +128 -0
- package/src/cli.ts +489 -0
- package/src/default-tools.json +355 -0
- package/src/direct-unity-client.ts +125 -0
- package/src/execute-tool.ts +155 -0
- package/src/port-resolver.ts +60 -0
- package/src/project-root.ts +31 -0
- package/src/simple-framer.ts +97 -0
- package/src/skills/bundled-skills.ts +64 -0
- package/src/skills/markdown.d.ts +4 -0
- package/src/skills/skill-definitions/uloop-capture-gameview/SKILL.md +39 -0
- package/src/skills/skill-definitions/uloop-clear-console/SKILL.md +34 -0
- package/src/skills/skill-definitions/uloop-compile/SKILL.md +37 -0
- package/src/skills/skill-definitions/uloop-execute-dynamic-code/SKILL.md +79 -0
- package/src/skills/skill-definitions/uloop-execute-menu-item/SKILL.md +43 -0
- package/src/skills/skill-definitions/uloop-find-game-objects/SKILL.md +46 -0
- package/src/skills/skill-definitions/uloop-focus-window/SKILL.md +34 -0
- package/src/skills/skill-definitions/uloop-get-hierarchy/SKILL.md +44 -0
- package/src/skills/skill-definitions/uloop-get-logs/SKILL.md +45 -0
- package/src/skills/skill-definitions/uloop-get-menu-items/SKILL.md +44 -0
- package/src/skills/skill-definitions/uloop-get-project-info/SKILL.md +34 -0
- package/src/skills/skill-definitions/uloop-get-provider-details/SKILL.md +45 -0
- package/src/skills/skill-definitions/uloop-get-version/SKILL.md +31 -0
- package/src/skills/skill-definitions/uloop-run-tests/SKILL.md +43 -0
- package/src/skills/skill-definitions/uloop-unity-search/SKILL.md +44 -0
- package/src/skills/skills-command.ts +118 -0
- package/src/skills/skills-manager.ts +135 -0
- package/src/tool-cache.ts +104 -0
- package/src/version.ts +7 -0
- package/tsconfig.json +26 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unity project root detection utility.
|
|
3
|
+
* Searches upward from current directory to find Unity project markers.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { existsSync } from 'fs';
|
|
7
|
+
import { join, dirname } from 'path';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Find Unity project root by searching upward from start path.
|
|
11
|
+
* A Unity project is identified by having both Assets/ and ProjectSettings/ directories.
|
|
12
|
+
* Returns null if not inside a Unity project.
|
|
13
|
+
*/
|
|
14
|
+
export function findUnityProjectRoot(startPath: string = process.cwd()): string | null {
|
|
15
|
+
let currentPath = startPath;
|
|
16
|
+
|
|
17
|
+
while (true) {
|
|
18
|
+
const hasAssets = existsSync(join(currentPath, 'Assets'));
|
|
19
|
+
const hasProjectSettings = existsSync(join(currentPath, 'ProjectSettings'));
|
|
20
|
+
|
|
21
|
+
if (hasAssets && hasProjectSettings) {
|
|
22
|
+
return currentPath;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const parentPath = dirname(currentPath);
|
|
26
|
+
if (parentPath === currentPath) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
currentPath = parentPath;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple Content-Length framer for CLI usage.
|
|
3
|
+
* Minimal implementation without external dependencies.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const CONTENT_LENGTH_HEADER = 'Content-Length:';
|
|
7
|
+
const HEADER_SEPARATOR = '\r\n\r\n';
|
|
8
|
+
|
|
9
|
+
export function createFrame(jsonContent: string): string {
|
|
10
|
+
const contentLength = Buffer.byteLength(jsonContent, 'utf8');
|
|
11
|
+
return `${CONTENT_LENGTH_HEADER} ${contentLength}${HEADER_SEPARATOR}${jsonContent}`;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface FrameParseResult {
|
|
15
|
+
contentLength: number;
|
|
16
|
+
headerLength: number;
|
|
17
|
+
isComplete: boolean;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function parseFrameFromBuffer(data: Buffer): FrameParseResult {
|
|
21
|
+
if (!data || data.length === 0) {
|
|
22
|
+
return { contentLength: -1, headerLength: -1, isComplete: false };
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const separatorBuffer = Buffer.from(HEADER_SEPARATOR, 'utf8');
|
|
26
|
+
const separatorIndex = data.indexOf(separatorBuffer);
|
|
27
|
+
|
|
28
|
+
if (separatorIndex === -1) {
|
|
29
|
+
return { contentLength: -1, headerLength: -1, isComplete: false };
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const headerSection = data.subarray(0, separatorIndex).toString('utf8');
|
|
33
|
+
const headerLength = separatorIndex + separatorBuffer.length;
|
|
34
|
+
|
|
35
|
+
const contentLength = parseContentLength(headerSection);
|
|
36
|
+
if (contentLength === -1) {
|
|
37
|
+
return { contentLength: -1, headerLength: -1, isComplete: false };
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const expectedTotalLength = headerLength + contentLength;
|
|
41
|
+
const isComplete = data.length >= expectedTotalLength;
|
|
42
|
+
|
|
43
|
+
return { contentLength, headerLength, isComplete };
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface FrameExtractionResult {
|
|
47
|
+
jsonContent: string | null;
|
|
48
|
+
remainingData: Buffer;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function extractFrameFromBuffer(
|
|
52
|
+
data: Buffer,
|
|
53
|
+
contentLength: number,
|
|
54
|
+
headerLength: number,
|
|
55
|
+
): FrameExtractionResult {
|
|
56
|
+
if (!data || data.length === 0 || contentLength < 0 || headerLength < 0) {
|
|
57
|
+
return { jsonContent: null, remainingData: data || Buffer.alloc(0) };
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const expectedTotalLength = headerLength + contentLength;
|
|
61
|
+
|
|
62
|
+
if (data.length < expectedTotalLength) {
|
|
63
|
+
return { jsonContent: null, remainingData: data };
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const jsonContent = data.subarray(headerLength, headerLength + contentLength).toString('utf8');
|
|
67
|
+
const remainingData = data.subarray(expectedTotalLength);
|
|
68
|
+
|
|
69
|
+
return { jsonContent, remainingData };
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function parseContentLength(headerSection: string): number {
|
|
73
|
+
const lines = headerSection.split(/\r?\n/);
|
|
74
|
+
|
|
75
|
+
for (const line of lines) {
|
|
76
|
+
const trimmedLine = line.trim();
|
|
77
|
+
const lowerLine = trimmedLine.toLowerCase();
|
|
78
|
+
|
|
79
|
+
if (lowerLine.startsWith('content-length:')) {
|
|
80
|
+
const colonIndex = trimmedLine.indexOf(':');
|
|
81
|
+
if (colonIndex === -1 || colonIndex >= trimmedLine.length - 1) {
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const valueString = trimmedLine.substring(colonIndex + 1).trim();
|
|
86
|
+
const parsedValue = parseInt(valueString, 10);
|
|
87
|
+
|
|
88
|
+
if (isNaN(parsedValue) || parsedValue < 0) {
|
|
89
|
+
return -1;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return parsedValue;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return -1;
|
|
97
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bundled skill definitions for uloop CLI.
|
|
3
|
+
* These skills are embedded at build time via esbuild --loader:.md=text
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import compileSkill from './skill-definitions/uloop-compile/SKILL.md';
|
|
7
|
+
import getLogsSkill from './skill-definitions/uloop-get-logs/SKILL.md';
|
|
8
|
+
import runTestsSkill from './skill-definitions/uloop-run-tests/SKILL.md';
|
|
9
|
+
import clearConsoleSkill from './skill-definitions/uloop-clear-console/SKILL.md';
|
|
10
|
+
import focusWindowSkill from './skill-definitions/uloop-focus-window/SKILL.md';
|
|
11
|
+
import getHierarchySkill from './skill-definitions/uloop-get-hierarchy/SKILL.md';
|
|
12
|
+
import unitySearchSkill from './skill-definitions/uloop-unity-search/SKILL.md';
|
|
13
|
+
import getMenuItemsSkill from './skill-definitions/uloop-get-menu-items/SKILL.md';
|
|
14
|
+
import executeMenuItemSkill from './skill-definitions/uloop-execute-menu-item/SKILL.md';
|
|
15
|
+
import findGameObjectsSkill from './skill-definitions/uloop-find-game-objects/SKILL.md';
|
|
16
|
+
import captureGameviewSkill from './skill-definitions/uloop-capture-gameview/SKILL.md';
|
|
17
|
+
import executeDynamicCodeSkill from './skill-definitions/uloop-execute-dynamic-code/SKILL.md';
|
|
18
|
+
import getProviderDetailsSkill from './skill-definitions/uloop-get-provider-details/SKILL.md';
|
|
19
|
+
|
|
20
|
+
export interface BundledSkill {
|
|
21
|
+
name: string;
|
|
22
|
+
dirName: string;
|
|
23
|
+
content: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const BUNDLED_SKILLS: BundledSkill[] = [
|
|
27
|
+
{ name: 'uloop-compile', dirName: 'uloop-compile', content: compileSkill },
|
|
28
|
+
{ name: 'uloop-get-logs', dirName: 'uloop-get-logs', content: getLogsSkill },
|
|
29
|
+
{ name: 'uloop-run-tests', dirName: 'uloop-run-tests', content: runTestsSkill },
|
|
30
|
+
{ name: 'uloop-clear-console', dirName: 'uloop-clear-console', content: clearConsoleSkill },
|
|
31
|
+
{ name: 'uloop-focus-window', dirName: 'uloop-focus-window', content: focusWindowSkill },
|
|
32
|
+
{ name: 'uloop-get-hierarchy', dirName: 'uloop-get-hierarchy', content: getHierarchySkill },
|
|
33
|
+
{ name: 'uloop-unity-search', dirName: 'uloop-unity-search', content: unitySearchSkill },
|
|
34
|
+
{ name: 'uloop-get-menu-items', dirName: 'uloop-get-menu-items', content: getMenuItemsSkill },
|
|
35
|
+
{
|
|
36
|
+
name: 'uloop-execute-menu-item',
|
|
37
|
+
dirName: 'uloop-execute-menu-item',
|
|
38
|
+
content: executeMenuItemSkill,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'uloop-find-game-objects',
|
|
42
|
+
dirName: 'uloop-find-game-objects',
|
|
43
|
+
content: findGameObjectsSkill,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'uloop-capture-gameview',
|
|
47
|
+
dirName: 'uloop-capture-gameview',
|
|
48
|
+
content: captureGameviewSkill,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'uloop-execute-dynamic-code',
|
|
52
|
+
dirName: 'uloop-execute-dynamic-code',
|
|
53
|
+
content: executeDynamicCodeSkill,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: 'uloop-get-provider-details',
|
|
57
|
+
dirName: 'uloop-get-provider-details',
|
|
58
|
+
content: getProviderDetailsSkill,
|
|
59
|
+
},
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
export function getBundledSkillByName(name: string): BundledSkill | undefined {
|
|
63
|
+
return BUNDLED_SKILLS.find((skill) => skill.name === name);
|
|
64
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: uloop-capture-gameview
|
|
3
|
+
description: Capture Unity Game View as PNG via uloop CLI. Use when you need to: (1) Take a screenshot of the current Game View, (2) Capture visual state for debugging or verification, (3) Save game output as an image file.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# uloop capture-gameview
|
|
7
|
+
|
|
8
|
+
Capture Unity Game View and save as PNG image.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
uloop capture-gameview [--resolution-scale <scale>]
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
| Parameter | Type | Default | Description |
|
|
19
|
+
|-----------|------|---------|-------------|
|
|
20
|
+
| `--resolution-scale` | number | `1.0` | Resolution scale (0.1 to 1.0) |
|
|
21
|
+
|
|
22
|
+
## Examples
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# Capture at full resolution
|
|
26
|
+
uloop capture-gameview
|
|
27
|
+
|
|
28
|
+
# Capture at half resolution
|
|
29
|
+
uloop capture-gameview --resolution-scale 0.5
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Output
|
|
33
|
+
|
|
34
|
+
Returns JSON with file path to the saved PNG image.
|
|
35
|
+
|
|
36
|
+
## Notes
|
|
37
|
+
|
|
38
|
+
- Use `uloop focus-window` first if needed
|
|
39
|
+
- Game View must be visible in Unity Editor
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: uloop-clear-console
|
|
3
|
+
description: Clear Unity console logs via uloop CLI. Use when you need to: (1) Clear the console before running tests, (2) Start a fresh debugging session, (3) Clean up log output for better readability.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# uloop clear-console
|
|
7
|
+
|
|
8
|
+
Clear Unity console logs.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
uloop clear-console [--add-confirmation-message]
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
| Parameter | Type | Default | Description |
|
|
19
|
+
|-----------|------|---------|-------------|
|
|
20
|
+
| `--add-confirmation-message` | boolean | `false` | Add confirmation message after clearing |
|
|
21
|
+
|
|
22
|
+
## Examples
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# Clear console
|
|
26
|
+
uloop clear-console
|
|
27
|
+
|
|
28
|
+
# Clear with confirmation
|
|
29
|
+
uloop clear-console --add-confirmation-message
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Output
|
|
33
|
+
|
|
34
|
+
Returns JSON confirming the console was cleared.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: uloop-compile
|
|
3
|
+
description: Compile Unity project via uloop CLI. Use when you need to: (1) Verify C# code compiles successfully after editing scripts, (2) Check for compile errors or warnings, (3) Validate script changes before running tests.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# uloop compile
|
|
7
|
+
|
|
8
|
+
Execute Unity project compilation.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
uloop compile [--force-recompile]
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
| Parameter | Type | Description |
|
|
19
|
+
|-----------|------|-------------|
|
|
20
|
+
| `--force-recompile` | boolean | Force full recompilation (triggers Domain Reload) |
|
|
21
|
+
|
|
22
|
+
## Examples
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# Check compilation
|
|
26
|
+
uloop compile
|
|
27
|
+
|
|
28
|
+
# Force full recompilation
|
|
29
|
+
uloop compile --force-recompile
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Output
|
|
33
|
+
|
|
34
|
+
Returns JSON:
|
|
35
|
+
- `Success`: boolean
|
|
36
|
+
- `ErrorCount`: number
|
|
37
|
+
- `WarningCount`: number
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: uloop-execute-dynamic-code
|
|
3
|
+
description: Execute C# code dynamically in Unity Editor via uloop CLI. Use for editor automation: (1) Prefab/material wiring and AddComponent operations, (2) Reference wiring with SerializedObject, (3) Scene/hierarchy edits and batch operations. NOT for file I/O or script authoring.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# uloop execute-dynamic-code
|
|
7
|
+
|
|
8
|
+
Execute C# code dynamically in Unity Editor.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
uloop execute-dynamic-code --code '<c# code>'
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
| Parameter | Type | Description |
|
|
19
|
+
|-----------|------|-------------|
|
|
20
|
+
| `--code` | string | C# code to execute (direct statements, no class wrapper) |
|
|
21
|
+
| `--compile-only` | boolean | Compile without execution |
|
|
22
|
+
| `--auto-qualify-unity-types-once` | boolean | Auto-qualify Unity types |
|
|
23
|
+
|
|
24
|
+
## Code Format
|
|
25
|
+
|
|
26
|
+
Write direct statements only (no classes/namespaces/methods). Return is optional.
|
|
27
|
+
|
|
28
|
+
```csharp
|
|
29
|
+
// Using directives at top are hoisted
|
|
30
|
+
using UnityEngine;
|
|
31
|
+
var x = Mathf.PI;
|
|
32
|
+
return x;
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## String Literals (Shell-specific)
|
|
36
|
+
|
|
37
|
+
| Shell | Method |
|
|
38
|
+
|-------|--------|
|
|
39
|
+
| bash/zsh/MINGW64/Git Bash | `'Debug.Log("Hello!");'` |
|
|
40
|
+
| PowerShell | `'Debug.Log(""Hello!"");'` |
|
|
41
|
+
|
|
42
|
+
## Allowed Operations
|
|
43
|
+
|
|
44
|
+
- Prefab/material wiring (PrefabUtility)
|
|
45
|
+
- AddComponent + reference wiring (SerializedObject)
|
|
46
|
+
- Scene/hierarchy edits
|
|
47
|
+
- Inspector modifications
|
|
48
|
+
|
|
49
|
+
## Forbidden Operations
|
|
50
|
+
|
|
51
|
+
- System.IO.* (File/Directory/Path)
|
|
52
|
+
- AssetDatabase.CreateFolder / file writes
|
|
53
|
+
- Create/edit .cs/.asmdef files
|
|
54
|
+
|
|
55
|
+
## Examples
|
|
56
|
+
|
|
57
|
+
### bash / zsh / MINGW64 / Git Bash
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
uloop execute-dynamic-code --code 'return Selection.activeGameObject?.name;'
|
|
61
|
+
uloop execute-dynamic-code --code 'new GameObject("MyObject");'
|
|
62
|
+
uloop execute-dynamic-code --code 'UnityEngine.Debug.Log("Hello from CLI!");'
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### PowerShell
|
|
66
|
+
|
|
67
|
+
```powershell
|
|
68
|
+
uloop execute-dynamic-code --code 'return Selection.activeGameObject?.name;'
|
|
69
|
+
uloop execute-dynamic-code --code 'new GameObject(""MyObject"");'
|
|
70
|
+
uloop execute-dynamic-code --code 'UnityEngine.Debug.Log(""Hello from CLI!"");'
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Output
|
|
74
|
+
|
|
75
|
+
Returns JSON with execution result or compile errors.
|
|
76
|
+
|
|
77
|
+
## Notes
|
|
78
|
+
|
|
79
|
+
For file/directory operations, use terminal commands instead.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: uloop-execute-menu-item
|
|
3
|
+
description: Execute Unity MenuItem via uloop CLI. Use when you need to: (1) Trigger menu commands programmatically, (2) Automate editor actions (save, build, refresh), (3) Run custom menu items defined in scripts.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# uloop execute-menu-item
|
|
7
|
+
|
|
8
|
+
Execute Unity MenuItem.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
uloop execute-menu-item --menu-item-path "<path>"
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
| Parameter | Type | Default | Description |
|
|
19
|
+
|-----------|------|---------|-------------|
|
|
20
|
+
| `--menu-item-path` | string | - | Menu item path (e.g., "GameObject/Create Empty") |
|
|
21
|
+
| `--use-reflection-fallback` | boolean | `true` | Use reflection fallback |
|
|
22
|
+
|
|
23
|
+
## Examples
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# Create empty GameObject
|
|
27
|
+
uloop execute-menu-item --menu-item-path "GameObject/Create Empty"
|
|
28
|
+
|
|
29
|
+
# Save scene
|
|
30
|
+
uloop execute-menu-item --menu-item-path "File/Save"
|
|
31
|
+
|
|
32
|
+
# Open project settings
|
|
33
|
+
uloop execute-menu-item --menu-item-path "Edit/Project Settings..."
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Output
|
|
37
|
+
|
|
38
|
+
Returns JSON with execution result.
|
|
39
|
+
|
|
40
|
+
## Notes
|
|
41
|
+
|
|
42
|
+
- Use `uloop get-menu-items` to discover available menu paths
|
|
43
|
+
- Some menu items may require specific context or selection
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: uloop-find-game-objects
|
|
3
|
+
description: Find GameObjects with search criteria via uloop CLI. Use when you need to: (1) Locate GameObjects by name pattern, (2) Find objects by tag or layer, (3) Search for objects with specific component types.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# uloop find-game-objects
|
|
7
|
+
|
|
8
|
+
Find GameObjects with search criteria.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
uloop find-game-objects [options]
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
| Parameter | Type | Default | Description |
|
|
19
|
+
|-----------|------|---------|-------------|
|
|
20
|
+
| `--name-pattern` | string | - | Name pattern to search |
|
|
21
|
+
| `--search-mode` | string | `Contains` | Search mode: `Exact`, `Path`, `Regex`, `Contains` |
|
|
22
|
+
| `--required-components` | array | - | Required components |
|
|
23
|
+
| `--tag` | string | - | Tag filter |
|
|
24
|
+
| `--layer` | string | - | Layer filter |
|
|
25
|
+
| `--max-results` | integer | `20` | Maximum number of results |
|
|
26
|
+
| `--include-inactive` | boolean | `false` | Include inactive GameObjects |
|
|
27
|
+
|
|
28
|
+
## Examples
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# Find by name
|
|
32
|
+
uloop find-game-objects --name-pattern "Player"
|
|
33
|
+
|
|
34
|
+
# Find with component
|
|
35
|
+
uloop find-game-objects --required-components Rigidbody
|
|
36
|
+
|
|
37
|
+
# Find by tag
|
|
38
|
+
uloop find-game-objects --tag "Enemy"
|
|
39
|
+
|
|
40
|
+
# Regex search
|
|
41
|
+
uloop find-game-objects --name-pattern "UI_.*" --search-mode Regex
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Output
|
|
45
|
+
|
|
46
|
+
Returns JSON array of matching GameObjects with paths and components.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: uloop-focus-window
|
|
3
|
+
description: Bring Unity Editor window to front via uloop CLI. Use when you need to: (1) Focus Unity Editor before capturing screenshots, (2) Ensure Unity window is visible for visual checks, (3) Bring Unity to foreground for user interaction.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# uloop focus-window
|
|
7
|
+
|
|
8
|
+
Bring Unity Editor window to front.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
uloop focus-window
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
None.
|
|
19
|
+
|
|
20
|
+
## Examples
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# Focus Unity Editor
|
|
24
|
+
uloop focus-window
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Output
|
|
28
|
+
|
|
29
|
+
Returns JSON confirming the window was focused.
|
|
30
|
+
|
|
31
|
+
## Notes
|
|
32
|
+
|
|
33
|
+
- Useful before `uloop capture-gameview` to ensure Game View is visible
|
|
34
|
+
- Brings the main Unity Editor window to the foreground
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: uloop-get-hierarchy
|
|
3
|
+
description: Get Unity Hierarchy structure via uloop CLI. Use when you need to: (1) Inspect scene structure and GameObject tree, (2) Find GameObjects and their parent-child relationships, (3) Check component attachments on objects.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# uloop get-hierarchy
|
|
7
|
+
|
|
8
|
+
Get Unity Hierarchy structure.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
uloop get-hierarchy [options]
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
| Parameter | Type | Default | Description |
|
|
19
|
+
|-----------|------|---------|-------------|
|
|
20
|
+
| `--root-path` | string | - | Root GameObject path to start from |
|
|
21
|
+
| `--max-depth` | integer | `-1` | Maximum depth (-1 for unlimited) |
|
|
22
|
+
| `--include-components` | boolean | `true` | Include component information |
|
|
23
|
+
| `--include-inactive` | boolean | `true` | Include inactive GameObjects |
|
|
24
|
+
| `--include-paths` | boolean | `false` | Include full path information |
|
|
25
|
+
|
|
26
|
+
## Examples
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# Get entire hierarchy
|
|
30
|
+
uloop get-hierarchy
|
|
31
|
+
|
|
32
|
+
# Get hierarchy from specific root
|
|
33
|
+
uloop get-hierarchy --root-path "Canvas/UI"
|
|
34
|
+
|
|
35
|
+
# Limit depth
|
|
36
|
+
uloop get-hierarchy --max-depth 2
|
|
37
|
+
|
|
38
|
+
# Without components
|
|
39
|
+
uloop get-hierarchy --include-components false
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Output
|
|
43
|
+
|
|
44
|
+
Returns JSON with hierarchical structure of GameObjects and their components.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: uloop-get-logs
|
|
3
|
+
description: Retrieve Unity Console logs via uloop CLI. Use when you need to: (1) Check for errors or warnings after operations, (2) Debug runtime issues in Unity Editor, (3) Investigate unexpected behavior or exceptions.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# uloop get-logs
|
|
7
|
+
|
|
8
|
+
Retrieve logs from Unity Console.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
uloop get-logs [options]
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
| Parameter | Type | Default | Description |
|
|
19
|
+
|-----------|------|---------|-------------|
|
|
20
|
+
| `--log-type` | string | `All` | Log type filter: `Error`, `Warning`, `Log`, `All` |
|
|
21
|
+
| `--max-count` | integer | `100` | Maximum number of logs to retrieve |
|
|
22
|
+
| `--search-text` | string | - | Text to search within logs |
|
|
23
|
+
| `--include-stack-trace` | boolean | `true` | Include stack trace in output |
|
|
24
|
+
| `--use-regex` | boolean | `false` | Use regex for search |
|
|
25
|
+
| `--search-in-stack-trace` | boolean | `false` | Search within stack trace |
|
|
26
|
+
|
|
27
|
+
## Examples
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# Get all logs
|
|
31
|
+
uloop get-logs
|
|
32
|
+
|
|
33
|
+
# Get only errors
|
|
34
|
+
uloop get-logs --log-type Error
|
|
35
|
+
|
|
36
|
+
# Search for specific text
|
|
37
|
+
uloop get-logs --search-text "NullReference"
|
|
38
|
+
|
|
39
|
+
# Regex search
|
|
40
|
+
uloop get-logs --search-text "Missing.*Component" --use-regex
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Output
|
|
44
|
+
|
|
45
|
+
Returns JSON array of log entries with message, type, and optional stack trace.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: uloop-get-menu-items
|
|
3
|
+
description: Retrieve Unity MenuItems via uloop CLI. Use when you need to: (1) Discover available menu commands in Unity Editor, (2) Find menu paths for automation, (3) Prepare for executing menu items programmatically.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# uloop get-menu-items
|
|
7
|
+
|
|
8
|
+
Retrieve Unity MenuItems.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
uloop get-menu-items [options]
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
| Parameter | Type | Default | Description |
|
|
19
|
+
|-----------|------|---------|-------------|
|
|
20
|
+
| `--filter-text` | string | - | Filter text |
|
|
21
|
+
| `--filter-type` | string | `contains` | Filter type: `contains`, `exact`, `startswith` |
|
|
22
|
+
| `--max-count` | integer | `200` | Maximum number of items |
|
|
23
|
+
| `--include-validation` | boolean | `false` | Include validation functions |
|
|
24
|
+
|
|
25
|
+
## Examples
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# List all menu items
|
|
29
|
+
uloop get-menu-items
|
|
30
|
+
|
|
31
|
+
# Filter by text
|
|
32
|
+
uloop get-menu-items --filter-text "GameObject"
|
|
33
|
+
|
|
34
|
+
# Exact match
|
|
35
|
+
uloop get-menu-items --filter-text "File/Save" --filter-type exact
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Output
|
|
39
|
+
|
|
40
|
+
Returns JSON array of menu items with paths and metadata.
|
|
41
|
+
|
|
42
|
+
## Notes
|
|
43
|
+
|
|
44
|
+
Use with `uloop execute-menu-item` to run discovered menu commands.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: uloop-get-project-info
|
|
3
|
+
description: Get Unity project information via uloop CLI. Use when you need to: (1) Check Unity Editor version, (2) Get project settings and platform info, (3) Retrieve project metadata for diagnostics.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# uloop get-project-info
|
|
7
|
+
|
|
8
|
+
Get detailed Unity project information.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
uloop get-project-info
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
None.
|
|
19
|
+
|
|
20
|
+
## Examples
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# Get project info
|
|
24
|
+
uloop get-project-info
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Output
|
|
28
|
+
|
|
29
|
+
Returns JSON with project information:
|
|
30
|
+
- Unity version
|
|
31
|
+
- Project name
|
|
32
|
+
- Platform settings
|
|
33
|
+
- Build target
|
|
34
|
+
- Other project metadata
|