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.
읽는 시간 5분최근 업데이트: 하루 전
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 syntax, refer to Migrate from the Hub CLI for a comparison of syntax and behavior changes.
-- --headlessCompatibility
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.
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 projectunity shell # Run many commands in one interactive sessionunity doctor # Print a diagnostic snapshot
Install the Unity CLI
To install the Unity CLI:
- Open a terminal. On Windows, use PowerShell.
- 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 . If the command isn't found, add the install directory to your shell's or reopen your terminal.
unity --versionPATHOn Linux, the script installs the binary to , which is on by default on most distributions. Re-running the installer migrates an install from the previous location.
~/.local/bin/unityPATH~/.unityInstall with Homebrew
On macOS and Linux, you can install the CLI with Homebrew instead of the install script, so Homebrew keeps it current:
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-cliInstall with winget
On Windows, you can install the CLI with winget instead of the install script:
winget install Unity.CLI
To update the CLI, run .
winget upgrade Unity.CLIInstall from the Linux package repositories
On Linux, you can install the CLI from Unity's apt and rpm repositories instead of the install script, so your system package manager keeps it current. Beta releases publish to the suite; general availability (GA) releases publish to .
unstablestableTo register the repository and install the CLI on Debian or Ubuntu:
curl -sL https://hub.unity3d.com/linux/keys/public | sudo gpg --dearmor -o /usr/share/keyrings/Unity_Technologies_ApS.gpgsudo tee /etc/apt/sources.list.d/unity-cli.sources <<'EOF'Types: debURIs: https://hub.unity3d.com/linux/repos/debSuites: unstableComponents: mainSigned-By: /usr/share/keyrings/Unity_Technologies_ApS.gpgEOFsudo apt update && sudo apt install unity-cli
To register the repository and install the CLI on Fedora or RHEL:
sudo tee /etc/yum.repos.d/unity-cli.repo <<'EOF'[unity-cli]name=Unity CLIbaseurl=https://hub.unity3d.com/linux/repos/rpm/unstableenabled=1gpgcheck=1gpgkey=https://hub.unity3d.com/linux/repos/rpm/unstable/repodata/repomd.xml.keyrepo_gpgcheck=1EOFsudo dnf install unity-cli
If you install a release's or package file directly, the package registers the matching repository during installation, so or keeps the CLI current from then on.
.deb.rpmapt upgradednf upgradeUpdate the Unity CLI
To update the CLI to the latest release:
- Open a terminal.
- Run the self-update command:
unity upgrade
The CLI replaces the current binary with the latest available release. 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 offIf you installed the CLI through a package manager, update it there instead. detects a package-managed install and shows the matching command:
unity upgradesudo apt update && sudo apt upgrade unity-cli # Debian and Ubuntu
sudo dnf upgrade unity-cli # Fedora and RHEL
brew upgrade unity-cli # Homebrew on macOS and Linux
On Windows, an MSIX install updates itself: applies the update directly, downloading only the parts of the package that changed, and registers the install with Windows so it stays current in the background from then on. continues to work. Rollback isn't available on MSIX installs.
unity upgradewinget upgrade Unity.CLITo see what the CLI resolved and which command updates your install, run:
unity diagnose update
Install a Unity Editor
To install a Unity Editor:
- Open a terminal.
- Run with the version you want. Use a version alias such as
unity installor a specific version string such aslts: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 followed by one or more module IDs:
-munity 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:
- Open a terminal.
- Run with
unity install-modulesfor the Editor version and-efor the module IDs:-m
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.
Open a project
To open a Unity project:
- Open a terminal.
- Run with the path to the project:
unity open
unity open ./MyProject
Unity opens the project in the Editor version specified in the project's settings.
You can omit the keyword when the first argument is a path:
openunity ./MyProject
Sign in
To sign in to your Unity account:
- Open a terminal.
- 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 . For all auth commands, refer to Unity CLI reference.
unity auth statusSign 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.
To sign in automatically through the Unity CLI, set the and environment variables to the account's key ID and secret key. For the full list of environment variables, refer to Unity CLI reference.
UNITY_SERVICE_ACCOUNT_IDUNITY_SERVICE_ACCOUNT_SECRET