@unibridge/cli 0.5.0 → 0.8.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Marcus Sanatan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,74 @@
1
+ # @unibridge/cli
2
+
3
+ CLI for interacting with Unity Editor projects through UniBridge.
4
+
5
+ ## Install
6
+
7
+ Use without global install:
8
+
9
+ ```bash
10
+ npx @unibridge/cli --help
11
+ ```
12
+
13
+ Install globally:
14
+
15
+ ```bash
16
+ npm install -g @unibridge/cli
17
+ unibridge --help
18
+ ```
19
+
20
+ ## Requirements
21
+
22
+ - Node.js `>=22.18.0`
23
+ - A Unity project
24
+ - UniBridge Unity plugin installed in that project
25
+
26
+ ## Setup
27
+
28
+ Install the Unity plugin in the current Unity project:
29
+
30
+ ```bash
31
+ unibridge init
32
+ ```
33
+
34
+ `update` is an alias for `init` and can be used to re-run this idempotently after SDK/CLI upgrades:
35
+
36
+ ```bash
37
+ unibridge update
38
+ ```
39
+
40
+ Or provide a specific project path:
41
+
42
+ ```bash
43
+ unibridge --project /path/to/UnityProject init
44
+ ```
45
+
46
+ ## Common Commands
47
+
48
+ ```bash
49
+ unibridge status
50
+ unibridge logs --severity warn --limit 100 --offset 0
51
+ unibridge gameobject create Player --dimension 2d --position 0,1,0
52
+ unibridge gameobject create Enemy --parent-instance-id 12345 --primitive cube
53
+ unibridge gameobject destroy --instance-id 12345
54
+ unibridge test list --mode edit --limit 50 --offset 0
55
+ unibridge test run --mode edit --filter DomainReloadCommandHandlerTests
56
+ unibridge domain reload
57
+ unibridge scene active
58
+ unibridge scene list --limit 50 --offset 0
59
+ unibridge scene hierarchy --limit 200 --offset 0
60
+ unibridge scene create Assets/Scenes/NewScene.unity
61
+ unibridge scene open Assets/Scenes/SampleScene.unity
62
+ ```
63
+
64
+ Run commands with JSON output:
65
+
66
+ ```bash
67
+ unibridge --json status
68
+ ```
69
+
70
+ ## Identity
71
+
72
+ - `gameobject create` responses include `instanceId` and `path`.
73
+ - `scene hierarchy` node entries include `instanceId`, `path`, `parentIndex`, and `siblingIndex`.
74
+ - `instanceId` is session-local and ideal for follow-up commands during an active Unity session.
@@ -0,0 +1,49 @@
1
+ import type { Command } from 'commander';
2
+ import type { GameObjectCreateInput, GameObjectCreateResult, GameObjectDestroyInput, GameObjectDestroyResult, GameObjectUpdateInput, GameObjectUpdateResult } from '@unibridge/sdk';
3
+ interface GameObjectCreateOptions {
4
+ parent?: string;
5
+ parentInstanceId?: string;
6
+ dimension?: string;
7
+ primitive?: string;
8
+ space?: string;
9
+ position?: string;
10
+ rotation?: string;
11
+ scale?: string;
12
+ }
13
+ interface GameObjectCreateDeps {
14
+ create: (input: GameObjectCreateInput) => Promise<GameObjectCreateResult>;
15
+ console: Pick<Console, 'log' | 'error'>;
16
+ exit?: (code: number) => void;
17
+ }
18
+ interface GameObjectDestroyOptions {
19
+ path?: string;
20
+ instanceId?: string;
21
+ }
22
+ interface GameObjectDestroyDeps {
23
+ destroy: (input: GameObjectDestroyInput) => Promise<GameObjectDestroyResult>;
24
+ console: Pick<Console, 'log' | 'error'>;
25
+ exit?: (code: number) => void;
26
+ }
27
+ interface GameObjectUpdateOptions {
28
+ path?: string;
29
+ instanceId?: string;
30
+ name?: string;
31
+ tag?: string;
32
+ layer?: string;
33
+ isStatic?: string;
34
+ space?: string;
35
+ position?: string;
36
+ rotation?: string;
37
+ scale?: string;
38
+ }
39
+ interface GameObjectUpdateDeps {
40
+ update: (input: GameObjectUpdateInput) => Promise<GameObjectUpdateResult>;
41
+ console: Pick<Console, 'log' | 'error'>;
42
+ exit?: (code: number) => void;
43
+ }
44
+ export declare function handleGameObjectCreate(name: string, opts: GameObjectCreateOptions, jsonOutput: boolean, deps: GameObjectCreateDeps): Promise<void>;
45
+ export declare function handleGameObjectDestroy(opts: GameObjectDestroyOptions, jsonOutput: boolean, deps: GameObjectDestroyDeps): Promise<void>;
46
+ export declare function handleGameObjectUpdate(opts: GameObjectUpdateOptions, jsonOutput: boolean, deps: GameObjectUpdateDeps): Promise<void>;
47
+ export declare function registerGameObject(program: Command): void;
48
+ export {};
49
+ //# sourceMappingURL=gameobject.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gameobject.d.ts","sourceRoot":"","sources":["../../src/commands/gameobject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,KAAK,EAAmB,qBAAqB,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,uBAAuB,EAAuB,qBAAqB,EAAE,sBAAsB,EAAqC,MAAM,gBAAgB,CAAA;AAI5P,UAAU,uBAAuB;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,S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E,CAAC,KAAK,EAAE,qBAAqB,KAAK,OAAO,CAAC,sBAAsB,CAAC,CAAA;IACzE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,GAAG,OAAO,CAAC,CAAA;IACvC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAC9B;AA6FD,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,uBAAuB,EAC7B,UAAU,EAAE,OAAO,EACnB,IAAI,EAAE,oBAAoB,GACzB,OAAO,CAAC,IAAI,CAAC,CAyBf;AAED,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,wBAAwB,EAC9B,UAAU,EAAE,OAAO,EACnB,IAAI,EAAE,qBAAqB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAqBf;AAED,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,uBAAuB,EAC7B,UAAU,EAAE,OAAO,EACnB,IAAI,EAAE,oBAAoB,GACzB,OAAO,CAAC,IAAI,CAAC,CAyCf;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAiFzD"}
@@ -0,0 +1,218 @@
1
+ import { runWithOutput } from "./output.js";
2
+ import { withUnityClient } from "./with-unity-client.js";
3
+ function parseDimension(value) {
4
+ if (value == null) {
5
+ return undefined;
6
+ }
7
+ if (value === '2d' || value === '3d') {
8
+ return value;
9
+ }
10
+ throw new Error('--dimension must be one of: 2d, 3d.');
11
+ }
12
+ function parsePrimitive(value) {
13
+ if (value == null) {
14
+ return undefined;
15
+ }
16
+ if (value === 'cube' || value === 'sphere' || value === 'capsule' || value === 'cylinder' || value === 'plane' || value === 'quad') {
17
+ return value;
18
+ }
19
+ throw new Error('--primitive must be one of: cube, sphere, capsule, cylinder, plane, quad.');
20
+ }
21
+ function parseSpace(value) {
22
+ if (value == null) {
23
+ return undefined;
24
+ }
25
+ if (value === 'local' || value === 'world') {
26
+ return value;
27
+ }
28
+ throw new Error('--space must be one of: local, world.');
29
+ }
30
+ function parseVector3(value, label) {
31
+ if (value == null) {
32
+ return undefined;
33
+ }
34
+ const parts = value.split(',').map((part) => Number.parseFloat(part.trim()));
35
+ if (parts.length !== 3 || parts.some((part) => !Number.isFinite(part))) {
36
+ throw new Error(`${label} must be in x,y,z format.`);
37
+ }
38
+ return { x: parts[0], y: parts[1], z: parts[2] };
39
+ }
40
+ function parseTransform(opts) {
41
+ const transform = {
42
+ space: parseSpace(opts.space),
43
+ position: parseVector3(opts.position, '--position'),
44
+ rotation: parseVector3(opts.rotation, '--rotation'),
45
+ scale: parseVector3(opts.scale, '--scale'),
46
+ };
47
+ if (transform.space == null && transform.position == null && transform.rotation == null && transform.scale == null) {
48
+ return undefined;
49
+ }
50
+ return transform;
51
+ }
52
+ function parseParentInstanceId(value) {
53
+ if (value == null) {
54
+ return undefined;
55
+ }
56
+ const parsed = Number.parseInt(value, 10);
57
+ if (!Number.isInteger(parsed)) {
58
+ throw new Error('--parent-instance-id must be an integer.');
59
+ }
60
+ return parsed;
61
+ }
62
+ function parseInstanceId(value, label) {
63
+ if (value == null) {
64
+ return undefined;
65
+ }
66
+ const parsed = Number.parseInt(value, 10);
67
+ if (!Number.isInteger(parsed)) {
68
+ throw new Error(`${label} must be an integer.`);
69
+ }
70
+ return parsed;
71
+ }
72
+ function parseBoolean(value, label) {
73
+ if (value == null) {
74
+ return undefined;
75
+ }
76
+ if (value === 'true') {
77
+ return true;
78
+ }
79
+ if (value === 'false') {
80
+ return false;
81
+ }
82
+ throw new Error(`${label} must be true or false.`);
83
+ }
84
+ export async function handleGameObjectCreate(name, opts, jsonOutput, deps) {
85
+ if (opts.parent != null && opts.parentInstanceId != null) {
86
+ throw new Error('Use either --parent or --parent-instance-id, not both.');
87
+ }
88
+ const input = {
89
+ name,
90
+ parent: opts.parent,
91
+ parentInstanceId: parseParentInstanceId(opts.parentInstanceId),
92
+ dimension: parseDimension(opts.dimension),
93
+ primitive: parsePrimitive(opts.primitive),
94
+ transform: parseTransform(opts),
95
+ };
96
+ await runWithOutput(jsonOutput, deps, () => deps.create(input), (result, output) => {
97
+ output.log(`Created: ${result.path}`);
98
+ output.log(`Id: ${result.instanceId}`);
99
+ output.log(`Active: ${result.isActive ? 'yes' : 'no'}`);
100
+ output.log(`Sibling: ${result.siblingIndex}`);
101
+ });
102
+ }
103
+ export async function handleGameObjectDestroy(opts, jsonOutput, deps) {
104
+ const instanceId = parseInstanceId(opts.instanceId, '--instance-id');
105
+ const path = opts.path;
106
+ if ((path == null || path.length === 0) && instanceId == null) {
107
+ throw new Error('Provide either --path or --instance-id.');
108
+ }
109
+ if (path != null && instanceId != null) {
110
+ throw new Error('Use either --path or --instance-id, not both.');
111
+ }
112
+ await runWithOutput(jsonOutput, deps, () => deps.destroy({ path, instanceId }), (result, output) => {
113
+ output.log(`Destroyed: ${result.path}`);
114
+ output.log(`Id: ${result.instanceId}`);
115
+ output.log(`Name: ${result.name}`);
116
+ });
117
+ }
118
+ export async function handleGameObjectUpdate(opts, jsonOutput, deps) {
119
+ const instanceId = parseInstanceId(opts.instanceId, '--instance-id');
120
+ const path = opts.path;
121
+ if ((path == null || path.length === 0) && instanceId == null) {
122
+ throw new Error('Provide either --path or --instance-id.');
123
+ }
124
+ if (path != null && instanceId != null) {
125
+ throw new Error('Use either --path or --instance-id, not both.');
126
+ }
127
+ const transform = parseTransform(opts);
128
+ const isStatic = parseBoolean(opts.isStatic, '--is-static');
129
+ const hasAnyUpdate = opts.name != null || opts.tag != null || opts.layer != null || isStatic != null || transform != null;
130
+ if (!hasAnyUpdate) {
131
+ throw new Error('Provide at least one update field.');
132
+ }
133
+ const input = {
134
+ path,
135
+ instanceId,
136
+ name: opts.name,
137
+ tag: opts.tag,
138
+ layer: opts.layer,
139
+ isStatic,
140
+ transform,
141
+ };
142
+ await runWithOutput(jsonOutput, deps, () => deps.update(input), (result, output) => {
143
+ output.log(`Updated: ${result.path}`);
144
+ output.log(`Id: ${result.instanceId}`);
145
+ output.log(`Tag: ${result.tag}`);
146
+ output.log(`Layer: ${result.layer}`);
147
+ output.log(`Static: ${result.isStatic ? 'yes' : 'no'}`);
148
+ output.log(`Pos: ${result.transform.position.x},${result.transform.position.y},${result.transform.position.z}`);
149
+ });
150
+ }
151
+ export function registerGameObject(program) {
152
+ const gameObject = program
153
+ .command('gameobject')
154
+ .description('Create and manage Unity GameObjects');
155
+ gameObject
156
+ .command('create <name>')
157
+ .description('Create a GameObject with optional parent, primitive, and transform')
158
+ .option('--parent <path>', 'Parent GameObject path, e.g. /Environment')
159
+ .option('--parent-instance-id <id>', 'Parent GameObject instance ID (session-local)')
160
+ .option('--dimension <dimension>', 'Object type (2d|3d). 2d auto-adds SpriteRenderer')
161
+ .option('--primitive <primitive>', '3D primitive (cube|sphere|capsule|cylinder|plane|quad)')
162
+ .option('--space <space>', 'Transform space (local|world)')
163
+ .option('--position <x,y,z>', 'Initial position vector')
164
+ .option('--rotation <x,y,z>', 'Initial euler rotation vector')
165
+ .option('--scale <x,y,z>', 'Initial local scale vector')
166
+ .action(async (name, opts, command) => {
167
+ await withUnityClient(command, { requirePlugin: true }, async (client, ctx) => {
168
+ await handleGameObjectCreate(name, opts, ctx.jsonOutput, {
169
+ create: (input) => client.gameObjectCreate(input),
170
+ console,
171
+ exit: (exitCode) => {
172
+ process.exitCode = exitCode;
173
+ },
174
+ });
175
+ });
176
+ });
177
+ gameObject
178
+ .command('destroy')
179
+ .description('Destroy a GameObject by path or instance ID')
180
+ .option('--path <path>', 'GameObject path, e.g. /Environment/Enemy_01')
181
+ .option('--instance-id <id>', 'GameObject instance ID (session-local)')
182
+ .action(async (opts, command) => {
183
+ await withUnityClient(command, { requirePlugin: true }, async (client, ctx) => {
184
+ await handleGameObjectDestroy(opts, ctx.jsonOutput, {
185
+ destroy: (input) => client.gameObjectDestroy(input),
186
+ console,
187
+ exit: (exitCode) => {
188
+ process.exitCode = exitCode;
189
+ },
190
+ });
191
+ });
192
+ });
193
+ gameObject
194
+ .command('update')
195
+ .description('Update GameObject properties by path or instance ID')
196
+ .option('--path <path>', 'GameObject path, e.g. /Environment/Enemy_01')
197
+ .option('--instance-id <id>', 'GameObject instance ID (session-local)')
198
+ .option('--name <name>', 'Updated GameObject name')
199
+ .option('--tag <tag>', 'Updated Unity tag')
200
+ .option('--layer <layer>', 'Updated Unity layer name or index')
201
+ .option('--is-static <true|false>', 'Set static flag')
202
+ .option('--space <space>', 'Transform space (local|world)')
203
+ .option('--position <x,y,z>', 'Updated position vector')
204
+ .option('--rotation <x,y,z>', 'Updated euler rotation vector')
205
+ .option('--scale <x,y,z>', 'Updated local scale vector')
206
+ .action(async (opts, command) => {
207
+ await withUnityClient(command, { requirePlugin: true }, async (client, ctx) => {
208
+ await handleGameObjectUpdate(opts, ctx.jsonOutput, {
209
+ update: (input) => client.gameObjectUpdate(input),
210
+ console,
211
+ exit: (exitCode) => {
212
+ process.exitCode = exitCode;
213
+ },
214
+ });
215
+ });
216
+ });
217
+ }
218
+ //# sourceMappingURL=gameobject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gameobject.js","sourceRoot":"","sources":["../../src/commands/gameobject.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAiDxD,SAAS,cAAc,CAAC,KAAyB;IAC/C,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;QAClB,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACrC,OAAO,KAAK,CAAA;IACd,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAA;AACxD,CAAC;AAED,SAAS,cAAc,CAAC,KAAyB;IAC/C,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;QAClB,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,IAAI,KAAK,KA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AAM,CAAA;IACd,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAED,UAAU,eAAe;IACvB,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,UAAU,CAAC,CAAA;IACpD,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,GAAG,OAAO,CAAC,CAAA;CACxC;AAED,wBAAsB,UAAU,CAC9B,IAAI,EAAE,kBAAkB,EACxB,UAAU,EAAE,OAAO,EACnB,IAAI,GAAE,eAA4C,GACjD,OAAO,CAAC,IAAI,CAAC,CAiBf;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAiBnD"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAmB,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAInF,UAAU,kBAAkB;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAED,UAAU,eAAe;IACvB,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,UAAU,CAAC,CAAA;IACpD,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,GAAG,OAAO,CAAC,CAAA;CACxC;AAED,wBAAsB,UAAU,CAC9B,IAAI,EAAE,kBAAkB,EACxB,UAAU,EAAE,OAAO,EACnB,IAAI,GAAE,eAA4C,GACjD,OAAO,CAAC,IAAI,CAAC,CAiBf;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAkBnD"}
@@ -16,7 +16,8 @@ export async function handleInit(opts, jsonOutput, deps = { init: sdkInit, conso
16
16
  export function registerInit(program) {
17
17
  program
18
18
  .command('init')
19
- .description('Install the unibridge plugin into a Unity project')
19
+ .alias('update')
20
+ .description('Install or update the unibridge plugin into a Unity project (alias: update)')
20
21
  .option('--local <path>', 'Install from a local path')
21
22
  .option('--git <url>', 'Install from a custom git URL')
22
23
  .action(async (opts, command) => {
@@ -1 +1 @@
1
- {"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,IAAI,OAAO,EAAqC,MAAM,gBAAgB,CAAA;AACnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAY3C,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,IAAwB,EACxB,UAAmB,EACnB,OAAwB,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE;IAElD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK;QACvB,CAAC,CAAC,EAAE,IAAI,EAAE,OAAgB,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE;QAC9C,CAAC,CAAC,IAAI,CAAC,GAAG;YACR,CAAC,CAAC,EAAE,IAAI,EAAE,KAAc,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE;YACzC,CAAC,CAAC,SAAS,CAAA;IAEf,MAAM,aAAa,CACjB,UAAU,EACV,IAAI,EACJ,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,EAC3B,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE;QACjB,MAAM,CAAC,GAAG,CAAC,eAAe,MAAM,CAAC,YAAY,OAAO,MAAM,CAAC,WAAW,EAAE,CAAC,CAAA;QACzE,MAAM,CAAC,GAAG,CAAC,oCAAoC,MAAM,CAAC,aAAa,EAAE,CAAC,CAAA;QACtE,MAAM,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAA;IAC9C,CAAC,CACF,CAAA;AACH,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,OAAgB;IAC3C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AC,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,EAC3B,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE;QACjB,MAAM,CAAC,GAAG,CAAC,eAAe,MAAM,CAAC,YAAY,OAAO,MAAM,CAAC,WAAW,EAAE,CAAC,CAAA;QACzE,MAAM,CAAC,GAAG,CAAC,oCAAoC,MAAM,CAAC,aAAa,EAAE,CAAC,CAAA;QACtE,MAAM,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAA;IAC9C,CAAC,CACF,CAAA;AACH,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,OAAgB;IAC3C,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,KAAK,CAAC,QAAQ,CAAC;SACf,WAAW,CAAC,6EAA6E,CAAC;SAC1F,MAAM,CAAC,gBAAgB,EAAE,2BAA2B,CAAC;SACrD,MAAM,CAAC,aAAa,EAAE,+BAA+B,CAAC;SACtD,MAAM,CAAC,KAAK,EAAE,IAAwB,EAAE,OAAgB,EAAE,EAAE;QAC3D,MAAM,UAAU,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAA;QAC5C,MAAM,UAAU,CACd,IAAI,EACJ,UAAU,CAAC,IAAI,KAAK,IAAI,EACxB;YACE,IAAI,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,GAAG,QAAQ,EAAE,WAAW,EAAE,UAAU,CAAC,OAAO,EAAE,CAAC;YAC7E,OAAO;SACR,CACF,CAAA;IACH,CAAC,CAAC,CAAA;AACN,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { Command } from 'commander';
2
+ import type { LogsQuery, LogsResult, LogsSeverity } from '@unibridge/sdk';
3
+ interface LogsCommandOptions {
4
+ severity?: LogsSeverity;
5
+ limit?: string;
6
+ offset?: string;
7
+ }
8
+ interface LogsDeps {
9
+ logs: (query?: LogsQuery) => Promise<LogsResult>;
10
+ console: Pick<Console, 'log' | 'error'>;
11
+ exit?: (code: number) => void;
12
+ }
13
+ export declare function handleLogs(opts: LogsCommandOptions, jsonOutput: boolean, deps: LogsDeps): Promise<void>;
14
+ export declare function registerLogs(program: Command): void;
15
+ export {};
16
+ //# sourceMappingURL=logs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logs.d.ts","sourceRoot":"","sources":["../../src/commands/logs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAIzE,UAAU,kBAAkB;IAC1B,QAAQ,CAAC,EAAE,YAAY,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,UAAU,QAAQ;IAChB,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,SAAS,KAAK,OAAO,CAAC,UAAU,CAAC,CAAA;IAChD,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,GAAG,OAAO,CAAC,CAAA;IACvC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAC9B;AAiCD,wBAAsB,UAAU,CAC9B,IAAI,EAAE,kBAAkB,EACxB,UAAU,EAAE,OAAO,EACnB,IAAI,EAAE,QAAQ,GACb,OAAO,CAAC,IAAI,CAAC,CAuBf;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAsBnD"}
@@ -0,0 +1,62 @@
1
+ import { runWithOutput } from "./output.js";
2
+ import { withUnityClient } from "./with-unity-client.js";
3
+ function parseIntWithMinimum(value, label, defaultValue, minimum) {
4
+ if (value == null) {
5
+ return defaultValue;
6
+ }
7
+ const parsed = Number.parseInt(value, 10);
8
+ if (!Number.isFinite(parsed) || parsed < minimum) {
9
+ if (minimum <= 0) {
10
+ throw new Error(`${label} must be a non-negative integer.`);
11
+ }
12
+ throw new Error(`${label} must be an integer >= ${minimum}.`);
13
+ }
14
+ return parsed;
15
+ }
16
+ function parseSeverity(value) {
17
+ if (value == null) {
18
+ return undefined;
19
+ }
20
+ if (value === 'info' || value === 'warn' || value === 'error') {
21
+ return value;
22
+ }
23
+ throw new Error('--severity must be one of: info, warn, error.');
24
+ }
25
+ export async function handleLogs(opts, jsonOutput, deps) {
26
+ const limit = parseIntWithMinimum(opts.limit, '--limit', 50, 1);
27
+ const offset = parseIntWithMinimum(opts.offset, '--offset', 0, 0);
28
+ const query = {
29
+ severity: parseSeverity(opts.severity),
30
+ limit,
31
+ offset,
32
+ };
33
+ await runWithOutput(jsonOutput, deps, () => deps.logs(query), (result, output) => {
34
+ output.log(`Logs: ${result.logs.length} of ${result.total} (limit ${result.limit}, offset ${result.offset})`);
35
+ for (const entry of result.logs) {
36
+ output.log(`[${entry.timestamp}] ${entry.severity.toUpperCase()} ${entry.message}`);
37
+ if (entry.stackTrace && entry.stackTrace.trim().length > 0) {
38
+ output.log(entry.stackTrace);
39
+ }
40
+ }
41
+ });
42
+ }
43
+ export function registerLogs(program) {
44
+ program
45
+ .command('logs')
46
+ .description('List Unity Editor logs with optional severity filter and pagination')
47
+ .option('--severity <severity>', 'Filter by severity (info|warn|error)')
48
+ .option('--limit <number>', 'Number of log entries to return (default: 50)')
49
+ .option('--offset <number>', 'Offset into the filtered log entries (default: 0)')
50
+ .action(async (opts, command) => {
51
+ await withUnityClient(command, { requirePlugin: true }, async (client, ctx) => {
52
+ await handleLogs(opts, ctx.jsonOutput, {
53
+ logs: (query) => client.logs(query),
54
+ console,
55
+ exit: (exitCode) => {
56
+ process.exitCode = exitCode;
57
+ },
58
+ });
59
+ });
60
+ });
61
+ }
62
+ //# sourceMappingURL=logs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logs.js","sourceRoot":"","sources":["../../src/commands/logs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3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AAM,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,UAAU,EAAE;gBACrC,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;gBACnC,OAAO;gBACP,IAAI,EAAE,CAAC,QAAQ,EAAE,EAAE;oBACjB,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAA;gBAC7B,CAAC;aACF,CAAC,CAAA;QACJ,CAAC,CACF,CAAA;IACH,CAAC,CAAC,CAAA;AACN,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { Command } from 'commander';
2
- import type { SceneActiveResult, SceneCreateResult, SceneOpenResult } from '@unibridge/sdk';
2
+ import type { SceneActiveResult, SceneCreateResult, SceneHierarchyQuery, SceneHierarchyResult, SceneListQuery, SceneListResult, SceneOpenResult } from '@unibridge/sdk';
3
3
  interface SceneActiveDeps {
4
4
  active: () => Promise<SceneActiveResult>;
5
5
  console: Pick<Console, 'log' | 'error'>;
@@ -12,6 +12,27 @@ interface SceneOpenDeps {
12
12
  exit?: (code: number) => void;
13
13
  }
14
14
  export declare function handleSceneOpen(path: string, jsonOutput: boolean, deps: SceneOpenDeps): Promise<void>;
15
+ interface SceneListCommandOptions {
16
+ filter?: string;
17
+ limit?: string;
18
+ offset?: string;
19
+ }
20
+ interface SceneListDeps {
21
+ list: (query?: SceneListQuery) => Promise<SceneListResult>;
22
+ console: Pick<Console, 'log' | 'error'>;
23
+ exit?: (code: number) => void;
24
+ }
25
+ interface SceneHierarchyCommandOptions {
26
+ limit?: string;
27
+ offset?: string;
28
+ }
29
+ interface SceneHierarchyDeps {
30
+ hierarchy: (query?: SceneHierarchyQuery) => Promise<SceneHierarchyResult>;
31
+ console: Pick<Console, 'log' | 'error'>;
32
+ exit?: (code: number) => void;
33
+ }
34
+ export declare function handleSceneList(opts: SceneListCommandOptions, jsonOutput: boolean, deps: SceneListDeps): Promise<void>;
35
+ export declare function handleSceneHierarchy(opts: SceneHierarchyCommandOptions, jsonOutput: boolean, deps: SceneHierarchyDeps): Promise<void>;
15
36
  interface SceneCreateDeps {
16
37
  create: (path: string) => Promise<SceneCreateResult>;
17
38
  console: Pick<Console, 'log' | 'error'>;
@@ -1 +1 @@
1
- {"version":3,"file":"scene.d.ts","sourceRoot":"","sources":["../../src/commands/scene.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAI3F,UAAU,eAAe;IACvB,MAAM,EAAE,MAAM,OAAO,CAAC,iBAAiB,CAAC,CAAA;IACxC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,GAAG,OAAO,CAAC,CAAA;IACvC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAC9B;AAED,wBAAsB,iBAAiB,CACrC,UAAU,EAAE,OAAO,EACnB,IAAI,EAAE,eAAe,GACpB,OAAO,CAAC,IAAI,CAAC,CAWf;AAED,UAAU,aAAa;IACrB,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,eAAe,CAAC,CAAA;IAChD,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,GAAG,OAAO,CAAC,CAAA;IACvC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAC9B;AAED,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,OAAO,EACnB,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC,IAAI,CAAC,CAWf;AAED,UAAU,eAAe;IACvB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAA;IACpD,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,GAAG,OAAO,CAAC,CAAA;IACvC,IAAI,C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BAAsB,iBAAiB,CACrC,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,OAAO,EACnB,IAAI,EAAE,eAAe,GACpB,OAAO,CAAC,IAAI,CAAC,CAWf;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAwGpD"}
@@ -14,6 +14,45 @@ export async function handleSceneOpen(path, jsonOutput, deps) {
14
14
  output.log(`Dirty: ${result.scene.isDirty ? 'yes' : 'no'}`);
15
15
  });
16
16
  }
17
+ function parseIntWithMinimum(value, label, defaultValue, minimum) {
18
+ if (value == null) {
19
+ return defaultValue;
20
+ }
21
+ const parsed = Number.parseInt(value, 10);
22
+ if (!Number.isFinite(parsed) || parsed < minimum) {
23
+ if (minimum <= 0) {
24
+ throw new Error(`${label} must be a non-negative integer.`);
25
+ }
26
+ throw new Error(`${label} must be an integer >= ${minimum}.`);
27
+ }
28
+ return parsed;
29
+ }
30
+ export async function handleSceneList(opts, jsonOutput, deps) {
31
+ const query = {
32
+ filter: opts.filter,
33
+ limit: parseIntWithMinimum(opts.limit, '--limit', 50, 1),
34
+ offset: parseIntWithMinimum(opts.offset, '--offset', 0, 0),
35
+ };
36
+ await runWithOutput(jsonOutput, deps, () => deps.list(query), (result, output) => {
37
+ output.log(`Scenes: ${result.scenes.length} of ${result.total} (limit ${result.limit}, offset ${result.offset})`);
38
+ for (const scene of result.scenes) {
39
+ output.log(`${scene.path}`);
40
+ }
41
+ });
42
+ }
43
+ export async function handleSceneHierarchy(opts, jsonOutput, deps) {
44
+ const query = {
45
+ limit: parseIntWithMinimum(opts.limit, '--limit', 200, 1),
46
+ offset: parseIntWithMinimum(opts.offset, '--offset', 0, 0),
47
+ };
48
+ await runWithOutput(jsonOutput, deps, () => deps.hierarchy(query), (result, output) => {
49
+ output.log(`Hierarchy: ${result.nodes.length} of ${result.total} (limit ${result.limit}, offset ${result.offset})`);
50
+ for (const node of result.nodes) {
51
+ const indent = ' '.repeat(node.depth);
52
+ output.log(`${indent}${node.path} (${node.isActive ? 'active' : 'inactive'}) [id=${node.instanceId}, sibling=${node.siblingIndex}]`);
53
+ }
54
+ });
55
+ }
17
56
  export async function handleSceneCreate(path, jsonOutput, deps) {
18
57
  await runWithOutput(jsonOutput, deps, () => deps.create(path), (result, output) => {
19
58
  output.log(`Name: ${result.scene.name}`);
@@ -39,6 +78,39 @@ export function registerScene(program) {
39
78
  });
40
79
  });
41
80
  });
81
+ scene
82
+ .command('list')
83
+ .description('List scenes in the project with pagination')
84
+ .option('--filter <text>', 'Filter by scene path substring')
85
+ .option('--limit <number>', 'Number of scenes to return (default: 50)')
86
+ .option('--offset <number>', 'Offset into filtered scenes (default: 0)')
87
+ .action(async (opts, command) => {
88
+ await withUnityClient(command, { requirePlugin: true }, async (client, ctx) => {
89
+ await handleSceneList(opts, ctx.jsonOutput, {
90
+ list: (query) => client.sceneList(query),
91
+ console,
92
+ exit: (exitCode) => {
93
+ process.exitCode = exitCode;
94
+ },
95
+ });
96
+ });
97
+ });
98
+ scene
99
+ .command('hierarchy')
100
+ .description('List the active scene hierarchy as a paginated flattened tree')
101
+ .option('--limit <number>', 'Number of hierarchy nodes to return (default: 200)')
102
+ .option('--offset <number>', 'Offset into hierarchy nodes (default: 0)')
103
+ .action(async (opts, command) => {
104
+ await withUnityClient(command, { requirePlugin: true }, async (client, ctx) => {
105
+ await handleSceneHierarchy(opts, ctx.jsonOutput, {
106
+ hierarchy: (query) => client.sceneHierarchy(query),
107
+ console,
108
+ exit: (exitCode) => {
109
+ process.exitCode = exitCode;
110
+ },
111
+ });
112
+ });
113
+ });
42
114
  scene
43
115
  .command('create <path>')
44
116
  .description('Create a new scene at a project-relative path')