Documentation

Unity Hub

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

Note
This feature is experimental. The CLI might not include every feature available in the Hub UI.
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:
  1. Download and install the Hub.
  2. Locate the Hub executable on your machine:
    • macOS:
      /Applications/Unity Hub.app/Contents/MacOS/Unity Hub
    • Windows:
      C:\Program Files\Unity Hub\Unity Hub.exe
      (or your install location)
    • Linux: path to your
      Unity Hub.AppImage
      or installed binary

Run the Hub CLI

Send headless commands to the Hub executable from your terminal.
  • On Windows and macOS, place
    -- --headless
    before the command.
  • On Linux, place
    --headless
    before the command.
The following examples replace the Hub executable path with the path on your machine.

Display help

To list available CLI commands and flags:
  1. Open a terminal.
  2. 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:
  1. Open a terminal.
  2. Run the
    editors
    command with the scope you need (
    -r
    for releases,
    -i
    for installed, or
    -a
    for both). For all options, refer to Manage Editors.
/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:
  1. Open a terminal.
  2. Run
    install-path
    with
    -s
    and a path to set the install location, or
    -g
    to show the current path. If you omit options, the command uses
    get
    . For all options, refer to Set/Get install path.
/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:
  1. Open a terminal.
  2. Run the
    install
    command with
    --version
    and the Editor version. Add
    --changeset
    if the version is not in the release list (check with
    editors -r
    ). For all options, refer to Install Unity Editors.
/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:
  1. Open a terminal.
  2. Run
    install-modules
    with
    --version
    for the installed Editor and
    -m
    with one or more module IDs.
Important
You can only add modules to Editors you installed through the Hub. If you installed an Editor manually, reinstall it through the Hub before you add modules.
/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:
  1. Open a terminal.
  2. Run the
    install
    command with
    --version
    and
    --module
    (or
    -m
    ) followed by one or more module IDs from Hub CLI reference.
/Applications/Unity\ Hub.app/Contents/MacOS/Unity\ Hub -- --headless install --version 6000.3.7f1 --module android android-sdk-ndk-tools android-open-jdk