Skip to content

Commit e1f05d0

Browse files
reorganize readme
1 parent 50de2c5 commit e1f05d0

1 file changed

Lines changed: 129 additions & 50 deletions

File tree

README.md

Lines changed: 129 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -54,36 +54,97 @@ With options always using double dashes (`--option`) and arguments passed direct
5454
- `unity-cli [command] --json` to get the output in JSON format (if supported).
5555
- `unity-cli [command] --verbose` to enable verbose logging for debugging.
5656

57+
```bash
58+
unity-cli --help
59+
```
60+
5761
#### Auth
5862

59-
- `unity-cli license-version`: Print the Unity License Client version.
60-
- `unity-cli activate-license [options]`: Activate a Unity license.
63+
##### License Version
64+
65+
- `license-version`: Print the Unity License Client version.
66+
67+
```bash
68+
unity-cli license-version
69+
```
70+
71+
##### Activate License
72+
73+
- `activate-license [options]`: Activate a Unity license.
6174
- `-l`, `--license`: License type (personal, professional, floating). Required.
6275
- `-e`, `--email`: Email associated with the Unity account. Required when activating a personal or professional license.
6376
- `-p`, `--password`: Password for the Unity account. Required when activating a personal or professional license.
6477
- `-s`, `--serial`: License serial number. Required when activating a professional license.
6578
- `-c`, `--config`: Path to the configuration file, or base64 encoded JSON string. Required when activating a floating license.
6679
- `--verbose`: Enable verbose output.
67-
- `unity-cli return-license [options]`: Return a Unity license.
80+
81+
```bash
82+
unity-cli activate-license --license personal --email <your-email> --password <your-password>
83+
```
84+
85+
##### Return License
86+
87+
- `return-license [options]`: Return a Unity license.
6888
- `-l`, `--license`: License type (personal, professional, floating)
6989
- `--verbose`: Enable verbose output.
7090

91+
```bash
92+
unity-cli return-license --license personal
93+
```
94+
7195
#### Unity Hub
7296

73-
- `unity-cli hub-version`: Print the Unity Hub version.
97+
##### Hub Version
98+
99+
- `hub-version`: Print the Unity Hub version.
100+
101+
```bash
102+
unity-cli hub-version
103+
```
104+
105+
##### Hub Path
106+
74107
- `unity-cli hub-path`: Print the Unity Hub executable path.
108+
109+
```bash
110+
unity-cli hub-path
111+
```
112+
113+
##### Unity Hub Install
114+
75115
- `unity-cli hub-install [options]`: Install or update the Unity Hub
76116
- `--auto-update`: Automatically updates the Unity Hub if it is already installed. Cannot be used with --hub-version.
77117
- `--hub-version`: Specify to install a specific version of Unity Hub. Cannot be used with --auto-update.
78118
- `--verbose`: Enable verbose output.
79119
- `--json`: Output installation information in JSON format.
120+
121+
```bash
122+
unity-cli hub-install
123+
```
124+
125+
##### Run Unity Hub Commands
126+
80127
- `unity-cli hub [options] <args...>`: Run Unity Hub command line arguments (passes args directly to the hub executable).
81128
- `<args...>`: Arguments to pass directly to the Unity Hub executable.
82129
- `--verbose`: Enable verbose output.
83130

131+
Lists available Unity Hub commands:
132+
133+
```bash
134+
unity-cli hub help
135+
```
136+
137+
Gets a list of installed editors:
138+
139+
```bash
140+
unity-cli hub editors --installed
141+
```
142+
84143
#### Unity Editor
85144

86-
- `unity-cli setup-unity [options]`: Find or install the Unity Editor for a project or specific version.
145+
##### Setup Unity Editor
146+
147+
- `setup-unity [options]`: Find or install the Unity Editor for a project or specific version.
87148
- `-p`, `--unity-project <unityProject>` The path to a Unity project or `none` to skip project detection.
88149
- `-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.
89150
- `-c`, `--changeset <changeset>` The Unity changeset to get (e.g. `1234567890ab`).
@@ -93,20 +154,48 @@ With options always using double dashes (`--option`) and arguments passed direct
93154
- `-i`, `--install-path <installPath>` The path to install the Unity Editor to. By default, it will be installed to the default Unity Hub location.
94155
- `--verbose` Enable verbose logging.
95156
- `--json` Prints the last line of output as JSON string.
96-
- `unity-cli uninstall-unity [options]`: Uninstall a Unity Editor version.
157+
158+
Installs the latest Unity 6 version with Android and iOS modules:
159+
160+
```bash
161+
unity-cli setup-unity --unity-version 6000 --modules android,ios
162+
```
163+
164+
##### Uninstall Unity Editor
165+
166+
- `uninstall-unity [options]`: Uninstall a Unity Editor version.
97167
- `-e`, `--unity-editor <unityEditor>` The path to the Unity Editor executable. If unspecified, `-u`, `--unity-version` or the `UNITY_EDITOR_PATH` environment variable must be set.
98168
- `-u`, `--unity-version <unityVersion>` The Unity version to get (e.g. `2020.3.1f1`, `2021.x`, `2022.1.*`, `6000`). If unspecified, then `--unity-editor` must be specified.
99169
- `-c`, `--changeset <changeset>` The Unity changeset to get (e.g. `1234567890ab`).
100170
- `-a`, `--arch <arch>` The Unity architecture to get (e.g. `x86_64`, `arm64`). Defaults to the architecture of the current process.
101171
- `--verbose` Enable verbose logging.
102-
- `unity-cli list-project-templates [options]`: List available Unity project templates for an editor.
172+
173+
```bash
174+
unity-cli uninstall-unity --unity-version 6000
175+
```
176+
177+
##### List Project Templates
178+
179+
> [!NOTE]
180+
> 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)?`.
181+
182+
- `list-project-templates [options]`: List available Unity project templates for an editor.
103183
- `-e`, `--unity-editor <unityEditor>` The path to the Unity Editor executable. If unspecified, `-u`, `--unity-version` or the `UNITY_EDITOR_PATH` environment variable must be set.
104184
- `-u`, `--unity-version <unityVersion>` The Unity version to get (e.g. `2020.3.1f1`, `2021.x`, `2022.1.*`, `6000`). If unspecified, then `--unity-editor` must be specified.
105185
- `-c`, `--changeset <changeset>` The Unity changeset to get (e.g. `1234567890ab`).
106186
- `-a`, `--arch <arch>` The Unity architecture to get (e.g. `x86_64`, `arm64`). Defaults to the architecture of the current process.
107187
- `--verbose` Enable verbose logging.
108188
- `--json` Prints the last line of output as JSON string.
109-
- `unity-cli create-project [options]`: Create a new Unity project from a template.
189+
190+
Lists available project templates for Unity 6:
191+
192+
```bash
193+
unity-cli list-project-templates --unity-version 6000
194+
```
195+
196+
##### Create Unity Project
197+
198+
- `create-project [options]`: Create a new Unity project from a template.
110199
- `-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.
111200
- `-p`, `--path <projectPath>` The path to create the new Unity project. If unspecified, the current working directory will be used.
112201
- `-t`, `--template <projectTemplate>` The name of the template package to use for creating the unity project. Supports regex patterns. (default:
@@ -115,71 +204,61 @@ With options always using double dashes (`--option`) and arguments passed direct
115204
- `-e`, `--unity-editor <unityEditor>` The path to the Unity Editor executable. If unspecified, `-u`, `--unity-version`, or the `UNITY_EDITOR_PATH` environment variable must be set.
116205
- `--verbose` Enable verbose logging.
117206
- `--json` Prints the last line of output as JSON string.
118-
- `unity-cli open-project [options]`: Open a Unity project in the Unity Editor.
119-
- `-p`, `--unity-project <unityProject>` The path to a Unity project. If unspecified, the `UNITY_PROJECT_PATH` environment variable or the current working directory will be used.
120-
- `-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.
121-
- `-t`, `--build-target <buildTarget>` The Unity build target to switch the project to (e.g. `StandaloneWindows64`, `StandaloneOSX`, `iOS`, `Android`, etc).
122-
- `--verbose` Enable verbose logging.
123-
- `unity-cli run [options] <args...>`: Run Unity Editor command line arguments (passes args directly to the editor).
124-
- `--unity-editor <unityEditor>` The path to the Unity Editor executable. If unspecified, `--unity-project` or the `UNITY_EDITOR_PATH` environment variable must be set.
125-
- `--unity-project <unityProject>` The path to a Unity project. If unspecified, the `UNITY_PROJECT_PATH` environment variable will be used, otherwise no project will be specified.
126-
- `--log-name <logName>` The name of the log file.
127-
- `<args...>` Arguments to pass directly to the Unity Editor executable.
128-
- `--verbose` Enable verbose logging.
129207

130-
#### Unity Package Manager
131-
132-
> [!WARNING]
133-
> This command feature is in beta and may change in future releases.
134-
135-
- `unity-cli sign-package [options]`: Sign a Unity package for distribution.
136-
- `--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.
137-
- `--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.
138-
- `--email <email>` Email associated with the Unity account. If unspecified, the `UNITY_USERNAME` environment variable will be used.
139-
- `--password <password>` The password of the Unity account. If unspecified, the `UNITY_PASSWORD` environment variable will be used.
140-
- `--organization <organization>` The Organization ID you copied from the Unity Cloud Dashboard. If unspecified, the `UNITY_ORGANIZATION_ID` environment variable will be used.
141-
- `--verbose` Enable verbose logging.
142-
143-
#### Install Unity Hub and Editor
208+
Creates a new Unity project named "MyGame" using the latest version of Unity 6 and the 3D template:
144209

145210
```bash
146-
unity-cli hub-install
147-
unity-cli setup-unity --unity-version 2022.3.x --modules android,ios
211+
unity-cli create-project --name "MyGame" --template com.unity.template.3d(-cross-platform)? --unity-version 6000
148212
```
149213

150-
#### Activate a Unity License
151-
152-
Supports personal, professional, and floating licenses (using a license server configuration).
214+
##### Open Unity Project
153215

154-
```bash
155-
unity-cli activate-license --license personal --email <your-email> --password <your-password>
156-
```
216+
- `open-project [options]`: Open a Unity project in the Unity Editor.
217+
- `-p`, `--unity-project <unityProject>` The path to a Unity project. If unspecified, the `UNITY_PROJECT_PATH` environment variable or the current working directory will be used.
218+
- `-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.
219+
- `-t`, `--build-target <buildTarget>` The Unity build target to switch the project to (e.g. `StandaloneWindows64`, `StandaloneOSX`, `iOS`, `Android`, etc).
220+
- `--verbose` Enable verbose logging.
157221

158-
#### Create a New Project from a Template
159-
160-
> [!NOTE]
161-
> 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)?`.
222+
Opens a specific Unity project with the latest Unity 6 version:
162223

163224
```bash
164-
unity-cli create-project --name "MyGame" --template com.unity.template.3d(-cross-platform)? --unity-editor <path-to-editor>
225+
unity-cli open-project --unity-project <path-to-project> --unity-version 6000
165226
```
166227

167-
#### Open a project from the command line
168-
169228
> [!TIP]
170229
> 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.
171230
172231
```bash
173232
unity-cli open-project
174233
```
175234

176-
#### Build a Project
235+
##### Run Unity Editor Commands
236+
237+
- `run [options] <args...>`: Run Unity Editor command line arguments (passes args directly to the editor).
238+
- `--unity-editor <unityEditor>` The path to the Unity Editor executable. If unspecified, `--unity-project` or the `UNITY_EDITOR_PATH` environment variable must be set.
239+
- `--unity-project <unityProject>` The path to a Unity project. If unspecified, the `UNITY_PROJECT_PATH` environment variable will be used, otherwise no project will be specified.
240+
- `--log-name <logName>` The name of the log file.
241+
- `<args...>` Arguments to pass directly to the Unity Editor executable.
242+
- `--verbose` Enable verbose logging.
177243

178244
```bash
179245
unity-cli run --unity-project <path-to-project> -quit -batchmode -executeMethod StartCommandLineBuild
180246
```
181247

182-
#### Sign a Unity Package
248+
#### Unity Package Manager
249+
250+
##### Sign a Unity Package
251+
252+
> [!WARNING]
253+
> This command feature is in beta and may change in future releases.
254+
255+
- `sign-package [options]`: Sign a Unity package for distribution.
256+
- `--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.
257+
- `--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.
258+
- `--email <email>` Email associated with the Unity account. If unspecified, the `UNITY_USERNAME` environment variable will be used.
259+
- `--password <password>` The password of the Unity account. If unspecified, the `UNITY_PASSWORD` environment variable will be used.
260+
- `--organization <organization>` The Organization ID you copied from the Unity Cloud Dashboard. If unspecified, the `UNITY_ORGANIZATION_ID` environment variable will be used.
261+
- `--verbose` Enable verbose logging.
183262

184263
> [!NOTE]
185264
> 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.

0 commit comments

Comments
 (0)