Documentation

Unity command-line interface (CLI)

Download Unity Hub

Unity command-line interface (CLI)

Unity Editor and project commands for the Unity CLI

Install and manage Unity Editors and modules, open and manage projects, build and test projects, and control running Editors from the Unity CLI.
Read time 7 minutesLast updated 2 days ago

Use these commands to install and manage Unity Editor versions and modules, open and register projects, run builds and tests, and send commands to a running Editor. To control a running Editor from the CLI, install the Unity Pipeline package first.

Editors and modules

Command

Alias

Description

install
i
Installs a Unity Editor version, optionally with modules.
install-modules
im
Adds modules to an installed Editor version.
uninstall
u
Removes an installed Editor version.
editors
e
Lists available releases and installed Editors, adds local installs, sets the default Editor, upgrades Editors, lists running instances, and prunes unused or missing Editors.
editor
Manages a single installation of a Editor version. For example use
editor module remove
to remove installed modules on a specific Editor version.
install-path
ip
Shows or changes the path where the CLI installs Editors.
modules
Lists available modules for an Editor version (
modules list <version>
).
releases
Lists available Unity releases from the release feed.
hub
Installs the Unity Hub desktop application (
hub install
).

Projects, builds, and templates

Command

Alias

Description

open
Opens a Unity project in a compatible Editor version.
close
Closes the Unity Editor that has a project open. Neither the default nor
--force
saves your work.
projects
p
Manages registered Unity projects: list, create, clone, open, link, pin, report disk size, and close.
templates
t
Lists, inspects, creates, and manages project templates.
assets
Inspects, exports, and imports Unity asset packages.
assets inspect <file>
lists the contents of a
.unitypackage
without importing it,
assets export
writes project assets to a
.unitypackage
, and
assets import <file>
imports one into a project.
build
Builds a project in batch mode with CI-friendly flags, including Android signing and export options. Use
--list-targets
,
--list-profiles
, and
--create-profile <target>
to discover targets and create Unity 6 build profiles, and
build run
to launch the project's most recent recorded build.
run
Runs a project in batch mode or runs a registered Editor command in headless mode with
--command
. Use
--log-file <path>
to write the Editor log to a file.
recompile
Recompiles a running Editor's scripts and reports compile errors, without a full build.
--strict
also fails on warnings.
test
Runs a project's Edit Mode and Play Mode tests through the Editor test runner and write an NUnit report.
watch
Watches a project and re-runs a command each time its files change.
watch test
re-runs
unity test --affected
.

Connected Editors and AI agents

Command

Alias

Description

command
cmd
Forwards a command to a connected Unity Editor, or list the commands a connected Editor exposes.
commands
Lists every command and subcommand as a machine-readable manifest (
--format json
) for agents and tooling.
list
Lists every tool a connected Editor registers, with its parameter schema.
pipeline
pipe
Installs, upgrades, and inspects the Unity pipeline package that connects the CLI to the Editor.
pipeline cloud-build
and
pipeline automation
read Unity Build Automation and Unity Pipeline Automation.
status
Shows the live state of connected Editors: port, project path, version, and process ID.
mcp
Starts a Model Context Protocol (MCP) server for AI agents, or configures agent clients to use it.
mcp configure --server issue-tracker
configures the Unity Issue Tracker MCP server.
job
Manages detached Editor command jobs.
skill
Reads the Unity CLI agent skill, or installs it into an AI client.

Install an Editor

Install a Unity Editor version, optionally with modules.
unity install [version] [options]
The
version
argument is positional and optional:
  • 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

latest
The newest available Editor release.
lts
The newest long-term support release.
default
The version configured as your default in the Unity CLI.
6
,
6.5
,
2022
, and similar
The newest release within that major or minor stream.

Install options

Refer to
unity install --help
for the complete list.

Option

Usage

Description

-c, --changeset <hash>
-c 9b001d489a54
Changeset for the chosen Editor, required when the version isn't in the release list.
-m, --module <id>
-m android
or
-m ios webgl
Module IDs to install alongside the Editor. Accepts multiple values.
--cm
,
--child-modules
--cm
Also installs child modules of each selected module (for example, Android SDK & NDK under
android
).
--childModules
also still works.
-a, --architecture <arch>
-a arm64
or
-a x86_64
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
Note
For available module IDs, refer to Add modules to a Unity Editor installation and the module ID table.

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]
Important
You can only add modules to Editors that the Hub or CLI installed. Reinstall manually installed Editors through the Hub or CLI to add modules.

Install-modules options

Option

Required?

Description

-e, --editor-version <version>
NoEditor version to add the module to. If omitted on an interactive terminal, you receive a prompt.
-m, --module <id>
NoModule ID(s) to install. Accepts multiple values.
-l, --list
NoLists installable modules for the target Editor instead of installing anything.
--all
NoInstalls every available module for the target Editor.
--cm
,
--child-modules
NoAlso installs child modules. Use
--no-cm
(or
--no-child-modules
) to explicitly skip them. The previous
--childModules
/
--no-childModules
options also still work.

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

--releases
-r
Shows available releases.
--installed
-i
Shows Editors installed on this machine.
--verbose
Includes additional detail in the output.
--architecture <architecture>
-a
Sets Editor architecture (x86_64 or arm64) the default setting is "unknown".
--json
N/AOutputs the list in JSON format.
--watch 
-w
Watches for editor changes and refresh output (press Ctrl-C to stop).
--help
-h
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:
ip
. Run
unity install-path --help
for the current option list, including flags to display or update the path.

Open a project

Open a Unity project, resolving the Editor version declared by the project.
unity open <path>
You can omit the
open
keyword when the first argument is a path:
unity open ./MyProjectunity ./MyProject # equivalent
On macOS and Linux, add
--wait
to keep the command running until the Editor exits. The command then exits with code 0 when the Editor exits cleanly, or 6 when it fails or crashes.
--wait
isn't supported on Windows yet and exits with code 2.

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:
p
. Run
unity projects --help
to check the available commands and options in your installed CLI version.