Documentation

Unity Hub

Use the Unity CLI

Install the Unity CLI standalone binary and use it to install Editors, add modules, and open projects from a terminal.
Read time 3 minutesLast updated 3 days ago

Note
The Unity CLI is experimental. Full feature parity with the Unity Hub UI isn't guaranteed.
Use the Unity CLI to install Unity Editors, add modules, and manage projects from a terminal without the Unity Hub desktop application. The CLI is a standalone binary that works in CI pipelines, automation scripts, and terminal-first workflows. The Unity CLI works well for:
  • Continuous integration (CI) and build agents where installing the full Hub is undesirable.
  • Scripting and automation that needs structured output (JSON or TSV) and predictable exit codes.
  • Users who prefer a terminal-first workflow for everyday Hub tasks.
For command syntax, options, and flags, refer to Unity CLI reference. If you have existing scripts that use the Hub CLI's
-- --headless
syntax, refer to Migrate from the Hub CLI for a comparison of syntax and behavior changes.

Common Unity CLI tasks

The following commands cover the most common CLI tasks:
unity --help # Top-level helpunity install lts # Install the latest LTS Editorunity install-modules -e 6000.3.7f1 -m ios # Add the iOS moduleunity editors -i # List installed Editorsunity open ./MyProject # Open a project

Install the Unity CLI

To install the Unity CLI:
  1. Open a terminal.
  2. Run the install script for your operating system.
curl -fsSL https://public-cdn.cloud.unity3d.com/hub/prod/cli/install.sh | UNITY_CLI_CHANNEL=beta bash
After the script completes, verify the CLI is available by running
unity --version
. If the command is not found, add the install directory to your shell's
PATH
or reopen your terminal.
Note
The CLI is self-contained, so you can install it on machines that don't run the Unity Hub desktop application, such as headless CI workers.

Update the Unity CLI

To update the CLI to the latest release:
  1. Open a terminal.
  2. Run the self-update command:
unity upgrade
The CLI replaces the current binary with the latest available release.

Install a Unity Editor

To install a Unity Editor:
  1. Open a terminal.
  2. Run
    unity install
    with the version you want. Use a version alias such as
    lts
    or a specific version string such as
    6000.3.7f1
    :
unity install ltsunity install 6000.3.7f1
The Editor downloads and installs to the configured install path. To add modules at install time, use
-m
followed by one or more module IDs:
unity install lts -m ios android webgl
For all options, version aliases, and module IDs, refer to Unity CLI reference.

Add modules to an installed Editor

To add modules to an Editor you already installed:
  1. Open a terminal.
  2. Run
    unity install-modules
    with
    -e
    for the Editor version and
    -m
    for the module IDs:
unity install-modules -e 6000.3.7f1 -m android ios
The modules download and install for the specified Editor version.
Important
You can only add modules to Editors installed through the Hub or the CLI. Reinstall manually installed Editors through the Hub or CLI before adding modules.
For all options and module IDs, refer to Unity CLI reference.

Open a project

To open a Unity project:
  1. Open a terminal.
  2. Run
    unity open
    with the path to the project:
unity open ./MyProject
Unity opens the project in the Editor version specified in the project's settings. You can omit the
open
keyword when the first argument is a path:
unity ./MyProject

Sign in

To sign in to your Unity account:
  1. Open a terminal.
  2. Run the login command, which opens a browser-based sign-in flow:
unity auth login
The CLI stores your session so you can use other commands without signing in again. To check whether you're signed in, run
unity auth status
. For all auth commands, refer to Unity CLI reference.