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

Function project_info

unity_cli/cli/commands/project.py:27–56  ·  view source on GitHub ↗

Show project information parsed from files. Displays: Unity version, product name, company, build scenes, packages. No Relay Server connection required.

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

Source from the content-addressed store, hash-verified

25
26@project_app.command("info")
27def project_info(
28 ctx: typer.Context,
29 path: Annotated[
30 Path,
31 typer.Argument(help="Unity project path"),
32 ] = Path("."),
33 json_flag: Annotated[
34 bool,
35 typer.Option("--json", help="Output as JSON"),
36 ] = False,
37) -> None:
38 """Show project information parsed from files.
39
40 Displays: Unity version, product name, company, build scenes, packages.
41 No Relay Server connection required.
42 """
43 from unity_cli.exceptions import ProjectError
44 from unity_cli.hub.project import ProjectInfo
45
46 context: CLIContext = ctx.obj
47 try:
48 info = ProjectInfo.from_path(path)
49
50 if _should_json(context, json_flag):
51 print_json(info.to_dict())
52 else:
53 _print_project_info(info)
54
55 except ProjectError as e:
56 _handle_error(e)
57
58
59def _print_project_info(info: Any) -> None:

Callers

nothing calls this directly

Calls 6

_should_jsonFunction · 0.90
print_jsonFunction · 0.90
_handle_errorFunction · 0.90
_print_project_infoFunction · 0.85
from_pathMethod · 0.80
to_dictMethod · 0.45

Tested by

no test coverage detected