Unity command-line interface (CLI) reference
Explore the Unity CLI commands, options, output formats, and exit codes you can use to install and manage Unity Editors and modules from a terminal.
阅读时间18 分钟最后更新于 1 天前
Find the commands and options available in the Unity CLI. For installation and common task instructions, refer to Use the Unity CLI.
To use the Unity CLI to control the Unity Editor, install and set up the Unity Pipeline package. For an example of how you can use the Unity CLI with Unity Pipeline, refer to the Unity CLI introduction video.
Run to check the authoritative command list for your installed version, including any commands not yet covered on this page.
unity --helpCommands
Editors and modules
Command | Alias | Description |
|---|---|---|
| | Installs a Unity Editor version, optionally with modules. |
| | Adds modules to an installed Editor version. |
| | Removes an installed Editor version. |
| | Lists available releases and installed Editors, add local installs, set the default Editor, upgrade Editors, and list running instances. |
| Manages a single installation of a Editor version. For example use | |
| | Shows or changes the path where the CLI installs Editors. |
| Lists available modules for an Editor version ( | |
| Lists available Unity releases from the release feed. | |
| Installs the Unity Hub desktop application ( |
Projects, builds, and templates
Command | Alias | Description |
|---|---|---|
| Opens a Unity project in a compatible Editor version. | |
| Closes the Unity Editor that has a project open. Neither the default nor | |
| | Manages registered Unity projects: list, create, clone, open, link, pin, report disk size, and close. |
| | Lists, inspects, creates, and manages project templates. |
| Builds a project in batch mode with CI-friendly flags, including Android signing and export options. | |
| Runs a project in batch mode, or run a registered Editor command headlessly with | |
| Runs a project's Edit Mode and Play Mode tests through the Editor test runner and write an NUnit report. |
Accounts, licenses, and Unity Cloud
Command | Alias | Description |
|---|---|---|
| | Sign in, check login state, or sign out. |
| Lists, activates, and returns Unity licenses on this machine. | |
| Shows cloud sign-in state, organizations, and Unity Cloud projects. |
Unity Collaboration
Command | Alias | Description |
|---|---|---|
| | Manages Unity Collaboration annotations, attachments, thumbnails, and reactions, and link Jira issues to them. |
Version control
unity vcsCommand | Description |
|---|---|
| Sets up a project from no version control to its first commit on a remote. Asks only what it can't detect, and prints the equivalent flag command. |
| Shows changes grouped by their meaning to Unity, including |
| Pulls safely: refuse while an Editor holds the project, fetch commits and LFS objects, then report the reimport. |
| Switches branches safely and report the impact before you switch. |
| Checks the repository settings, ignore rules, and LFS configuration a Unity project needs. |
| Configures Unity scene and prefab merging (UnityYAMLMerge) for the repository. |
| Lists unresolved merge conflicts, classified by whether they can merge automatically. |
| Explains in plain language what each side of a conflict changed. |
| Resolves a conflicted Unity asset using the Editor's own merge tool. |
| Compares a scene or prefab by GameObject and component name rather than by |
| Summarizes branch changes so you can paste them into a pull request. |
| Reports which assets, assemblies, and tests a change affects. Reports a lower bound when applicable. |
| Installs or removes Git hooks that run Unity integrity checks on your commits. |
| Reports which Git providers this machine can reach, as whom, and what each host allows. |
| Git-only verbs, including |
| Unity Version Control reads, including |
Connected Editors and AI agents
Command | Alias | Description |
|---|---|---|
| | Forwards a command to a connected Unity Editor, or list the commands a connected Editor exposes. |
| Lists every tool a connected Editor registers, with its parameter schema. | |
| | Installs, upgrade, and inspect the Unity pipeline package that connects the CLI to the Editor. |
| Shows the live state of connected Editors: port, project path, version, and process ID. | |
| Starts a Model Context Protocol (MCP) server for AI agents, or configure agent clients to use it. | |
| Manages detached Editor command jobs. | |
| Reads the Unity CLI agent skill, or installs it into an AI client. |
Diagnostics and configuration
Command | Alias | Description |
|---|---|---|
| Prints a diagnostic snapshot and environment health checks. | |
| Prints focused diagnostic reports, such as a redacted proxy report. | |
| Reads and tail the CLI's log file. | |
| Prints environment paths and versions used by the CLI and the Hub. | |
| Views or changes CLI settings by key ( | |
| Manages usage-data consent ( | |
| Shows or cleans the download cache, or print a deterministic cache key for a project's | |
| Reports a bug to Unity, interactively or through flags. | |
| | Shows or changes the CLI display language. |
| Prints a shell completion script for bash, zsh, fish, or PowerShell. | |
| Starts an interactive session that runs many commands in one warm process. | |
| Shows release notes for the installed CLI. | |
| Views and manages the external components Unity installs for you, such as, the Unity Version Control client. |
CLI lifecycle
Command | Alias | Description |
|---|---|---|
| Updates the | |
| Removes the CLI binary, environment files, and stored credentials. | |
| Prints the CLI's version, release channel, commit, platform, architecture, and runtime. | |
| Displays help for any command. Equivalent to |
Help commands
Command | Description |
|---|---|
| Top-level help, including the list of commands. |
| Help for a specific command and its options. |
| Help for a subcommand (for example, |
Update the CLI
Use the built-in self-update command to install the latest CLI release:
unity self-update
unity upgradePrint the CLI version
Print the CLI's version, release channel, commit, platform, architecture, and runtime as one object in any output format:
unity version --format json
A bare still prints only the version string. Set a machine format before the flag (, or ) to switch it to the same structured object, as the flag ends option parsing.
unity --versionunity --format json --versionUNITY_FORMAT=json unity --versionInstall an Editor
Install a Unity Editor version, optionally with modules.
unity install [version] [options]
The argument is positional and optional:
version- On an interactive terminal, omitting the version opens an interactive prompt.
- On a non-interactive terminal (for example, a CI pipeline), omitting the version is an error.
Version aliases
Alias | Resolves to |
|---|---|
| The newest available Editor release. |
| The newest long-term support release. |
| The version configured as your default in the Unity CLI. |
| The newest release within that major or minor stream. |
Install options
Refer to for the complete list.
unity install --helpOption | Usage | Description |
|---|---|---|
| | Changeset for the chosen Editor, required when the version isn't in the release list. |
| | Module IDs to install alongside the Editor. Accepts multiple values. |
| | Also installs child modules of each selected module (for example, Android SDK & NDK under |
| | macOS only. Selects between Apple silicon and Intel builds. |
Install examples
unity install 6000.3.7f1unity install ltsunity install 6000.3.7f1 -c 9b001d489a54unity install 6000.3.7f1 -m android --cmunity install lts -m ios android webgl
Install modules for an existing Editor
Add one or more modules to an Editor you already installed with the Hub or the CLI.
unity install-modules [options]
Install-modules options
Option | Required? | Description |
|---|---|---|
| No | Editor version to add the module to. If omitted on an interactive terminal, you receive a prompt. |
| No | Module ID(s) to install. Accepts multiple values. |
| No | Lists installable modules for the target Editor instead of installing anything. |
| No | Installs every available module for the target Editor. |
| No | Also installs child modules. Use |
Install-modules examples
unity install-modules -e 6000.3.7f1 -m ios androidunity install-modules -e 6000.3.7f1 -lunity install-modules -e 6000.3.7f1 --allunity install-modules -e 6000.3.7f1 -m android --no-cm
Uninstall an Editor
Remove an installed Editor version.
unity uninstall <version>
uninstall examples
unity uninstall 6000.3.7f1
List and manage Editors
Inspect available releases and installed Editors, register locally installed Editors with the Hub, and set a default version.
unity editors [options]unity editors add <path...>unity editors default [version]
Editor options
Option | Alias | Description |
|---|---|---|
| | Shows available releases. |
| | Shows Editors installed on this machine. |
| Includes additional detail in the output. | |
| | Sets Editor architecture (x86_64 or arm64) the default setting is "unknown". |
| N/A | Outputs the list in JSON format. |
| | Watches for editor changes and refresh output (press Ctrl-C to stop). |
| | Displays help for this command. |
Add an Editor
Register an Editor you installed outside the Hub so the Hub and CLI can manage it. Accepts one or more paths.
unity editors add /Applications/Unity/Hub/Editor/6000.3.7f1/Unity.appunity editors add "C:\Program Files\Unity\6000.3.7f1" "C:\Program Files\Unity\2022.3.40f1"
Identify the default Editor
Print the current default Editor, or set a new default by passing a version:
unity editors default # show the defaultunity editors default 6000.3.7f1 # set the default
Editor command examples
unity editors -r # list available releasesunity editors -i # list installed Editorsunity editors -a # combined list
Set or get the Editor install path
Show or change the directory where the CLI installs Unity Editors.
unity install-path [options]
Alias: . Run for the current option list, including flags to display or update the path.
ipunity install-path --helpOpen a project
Open a Unity project, resolving the Editor version declared by the project.
unity open <path>
You can omit the keyword when the first argument is a path:
openunity open ./MyProjectunity ./MyProject # equivalent
Manage projects in the Hub registry
Manage the list of Unity projects the Hub knows about, so both the Hub UI and the CLI can find and open them.
unity projects [subcommand] [options]
Alias: . Run to check the available commands and options in your installed CLI version.
punity projects --helpSign in and out
The command manages your Unity account session.
authunity auth loginunity auth statusunity auth logout
Command | Description |
|---|---|
| Opens a browser-based sign-in flow. |
| Prints the current signed-in user, if any. |
| Signs out of the current session. |
| Lists the applications that have used your Unity sign-in on this machine. |
| Stops an application from using your sign-in. Pass |
Change the CLI display language
Show the current CLI display language, or change it to a supported language.
unity language [options]
Alias: . Run for the list of supported languages and the exact option names.
langunity language --helpOutput formats and automation
The CLI chooses a default output format based on the context and supports explicit formats for automation.
Format selection
Format | Selected when | Notes |
|---|---|---|
| Output goes to an interactive terminal. | Colorized, animated progress, aligned columns. |
| Output goes to a pipe or file. | Tab-separated, one record per line. Machine-parseable. |
| You set | Structured output for use with |
| You set | One JSON object per line. Long-running commands, such as |
| You set | Failures print as GitHub Actions annotations ( |
Select a format explicitly with the global flag:
unity editors -i --format jsonunity editors -i --format tsvunity install lts --format ndjson
Color output
Use the global flag to control colored output directly instead of relying only on the and environment variables. is shorthand for . Color affects only output. The , , and formats never emit color.
--color <auto|always|never>NO_COLORFORCE_COLOR--no-color--color neverhumanjsontsvndjsonError output
The CLI writes errors and diagnostic messages to , leaving free for data output. In JSON mode, the CLI emits errors as on .
stderrstdout{"error": "..."}stderrTo capture both streams in a shell:
unity install 6000.3.7f1 > install.log 2>&1
Exit codes
Code | Meaning |
|---|---|
| Success. |
| A general error occurred. Inspect |
| Usage error: invalid flags, invalid option values, or missing required arguments. |
| Authentication or authorization failure, such as a rejected sign-in or an expired session. |
| Configuration required: the arguments are valid, but a required preference or context isn't set. |
| The command's primary operation failed. For example, an Editor install failed, or the Editor exited with an error. For |
| A Unity service couldn't be reached. The CLI retried before giving up, so this is safe for a script to retry; a |
| |
| The command was interrupted with Ctrl+C ( |
| The command was terminated with |
Environment variables
Global CLI options have environment variable equivalents, and some behaviors are controlled only through the environment. A command-line flag takes precedence over its environment variable.
Variable | Effect |
|---|---|
| Default output format ( |
| Suppress non-essential output, like |
| Suppress the Unity banner, like |
| Disable interactive prompts, like |
| Pager for long human-readable output. Falls back to |
| Never page output, like |
| Default Unity project path for commands that accept |
| Default Unity Cloud organization for commands that accept |
| Proxy server URL, like |
| Log one redacted entry per outbound request for proxy troubleshooting, like |
| Number of retries for module downloads that fail intermittently, like |
| Windows only. Skip the elevated (UAC) install helper, like |
| End |
| Disable the background check for CLI updates. |
| Create projects without the Unity Cloud step, like |
| Allow an unattended run to install missing tools, such as Git LFS, without asking. |
| Disable anonymous crash and error reporting. |
| Suppress the one-time first-run analytics consent prompt without recording a choice. |
| Authenticate as a Unity service account for unattended workflows. Set both. |
Progress output
Long-running commands (such as ) render animated progress bars on an interactive terminal and a static summary when complete. Progress output is for human readers. Don't parse it in scripts. For a machine-readable result, use ; to also stream machine-readable progress updates while the command runs, use , which emits typed progress frames followed by a final result frame.
install--format json--format ndjsonLog locations
The CLI writes its own log file, , in the shared Unity Hub logs directory. Read and follow it with , or include it in a diagnostic snapshot with .
cli-log.jsonunity logsunity doctorPlatform | Path |
|---|---|
| Windows | |
| macOS | |
| Linux | |
You can also open the log folder from the Hub: Account > Help and Support > Logs.
Migrate from the Hub CLI
If you have scripts targeting the CLI embedded in the Unity Hub desktop application (invoked with ), the following tables summarize the behavioral and syntactic differences. For full Hub CLI syntax, refer to Hub CLI reference.
-- --headlessInvocation
Hub CLI | Unity CLI | |
|---|---|---|
| How to run | | |
| Dependency | Requires the full Unity Hub desktop application. | Standalone binary; no Hub installation required. |
Command and flag changes
Area | Hub CLI | Unity CLI |
|---|---|---|
| | |
| | |
| | |
| | |
| Editor version | Reserved. |
| Platform-specific help text files | Replaced by |
Output and errors
Area | Hub CLI | Unity CLI |
|---|---|---|
| Default output | Plain text, always | |
| Structured output | | Global |
| Errors | Written to | Written to |
| Progress | Plain text lines, for example | Animated progress bar; static summary on completion |
| Exit codes | | Differentiated codes for usage, auth, and command failures. Refer to Exit codes. |
Removed global flags
These Hub CLI flags have no equivalent in the Unity CLI:
--headless--errors--silent--logLevel-l--bugReporter--debugMode--inspect--userEmail--theme--editorLicense--servicesUrlInterval--cloudEnvironmentNew commands
The Unity CLI includes many commands that are not available in the Hub CLI, including , , , , , , , , , and . Refer to the Commands tables for the full list. The path shorthand is equivalent to .
authopenprojectsuninstallself-updatebuildtestlicenseshellmcpunity ./MyProjectunity open ./MyProjectImpact summary
High: scripts that fail without updates
- Replace invocations with
-- --headless.unity - Replace with
install -v <version>(positional).install <version> - Replace /
install-modules --versionwith-v/--editor-version.-e - Replace with
editors --add.editors add
Medium: behavior changes that can produce wrong results
- Piped defaults to TSV, not plain text.
stdout - Errors go to , not
stderr.stdout - Progress output format changed. Don't parse it.
Low: additive changes that don't break existing usage
- New commands: ,
auth,open,projects,uninstall.self-update - New flags such as ,
--verbose, and--list.--all - Version aliases: ,
latest,lts, and short majors.default - New exit code for user cancellation.
130