Enumerate every Component attached to a GameObject. Example: u component list -t Player
(
ctx: typer.Context,
target: Annotated[str | None, typer.Option("--target", "-t", help="Target GameObject name")] = None,
target_id: Annotated[int | None, typer.Option("--target-id", help="Target GameObject ID")] = None,
json_flag: Annotated[
bool,
typer.Option("--json", help="Output as JSON"),
] = False,
)
| 24 | @component_app.command("list") |
| 25 | @handle_cli_errors |
| 26 | def component_list( |
| 27 | ctx: typer.Context, |
| 28 | target: Annotated[str | None, typer.Option("--target", "-t", help="Target GameObject name")] = None, |
| 29 | target_id: Annotated[int | None, typer.Option("--target-id", help="Target GameObject ID")] = None, |
| 30 | json_flag: Annotated[ |
| 31 | bool, |
| 32 | typer.Option("--json", help="Output as JSON"), |
| 33 | ] = False, |
| 34 | ) -> None: |
| 35 | """Enumerate every Component attached to a GameObject. |
| 36 | |
| 37 | Example: |
| 38 | u component list -t Player |
| 39 | """ |
| 40 | context: CLIContext = ctx.obj |
| 41 | |
| 42 | if not target and target_id is None: |
| 43 | _exit_usage("--target or --target-id required", "u component list") |
| 44 | |
| 45 | result = context.client.component.list(target=target, target_id=target_id) |
| 46 | if _should_json(context, json_flag): |
| 47 | print_json(result) |
| 48 | else: |
| 49 | print_components_table(result.get("components", [])) |
| 50 | |
| 51 | |
| 52 | @component_app.command("inspect") |
nothing calls this directly
no test coverage detected