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

Function editor_install

unity_cli/cli/commands/editor_hub.py:63–95  ·  view source on GitHub ↗

Install a Unity Editor version through Unity Hub's CLI. VERSION accepts release tags like '2022.3.10f1', '6000.0.23f1', or beta/alpha tags paired with --changeset. --modules takes Unity platform/module IDs (android, ios, webgl, mac-il2cpp, linux-il2cpp, windows-il2cpp, ...). Exampl

(
    version: Annotated[str, typer.Argument(help="Unity version to install")],
    modules: Annotated[
        list[str] | None,
        typer.Option("--modules", "-m", help="Modules to install"),
    ] = None,
    changeset: Annotated[
        str | None,
        typer.Option("--changeset", "-c", help="Changeset for non-release versions"),
    ] = None,
)

Source from the content-addressed store, hash-verified

61
62@editor_app.command("install")
63def editor_install(
64 version: Annotated[str, typer.Argument(help="Unity version to install")],
65 modules: Annotated[
66 list[str] | None,
67 typer.Option("--modules", "-m", help="Modules to install"),
68 ] = None,
69 changeset: Annotated[
70 str | None,
71 typer.Option("--changeset", "-c", help="Changeset for non-release versions"),
72 ] = None,
73) -> None:
74 """Install a Unity Editor version through Unity Hub's CLI.
75
76 VERSION accepts release tags like '2022.3.10f1', '6000.0.23f1', or beta/alpha
77 tags paired with --changeset. --modules takes Unity platform/module IDs
78 (android, ios, webgl, mac-il2cpp, linux-il2cpp, windows-il2cpp, ...).
79
80 Examples:
81 u editor install 2022.3.10f1
82 u editor install 2022.3.10f1 -m android -m ios
83 u editor install 6000.0.1a14 --changeset abcdef123456
84 """
85 from unity_cli.exceptions import HubError
86 from unity_cli.hub.hub_cli import HubCLI
87
88 try:
89 hub = HubCLI()
90 hub.install_editor(version=version, modules=modules, changeset=changeset)
91 print_success(f"Installed Unity {version}")
92 if modules:
93 print_success(f"With modules: {', '.join(modules)}")
94 except HubError as e:
95 _handle_error(e)

Callers

nothing calls this directly

Calls 4

install_editorMethod · 0.95
HubCLIClass · 0.90
print_successFunction · 0.90
_handle_errorFunction · 0.90

Tested by

no test coverage detected