Use the Hub CLI
Install and manage Unity Editors and modules from the terminal with the Hub Command line interface (CLI) in headless mode.
Read time 3 minutesLast updated a day ago
Use the Hub command line interface (CLI) to install Unity Editors, add modules, and manage Editor installations from a terminal. The Hub CLI is part of the Unity Hub desktop application and runs in headless mode.
For command options, flags, and module IDs, refer to Hub CLI reference.
Prerequisites
Before you use the Hub CLI perform the following steps:- Download and install the Hub.
- Locate the Hub executable on your machine:
- macOS:
/Applications/Unity Hub.app/Contents/MacOS/Unity Hub - Windows: (or your install location)
C:\Program Files\Unity Hub\Unity Hub.exe - Linux: path to your or installed binary
Unity Hub.AppImage
- macOS:
Run the Hub CLI
Send headless commands to the Hub executable from your terminal.- On Windows and macOS, place before the command.
-- --headless - On Linux, place before the command.
--headless
Display help
To list available CLI commands and flags:- Open a terminal.
- Run the help command for your operating system.
/Applications/Unity\ Hub.app/Contents/MacOS/Unity\ Hub -- --headless help
List available and installed Editors
To list available releases or installed Editors:- Open a terminal.
- Run the command with the scope you need (
editorsfor releases,-rfor installed, or-ifor both). For all options, refer to Manage Editors.-a
/Applications/Unity\ Hub.app/Contents/MacOS/Unity\ Hub -- --headless editors -r
Set or get the Editor install path
To set or get the path where Unity Editors are installed:- Open a terminal.
- Run with
install-pathand a path to set the install location, or-sto show the current path. If you omit options, the command uses-g. For all options, refer to Set/Get install path.get
/Applications/Unity\ Hub.app/Contents/MacOS/Unity\ Hub -- --headless install-path -s /Applications/Unity/Hub/Editor/
Install a Unity Editor
To install a new Editor from the releases list or archive:- Open a terminal.
- Run the command with
installand the Editor version. Add--versionif the version is not in the release list (check with--changeset). For all options, refer to Install Unity Editors.editors -r
/Applications/Unity\ Hub.app/Contents/MacOS/Unity\ Hub -- --headless install --version 6000.3.7f1 --changeset 9b001d489a54
Install modules on an installed Editor
To add modules to an Editor you installed through the Hub:- Open a terminal.
- Run with
install-modulesfor the installed Editor and--versionwith one or more module IDs.-m
/Applications/Unity\ Hub.app/Contents/MacOS/Unity\ Hub -- --headless install-modules --version 6000.3.7f1 -m ios android
Install an Editor with modules
To install a new Editor and modules in one command:- Open a terminal.
- Run the command with
installand--version(or--module) followed by one or more module IDs from Hub CLI reference.-m
/Applications/Unity\ Hub.app/Contents/MacOS/Unity\ Hub -- --headless install --version 6000.3.7f1 --module android android-sdk-ndk-tools android-open-jdk