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.
読み終わるまでの所要時間 11 分最終更新 9日前
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 |
|---|---|---|
| | Install a Unity Editor version, optionally with modules. |
| | Add modules to an installed Editor version. |
| | Remove an installed Editor version. |
| | List available releases and installed Editors, add local installs, set the default Editor, upgrade Editors, and list running instances. |
| Manage a single installation of a Editor version. For example use | |
| | Show or change the path where the CLI installs Editors. |
| List available modules for an Editor version ( | |
| List available Unity releases from the release feed. | |
| Install the Unity Hub desktop application ( |
Projects, builds, and templates
Command | Alias | Description |
|---|---|---|
| Open a Unity project in a compatible Editor version. | |
| | Manage registered Unity projects: list, create, clone, open, link, pin, report disk size, and close. |
| | List, inspect, create, and manage project templates. |
| Build a project in batch mode with CI-friendly flags, including Android signing and export options. | |
| Run a project in batch mode, or run a registered Editor command headlessly with | |
| Run 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. |
| List, activate, and return Unity licenses on this machine. | |
| Show cloud sign-in state, organizations, and Unity Cloud projects. |
Connected Editors and AI agents
Command | Alias | Description |
|---|---|---|
| | Forward a command to a connected Unity Editor, or list the commands a connected Editor exposes. |
| List every tool a connected Editor registers, with its parameter schema. | |
| | Install, upgrade, and inspect the Unity pipeline package that connects the CLI to the Editor. |
| Show the live state of connected Editors: port, project path, version, and process ID. | |
| Start a Model Context Protocol (MCP) server for AI agents, or configure agent clients to use it. |
Diagnostics and configuration
Command | Alias | Description |
|---|---|---|
| Print a diagnostic snapshot and environment health checks. | |
| Print focused diagnostic reports, such as a redacted proxy report. | |
| Read and tail the CLI's log file. | |
| Print environment paths and versions used by the CLI and the Hub. | |
| View or change CLI settings, such as the proxy server and update checks. | |
| Manage usage-data consent ( | |
| Show or clean the download cache. | |
| Report a bug to Unity, interactively or through flags. | |
| | Show or change the CLI display language. |
| Print a shell completion script for bash, zsh, fish, or PowerShell. | |
| Start an interactive session that runs many commands in one warm process. | |
| Show release notes for the installed CLI. |
CLI lifecycle
Command | Alias | Description |
|---|---|---|
| Self-update the | |
| Remove the CLI binary, environment files, and stored credentials. | |
| Display 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 upgrade
Install 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 install 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 | List installable modules for the target Editor instead of installing anything. |
| No | Install every available module for the target Editor. |
| No | Also install 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 |
|---|---|---|
| | Show available releases. |
| | Show Editors installed on this machine. |
| Include additional detail in the output. | |
| | Set Editor architecture (x86_64 or arm64) the default setting is "unknown". |
| N/A | Output the list in JSON format. |
| | Watch for editor changes and refresh output (press Ctrl-C to stop). |
| | Display 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. |
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 |
Select a format explicitly with the global flag:
unity editors -i --format jsonunity editors -i --format tsvunity install lts --format ndjson
Error 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, tests failed, or the Editor exited with an error. |
| 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 |
| 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 |
| Disable the background check for CLI updates. |
| 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 adds many commands not in the Hub CLI, including , , , , , , , , , and . Refer to the Commands tables for the full list. The path shorthand is equivalent to .
authopenprojectsuninstallupgradebuildtestlicenseshellmcpunity ./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.upgrade - New flags such as ,
--verbose, and--list.--all - Version aliases: ,
latest,lts, and short majors.default - New exit code for user cancellation.
130