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,
)
| 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( |
nothing calls this directly
no test coverage detected