MCPcopy Create free account
hub / github.com/bigdra50/unity-cli / instances

Function instances

unity_cli/cli/commands/editor_control.py:33–55  ·  view source on GitHub ↗

List Unity Editor instances currently registered with the Relay Server. Each row shows the project path/name and its instance ID. Use the name or path prefix with --instance/-i on any command to target a specific editor when more than one is open.

(
        ctx: typer.Context,
        json_flag: Annotated[
            bool,
            typer.Option("--json", help="Output as JSON"),
        ] = False,
    )

Source from the content-addressed store, hash-verified

31
32 @app.command()
33 def instances(
34 ctx: typer.Context,
35 json_flag: Annotated[
36 bool,
37 typer.Option("--json", help="Output as JSON"),
38 ] = False,
39 ) -> None:
40 """List Unity Editor instances currently registered with the Relay Server.
41
42 Each row shows the project path/name and its instance ID. Use the name
43 or path prefix with --instance/-i on any command to target a specific
44 editor when more than one is open.
45 """
46 context: CLIContext = ctx.obj
47 try:
48 result = context.client.list_instances()
49
50 if _should_json(context, json_flag):
51 print_json(result, None)
52 else:
53 print_instances_table(result)
54 except UnityCLIError as e:
55 _handle_error(e)
56
57 @app.command()
58 def state(

Callers

nothing calls this directly

Calls 5

_should_jsonFunction · 0.90
print_jsonFunction · 0.90
print_instances_tableFunction · 0.90
_handle_errorFunction · 0.90
list_instancesMethod · 0.45

Tested by

no test coverage detected