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

Function asset_info

unity_cli/cli/commands/asset.py:78–96  ·  view source on GitHub ↗

Show AssetDatabase metadata for a project asset (GUID, type, importer). Example: u asset info Assets/Prefabs/Player.prefab

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

Source from the content-addressed store, hash-verified

76@asset_app.command("info")
77@handle_cli_errors
78def asset_info(
79 ctx: typer.Context,
80 path: Annotated[str, typer.Argument(help="Asset path")],
81 json_flag: Annotated[
82 bool,
83 typer.Option("--json", help="Output as JSON"),
84 ] = False,
85) -> None:
86 """Show AssetDatabase metadata for a project asset (GUID, type, importer).
87
88 Example:
89 u asset info Assets/Prefabs/Player.prefab
90 """
91 context: CLIContext = ctx.obj
92 result = context.client.asset.info(path=path)
93 if _should_json(context, json_flag):
94 print_json(result, None)
95 else:
96 print_key_value(result, path)
97
98
99@asset_app.command("deps")

Callers

nothing calls this directly

Calls 4

_should_jsonFunction · 0.90
print_jsonFunction · 0.90
print_key_valueFunction · 0.90
infoMethod · 0.80

Tested by

no test coverage detected