A powerful command line utility for the Unity Game Engine. Automate Unity project setup, editor installation, license management, building, and more—ideal for CI/CD pipelines and developer workflows.
- Install and manage Unity Hub and Unity Editors (multi-platform)
- Activate and return Unity licenses (personal, professional, floating)
- Create new Unity projects from templates
- Run Unity Editor commands and builds from the CLI
- Supports all modules, architectures, and build targets
- Works on Windows, macOS, and Linux
- Designed for automation and CI/CD
npm install -g @rage-against-the-pixel/unity-cliIn general, the command structure is:
unity-cli [command] [options] <args...>With options always using double dashes (--option) and arguments passed directly to Unity or Unity Hub commands as they normally would with single dashes (-arg). Each option typically has a short alias using a single dash (-o), except for commands where we pass through arguments, as those get confused by the command parser.
unity-cli --helpfor a full list of commands and options.unity-cli [command] --helpfor details on a specific command.unity-cli [command] --jsonto get the output in JSON format (if supported).unity-cli [command] --verbose <args...>to enable verbose logging for debugging.
Important
<args...> must always be the last parameters passed to the command when using any command options.
unity-cli --helplicense-version: Print the Unity License Client version.
unity-cli license-versionactivate-license [options]: Activate a Unity license.
-l,--license: License type (personal, professional, floating). Required.-e,--email: Email associated with the Unity account. Required when activating a personal or professional license.-p,--password: Password for the Unity account. Required when activating a personal or professional license.-s,--serial: License serial number. Required when activating a professional license.-c,--config: Path to the configuration file, or base64 encoded JSON string. Required when activating a floating license.--verbose: Enable verbose output.
unity-cli activate-license --license personal --email <your-email> --password <your-password>return-license [options]: Return a Unity license.
-l,--license: License type (personal, professional, floating)--verbose: Enable verbose output.
unity-cli return-license --license personalhub-version: Print the Unity Hub version.
unity-cli hub-versionhub-path: Print the Unity Hub executable path.
unity-cli hub-pathhub-install [options]: Install or update the Unity Hub
--auto-update: Automatically updates the Unity Hub if it is already installed. Cannot be used with--hub-version.--hub-version: Specify to install a specific version of Unity Hub. Cannot be used with--auto-update.--verbose: Enable verbose output.--json: Output installation information in JSON format.
unity-cli hub-installhub [options] <args...>: Run Unity Hub command line arguments (passes args directly to the hub executable).
--verbose: Enable verbose output.<args...>: Arguments to pass directly to the Unity Hub executable.
Lists available Unity Hub commands:
unity-cli --verbose hub helpGets a list of installed editors:
unity-cli hub editors --installedsetup-unity [options]: Find or install the Unity Editor for a project or specific version.
-p,--unity-project <unityProject>The path to a Unity project ornoneto skip project detection.-u,--unity-version <unityVersion>The Unity version to get (e.g.2020.3.1f1,2021.x,2022.1.*,6000). If specified, it will override the version read from the project.-c,--changeset <changeset>The Unity changeset to get (e.g.1234567890ab).-a,--arch <arch>The Unity architecture to get (e.g.x86_64,arm64). Defaults to the architecture of the current process.-b,--build-targets <buildTargets>The Unity build target to get/install as comma-separated values (e.g.iOS,Android).-m,--modules <modules>The Unity module to get/install as comma-separated values (e.g.ios,android).-i,--install-path <installPath>The path to install the Unity Editor to. By default, it will be installed to the default Unity Hub location.--verboseEnable verbose logging.--jsonPrints the last line of output as JSON string.
Installs the latest Unity 6 version with Android and iOS modules:
unity-cli setup-unity --unity-version 6000 --modules android,iosuninstall-unity [options]: Uninstall a Unity Editor version.
-e,--unity-editor <unityEditor>The path to the Unity Editor executable. If unspecified,-u,--unity-versionor theUNITY_EDITOR_PATHenvironment variable must be set.-u,--unity-version <unityVersion>The Unity version to get (e.g.2020.3.1f1,2021.x,2022.1.*,6000). If unspecified, then--unity-editormust be specified.-c,--changeset <changeset>The Unity changeset to get (e.g.1234567890ab).-a,--arch <arch>The Unity architecture to get (e.g.x86_64,arm64). Defaults to the architecture of the current process.--verboseEnable verbose logging.
unity-cli uninstall-unity --unity-version 6000Note
Regex patterns are supported for the --template option. For example, to create a 3D project with either the standard or cross-platform template, you can use com.unity.template.3d(-cross-platform)?.
list-project-templates [options]: List available Unity project templates for an editor.
-e,--unity-editor <unityEditor>The path to the Unity Editor executable. If unspecified,-u,--unity-versionor theUNITY_EDITOR_PATHenvironment variable must be set.-u,--unity-version <unityVersion>The Unity version to get (e.g.2020.3.1f1,2021.x,2022.1.*,6000). If unspecified, then--unity-editormust be specified.-c,--changeset <changeset>The Unity changeset to get (e.g.1234567890ab).-a,--arch <arch>The Unity architecture to get (e.g.x86_64,arm64). Defaults to the architecture of the current process.--verboseEnable verbose logging.--jsonPrints the last line of output as JSON string.
Lists available project templates for Unity 6:
unity-cli list-project-templates --unity-version 6000create-project [options]: Create a new Unity project from a template.
-n,--name <projectName>The name of the new Unity project. If unspecified, the project will be created in the specified path or the current working directory.-p,--path <projectPath>The path to create the new Unity project. If unspecified, the current working directory will be used.-t,--template <projectTemplate>The name of the template package to use for creating the unity project. Supports regex patterns. (default:com.unity.template.3d(-cross-platform)?)-u,--unity-version <unityVersion>The Unity version to get (e.g.2020.3.1f1,2021.x,2022.1.*,6000). If unspecified, then--unity-editormust be specified.-e,--unity-editor <unityEditor>The path to the Unity Editor executable. If unspecified,-u,--unity-version, or theUNITY_EDITOR_PATHenvironment variable must be set.--verboseEnable verbose logging.--jsonPrints the last line of output as JSON string.
Creates a new Unity project named "MyGame" using the latest version of Unity 6 and the 3D template:
unity-cli create-project --name "MyGame" --template com.unity.template.3d(-cross-platform)? --unity-version 6000open-project [options]: Open a Unity project in the Unity Editor.
-p,--unity-project <unityProject>The path to a Unity project. If unspecified, theUNITY_PROJECT_PATHenvironment variable or the current working directory will be used.-u,--unity-version <unityVersion>The Unity version to get (e.g.2020.3.1f1,2021.x,2022.1.*,6000). If specified, it will override the version read from the project.-t,--build-target <buildTarget>The Unity build target to switch the project to (e.g.StandaloneWindows64,StandaloneOSX,iOS,Android, etc).--verboseEnable verbose logging.
Opens a specific Unity project with the latest Unity 6 version and switches the active platform to Android:
unity-cli open-project --unity-project <path-to-project> --unity-version 6000 --build-target AndroidTip
If you run this command in the same directory as your Unity project, you can omit the --unity-project, --unity-version, and --unity-editor options.
unity-cli open-projectrun [options] <args...>: Run Unity Editor command line arguments (passes args directly to the editor).
--unity-editor <unityEditor>The path to the Unity Editor executable. If unspecified,--unity-projector theUNITY_EDITOR_PATHenvironment variable must be set.--unity-project <unityProject>The path to a Unity project. If unspecified, theUNITY_PROJECT_PATHenvironment variable will be used, otherwise no project will be specified.--log-name <logName>The name of the log file.--verboseEnable verbose logging.<args...>Arguments to pass directly to the Unity Editor executable.
unity-cli run --unity-project <path-to-project> -quit -batchmode -executeMethod StartCommandLineBuildWarning
This command feature is in beta and may change in future releases.
sign-package [options]: Sign a Unity package for distribution.
--package <package>Required. The fully qualified path to the folder that contains the package.json file for the package you want to sign. Note: Don’t include package.json in this parameter value.--output <output>Optional. The output directory where you want to save the signed tarball file (.tgz). If unspecified, the package contents will be updated in place with the signed .attestation.p7m file.--email <email>Email associated with the Unity account. If unspecified, theUNITY_USERNAMEenvironment variable will be used.--password <password>The password of the Unity account. If unspecified, theUNITY_PASSWORDenvironment variable will be used.--organization <organization>The Organization ID you copied from the Unity Cloud Dashboard. If unspecified, theUNITY_ORGANIZATION_IDenvironment variable will be used.--verboseEnable verbose logging.
Note
The --output option is optional. If not specified, the package contents will be updated in place with the signed .attestation.p7m file. Otherwise a signed .tgz file will be created in the specified output directory.
unity-cli sign-package --package <path-to-package-folder> --email <your-email> --password <your-password> --organization <your-organization-id>