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,
)
| 25 | |
| 26 | @project_app.command("info") |
| 27 | def 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 | |
| 59 | def _print_project_info(info: Any) -> None: |
nothing calls this directly
no test coverage detected