|
1 | 1 | # unity-cli |
2 | | -A command line utility for the Unity Game Engine |
| 2 | + |
| 3 | +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. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- Install and manage Unity Hub and Unity Editors (multi-platform) |
| 8 | +- Activate and return Unity licenses (personal, professional, floating) |
| 9 | +- Create new Unity projects from templates |
| 10 | +- Run Unity Editor commands and builds from the CLI |
| 11 | +- Supports all modules, architectures, and build targets |
| 12 | +- Works on Windows, macOS, and Linux |
| 13 | +- Designed for automation and CI/CD |
| 14 | + |
| 15 | +## Installation |
| 16 | + |
| 17 | +```bash |
| 18 | +npm install -g @rage-against-the-pixel/unity-cli |
| 19 | +``` |
| 20 | + |
| 21 | +## Usage |
| 22 | + |
| 23 | +```bash |
| 24 | +unity-cli [command] [options] |
| 25 | +``` |
| 26 | + |
| 27 | +### Common Commands |
| 28 | + |
| 29 | +- `unity-cli hub-install`: Install Unity Hub |
| 30 | +- `unity-cli hub-version`: Print Unity Hub version |
| 31 | +- `unity-cli hub-path`: Print Unity Hub executable path |
| 32 | +- `unity-cli hub [args...]`: Run Unity Hub commands directly |
| 33 | +- `unity-cli activate-license`: Activate a Unity license |
| 34 | +- `unity-cli return-license`: Return a Unity license |
| 35 | +- `unity-cli license-version`: Print Unity License Client version |
| 36 | +- `unity-cli setup-unity`: Find or install Unity Editor for a project/version |
| 37 | +- `unity-cli create-project`: Create a new Unity project from a template |
| 38 | +- `unity-cli run [args...]`: Run commands in [Unity Editor Command Line Arguments](https://docs.unity3d.com/Manual/EditorCommandLineArguments.html) |
| 39 | + |
| 40 | +#### Install Unity Hub and Editor |
| 41 | + |
| 42 | +```bash |
| 43 | +unity-cli hub-install |
| 44 | +unity-cli setup-unity --unity-version 2022.3.x --modules android,ios --json |
| 45 | +``` |
| 46 | + |
| 47 | +#### Activate a Unity License |
| 48 | + |
| 49 | +```bash |
| 50 | +unity-cli activate-license --email <your-email> --password <your-password> --serial <your-serial> |
| 51 | +``` |
| 52 | + |
| 53 | +#### Create a New Project from a Template |
| 54 | + |
| 55 | +```bash |
| 56 | +unity-cli create-project --name "MyGame" --template com.unity.template.3d --unity-editor <path-to-editor> |
| 57 | +``` |
| 58 | + |
| 59 | +#### Build a Project |
| 60 | + |
| 61 | +```bash |
| 62 | +unity-cli run --unity-editor <path-to-editor> --unity-project <path-to-project> -quit -batchmode -executeMethod Utilities.Editor.BuildPipeline.UnityPlayerBuildTools.StartCommandLineBuild |
| 63 | +``` |
0 commit comments