---
title: Use the Unity command-line interface (CLI)
product: Unity command-line interface (CLI)
canonical: https://docs.unity.com/en-us/unity-cli/use-unity-cli
last_updated: 2026-11-12
generated_at: 2026-11-25T01:24:39.568Z
locale: en-us
---

# Use the Unity command-line interface (CLI)

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

> **Note:**
>
> If you use Claude Code, Codex, Grok Build, or Google Antigravity, install the [Unity plugin](/ai/unity-plugin/about-unity-plugin.md) for your agent. The plugin includes the `unity-cli` skill and other Unity skills. Otherwise, install the skills directly from the [Unity Skills repository](https://github.com/Unity-Technologies/skills/blob/main/README.md).

Use the Unity CLI to install Unity Editors, add modules, and manage projects from a terminal. 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) pipelines and build agents.
* Scripting and automation that needs structured output (JSON or TSV) and predictable exit codes.
* Users who prefer a terminal-first workflow for installing Editors, managing modules, and opening projects.

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/migrate-hub-cli.md) for a comparison of syntax and behavior changes.

> **Note:**
>
> To use the Unity CLI to control the Unity Editor, install and set up the [Unity Pipeline package](/unity-cli/unity-pipeline/unity-pipeline-package.md). For an example of how you can use the Unity CLI with Unity Pipeline, refer to the [Unity CLI introduction video](https://www.youtube.com/watch?v=DgNrgZeJOxQ).

## Compatibility

The Unity CLI is compatible with the following operating systems:

* Windows 10 21H1 or newer.
* Linux RHEL 9 and Ubuntu 22.04 and later. Requires glibc 2.34 or newer. Debian 11, CentOS 8, Amazon Linux 2 aren't supported.
* macOS 14 and newer.

> **Note:**
>
> You can install the Unity CLI on headless machines, such as CI workers and build agents. The CLI is also distributed as a Homebrew cask, `.deb` and `.rpm` packages, an AppImage, and an MSIX package on Windows. To learn more, refer to [install with a package manager](#install-with-a-package-manager).

## 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
unity shell                                 # Run many commands in one interactive session
unity doctor                                # Print a diagnostic snapshot
```

## Install the Unity CLI

To install the Unity CLI:

1. Open a terminal. On Windows, use PowerShell.
2. Run the install script for your operating system.

```bash title="macOS or Linux"
curl -fsSL https://unity.com/install.sh | bash
```

```powershell title="Windows (PowerShell)"
irm https://unity.com/install.ps1 | iex
```

After the script completes, verify the CLI is available by running `unity --version`. If the command isn't found, add the install directory to your shell's `PATH` or reopen your terminal.

On Linux, the script installs the binary to `~/.local/bin/unity`, which is on `PATH` by default on most distributions. Re-running the installer migrates an install from the previous `~/.unity` location.

> **Note:**
>
> On Linux, the install script and the `.deb` and `.rpm` packages check for glibc 2.34 or newer before installation. This means that an unsupported system uses the CLI it already has and doesn't replace it with one that can't start.

The install script above is the recommended way to install the Unity CLI. It always installs the latest release, and `unity self-update` keeps the CLI current after installation (refer to [Update the Unity CLI](/unity-cli/reference/cli-config-diagnostics-commands.md#update-the-unity-cli)). If you already manage command-line tools with a package manager, you can use one of the alternatives below:

To install to a different directory, set `UNITY_CLI_HOME` before you run the script. The script then installs the CLI to `<UNITY_CLI_HOME>/bin` (`<UNITY_CLI_HOME>\bin` on Windows) instead of the default location.

* Homebrew: update through that package manager instead of `unity self-update`
* Linux package repositories: update through that package manager instead of `unity self-update`
* winget: winget is the exception, it installs an MSIX package, so `unity self-update` keeps working

### Install with a package manager

1. **Homebrew (macOS, Linux)**

   On macOS and Linux, you can install the CLI with [Homebrew](https://brew.sh) instead of the install script, so Homebrew keeps it current:

   > **Important:**
   >
   > If you installed the Unity CLI from the install script and then install the Homebrew cask, the CLI warns you. `which unity` continues to resolves to the self-installed copy, and `brew upgrade` updates the other. The two installations can then drift apart. Run `unity self-uninstall -y` to remove the self-installed copy and let Homebrew manage updates.

   ```bash
   brew install --cask unity-cli
   ```

   The cask supports Apple silicon and Intel on macOS, and x64 and arm64 on Linux. On Linux, installing casks requires Homebrew 6.0 or later.

   To update the CLI, run `brew upgrade unity-cli`.

   > **Note:**
   >
   > The cask installs the command as `unity`. The cask name is `unity-cli` because `unity` refers to a different package in some package managers.

2. **winget (Windows)**

   On Windows, you can install the CLI with [winget](https://learn.microsoft.com/windows/package-manager/) instead of the install script:

   ```powershell
   winget install Unity.CLI
   ```

   To update the CLI, run `winget upgrade Unity.CLI`.

   > **Note:**
   >
   > winget shows the four-part package version, such as `1.0.0.20005`, because package versions can't include a prerelease tag. `unity --version` reports the full version, such as `1.0.0-beta.5`.

3. **Linux package repositories (apt, dnf)**

   On Linux, you can install the CLI from Unity's apt and rpm repositories instead of using the install script. Your system package manager then keeps the CLI current. Beta releases are published to the `unstable` suite; general availability (GA) releases publish to `stable`.

   To register the repository and install the CLI on Debian or Ubuntu:

   ```bash
   curl -sL https://hub.unity3d.com/linux/keys/public | sudo gpg --dearmor -o /usr/share/keyrings/Unity_Technologies_ApS.gpg
   sudo tee /etc/apt/sources.list.d/unity-cli.sources <<'EOF'
   Types: deb
   URIs: https://hub.unity3d.com/linux/repos/deb
   Suites: unstable
   Components: main
   Signed-By: /usr/share/keyrings/Unity_Technologies_ApS.gpg
   EOF
   sudo apt update && sudo apt install unity-cli
   ```

   To register the repository and install the CLI on Fedora or RHEL:

   ```bash
   sudo tee /etc/yum.repos.d/unity-cli.repo <<'EOF'
   [unity-cli]
   name=Unity CLI
   baseurl=https://hub.unity3d.com/linux/repos/rpm/unstable
   enabled=1
   gpgcheck=1
   gpgkey=https://hub.unity3d.com/linux/repos/rpm/unstable/repodata/repomd.xml.key
   repo_gpgcheck=1
   EOF
   sudo dnf install unity-cli
   ```

   If you install a release's `.deb` or `.rpm` package file directly, the package registers the matching repository during installation, so `apt upgrade` or `dnf upgrade` keeps the CLI current from then on.

   > **Note:**
   >
   > The package installs the command as `unity`. The package name is `unity-cli` because `unity` refers to a different package on some distributions.

## Update the Unity CLI

To update the CLI to the latest release:

1. Open a terminal.
2. Run the self-update command:

```shell
unity self-update
```

The CLI replaces the current binary with the latest available release. If a download is interrupted, the next `unity self-update` resumes the download instead of starting over. The CLI also checks for updates in the background and prints a notice when a new release is available. To turn the check off, run `unity config update-check off`.

`unity upgrade` still works as an alias for `unity self-update`.

If you installed the CLI with Homebrew or from the Linux package repositories, update it through that package manager instead. `unity self-update` detects the package-managed install and shows the matching command. A winget install is the exception, since it's an MSIX package, `unity self-update` continues to update it directly.

### Install a specific Unity CLI version

To install a specific version of the Unity CLI instead of the latest release, run the following self-update command in a terminal with the `--target` option and the version to install:

```shell
unity self-update --target <version>
```

`unity upgrade` is an alias for `unity self-update`, so the following command has the same result:

```shell
unity upgrade --target <version>
```

Replace `<version>` with a release version such as `1.0.0`. The `--target` option also accepts a leading `v`, such as `v1.0.0`, and `latest` for the latest release.

> **Tip:**
>
> To review the release notes for the version before you install it, run `unity changelog --target <version>`.

If you installed the CLI with Homebrew or from the Linux package repositories, use that package manager to install a specific version.

### Limits on automatic updates

The following limits apply to automatic updates of the Unity CLI:

* The Unity Hub updates the Unity CLI automatically. You can't disable these updates in the Hub.
* `unity config update-check off` disables only the CLI's notice that a new release is available. It doesn't stop the Hub from updating the CLI.
* If you installed the CLI as an MSIX package, including through winget, Windows keeps the CLI current in the background. Rollback isn't available for MSIX installs.
* If you installed the CLI with Homebrew or from the Linux package repositories, the package manager controls updates. `unity self-update` doesn't update these installs.

### Update with a package manager

1. **Homebrew (macOS, Linux)**

   ```shell
   brew upgrade unity-cli
   ```

2. **winget (Windows)**

   ```shell
   winget upgrade Unity.CLI
   ```

   > **Note:**
   >
   > If you installed the CLI as an MSIX package, including through winget, `unity self-update` also updates it directly. It downloads only the parts of the package that changed and registers the install with Windows, so it stays current in the background. Rollback isn't available for MSIX installs.

3. **Linux package repositories (apt, dnf)**

   ```shell
   sudo apt update && sudo apt upgrade unity-cli   # Debian and Ubuntu
   ```

   ```shell
   sudo dnf upgrade unity-cli                      # Fedora and RHEL
   ```

To see what the CLI resolved and which command updates your install, run:

```shell
unity diagnose update
```

## 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/editor-project-commands.md#install-an-editor).

## Add modules to an installed Editor

> **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.

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.

For all options and module IDs, refer to [Unity CLI reference](/unity-cli/reference/editor-project-commands.md#install-modules-for-an-existing-editor).

## Create a project

To create a new Unity project:

1. Open a terminal.
2. Run `unity projects create` with a project name:

```shell
unity projects create MyGame
```

By default, `unity projects create` enables Unity Cloud for the new project and creates a Unity Cloud project entry in your organization. The command doesn't upload files, assets, or settings, and it doesn't store or host the local project anywhere. Because the default creates a cloud project, the command needs a signed-in user account. If you aren't signed in, the command stops with exit code 3 before creating anything and names both `unity auth login` and `--no-cloud`. The same applies when you authenticate as a service account because service accounts can't create projects in an organization.

To create a local-only project, pass `--no-cloud`

```shell
unity projects create MyGame --no-cloud
```

To keep an entire pipeline local, set `UNITY_NO_CLOUD` for the job.

To use an existing Unity Cloud project instead of creating one, pass `--cloud-project <id-or-name>`. You can't combine `--no-cloud` with `--cloud`, `--cloud-org`, or `--cloud-project`. If the cloud setup doesn't complete, you keep the local project and the command reports a warning.

For all options, run `unity projects create --help`. For the other `projects` subcommands, refer to [Unity CLI reference](/unity-cli/reference/editor-project-commands.md#manage-projects-in-the-hub-registry).

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

## Set up version control

To add a Unity project to version control:

1. Open a terminal in the project's directory.
2. Run:

```shell
unity vcs setup
```

`unity vcs setup` guides you through creating a repository and pushing the first commit. It detects available information, such as whether the project is already in a repository and which Git providers you have signed in to on the machine. It asks only for information it can't detect. Each guided run prints the flags that reproduce the selected configuration. Use `--save-preset <name>` to save those choices as the default for later runs. The command accepts the same `--git-*` flags as `unity projects link vcs`, so so you can skip the questions in scripted runs:

```shell
unity vcs setup --vcs github --git-namespace my-org --non-interactive
```

For the full command tree, including status and sync, repository audits, hooks, conflict resolution, and diffs, refer to [Unity CLI reference](/unity-cli/reference/uvcs-commands.md).

## 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/accounts-licenses-cloud-commands.md#sign-in-and-out).

### Sign in as a service account

For unattended workflows such as CI pipelines and build agents, you can authenticate with a service account. This is the same service account type used to sign into other Unity services, it isn't specific to the CLI. To learn how to create a service account, refer to [Service accounts](/cloud/accounts/create-service-account.md).

To sign in automatically through the Unity CLI, set the `UNITY_SERVICE_ACCOUNT_ID` and `UNITY_SERVICE_ACCOUNT_SECRET` environment variables to the account's key ID and secret key. For the full list of environment variables, refer to [Unity CLI reference](/unity-cli/reference/output-formats.md#environment-variables).

## View long command output

Commands with long listings, such as `unity releases`, `unity editors`, `unity changelog`, `unity logs`, and the bare `unity command` listing, page human-readable output through a terminal pager when you run them in an interactive terminal. This prevents long lists from flooding your scrollback, similar to `git log`. Only human-readable output uses the pager: machine formats such as, `--format json`, piped or redirected output, `--quiet`, and commands run inside `unity shell` print directly:

```shell
unity releases
```

Set `UNITY_PAGER` or `PAGER` to use a different pager. Pass `--no-pager` to turn off paging for a single run, or set `UNITY_NO_PAGER` to turn off paging for all runs. If no pager is available, output prints directly instead of failing. his is common on Windows, where less isn't installed by default.

## Additional resources

* [Introduction to the Unity CLI](/unity-cli/unity-cli.md)
* [Unity CLI reference](/unity-cli/reference.md)
* [Migrate from the Hub CLI](/unity-cli/reference/migrate-hub-cli.md)
* [Unity Pipeline package](/unity-cli/unity-pipeline/unity-pipeline-package.md)
* [Service accounts](/cloud/accounts/create-service-account.md)
