# Use the Unity CLI

> Install the Unity CLI standalone binary and use it to install Editors, add modules, and open projects from a terminal.

> **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](./unity-cli-reference.md). If you have existing scripts that use the Hub CLI's `-- --headless` syntax, refer to [Migrate from the Hub CLI](./unity-cli-reference.md#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:

```shell
unity --help                                # Top-level help
unity install lts                           # Install the latest LTS Editor
unity install-modules -e 6000.3.7f1 -m ios  # Add the iOS module
unity editors -i                            # List installed Editors
unity 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.

```bash title="macOS or Linux"
curl -fsSL https://public-cdn.cloud.unity3d.com/hub/prod/cli/install.sh | UNITY_CLI_CHANNEL=beta bash
```

```powershell title="Windows"
$env:UNITY_CLI_CHANNEL='beta'; irm https://public-cdn.cloud.unity3d.com/hub/prod/cli/install.ps1 | iex
```

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:

```shell
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`:

```shell
unity install lts
unity 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:

```shell
unity install lts -m ios android webgl
```

For all options, version aliases, and module IDs, refer to [Unity CLI reference](./unity-cli-reference.md#install-an-editor).

## 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:

```shell
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](./unity-cli-reference.md#install-modules-for-an-existing-editor).

## Open a project

To open a Unity project:

1. Open a terminal.
2. Run `unity open` with the path to the project:

```shell
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:

```shell
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:

```shell
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](./unity-cli-reference.md#sign-in-and-out).
