Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
33c2ccf
unity-cli@v1.2.1
StephenHodgson Oct 6, 2025
4086db1
test all the things
StephenHodgson Oct 6, 2025
ab8fc54
revert build options
StephenHodgson Oct 6, 2025
499166d
rework all of the cli arg documentation
StephenHodgson Oct 6, 2025
c8bfd19
test 4.7.2, 2020.x
StephenHodgson Oct 6, 2025
3b7272e
update build-options
StephenHodgson Oct 6, 2025
c5d4f6c
add uninstall option
StephenHodgson Oct 6, 2025
95225ab
clean up some cli args and options
StephenHodgson Oct 6, 2025
bbf0e86
UNITY_EDITOR_PATH
StephenHodgson Oct 6, 2025
f7eb953
add uninstall-unity command line option
StephenHodgson Oct 6, 2025
81f8c29
rework uninstaller
StephenHodgson Oct 6, 2025
731aad3
update readme
StephenHodgson Oct 6, 2025
e6929f1
skip template args if legacy when creating a new project
StephenHodgson Oct 6, 2025
cdc3c37
update template list and uninstall
StephenHodgson Oct 6, 2025
9f25a60
update license client patcher
StephenHodgson Oct 6, 2025
37bfa64
update validation workflow
StephenHodgson Oct 6, 2025
5471347
refactor dir deletes
StephenHodgson Oct 6, 2025
8334efb
fix name
StephenHodgson Oct 6, 2025
f26c831
update workflow
StephenHodgson Oct 6, 2025
e325cd4
revert
StephenHodgson Oct 6, 2025
c115d3b
cleanup
StephenHodgson Oct 6, 2025
489895b
allow unknown
StephenHodgson Oct 7, 2025
de402c8
update hub uninstaller for windows
StephenHodgson Oct 7, 2025
52de3c6
guard legacy for monodevelop dir cleanup
StephenHodgson Oct 7, 2025
50a729a
rework versioning
StephenHodgson Oct 7, 2025
2282ddf
remove 2020.x
StephenHodgson Oct 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .github/workflows/build-options.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"macos-latest"
],
"unity-version": [
"2022.3.x",
"4.7.2",
"2021.x",
"2022.x",
"6000.0.x",
"6000.1.x",
"6000.2.x"
Expand All @@ -23,5 +25,15 @@
"os": "macos-latest",
"build-target": "StandaloneOSX"
}
],
"exclude": [
{
"os": "ubuntu-latest",
"unity-version": "4.7.2"
},
{
"os": "macos-latest",
"unity-version": "4.7.2"
}
]
}
23 changes: 19 additions & 4 deletions .github/workflows/unity-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
permissions:
contents: read
timeout-minutes: 30
env:
UNITY_PROJECT_PATH: '' # Set from create-project step
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -38,7 +40,6 @@ jobs:
shell: bash
run: |
unity-cli hub-install --auto-update
unity-cli activate-license --license personal --email "${{ secrets.UNITY_USERNAME }}" --password "${{ secrets.UNITY_PASSWORD }}"
unity-cli setup-unity --unity-version "${{ matrix.unity-version }}" --build-targets "${{ matrix.build-target }}" --json
- name: verify UNITY_HUB_PATH and UNITY_EDITOR_PATH variables
shell: bash
Expand All @@ -56,6 +57,10 @@ jobs:
echo "Error: UNITY_EDITOR_PATH is not set"
exit 1
fi
- name: activate license
shell: bash
run: |
unity-cli activate-license --license personal --email "${{ secrets.UNITY_USERNAME }}" --password "${{ secrets.UNITY_PASSWORD }}"
- name: create unity project
shell: bash
run: |
Expand All @@ -70,16 +75,26 @@ jobs:
fi
- name: Install OpenUPM and build pipeline package
shell: bash
if: ${{ matrix.unity-version != '4.7.2' && matrix.unity-version != '5.6.7' }}
run: |
npm install -g openupm-cli
cd "${UNITY_PROJECT_PATH}"
openupm add com.utilities.buildpipeline
- name: Build project
if: ${{ matrix.unity-version != '4.7.2' && matrix.unity-version != '5.6.7' }}
shell: bash
run: |
unity-cli run --unity-editor "${UNITY_EDITOR_PATH}" --unity-project "${UNITY_PROJECT_PATH}" --log-name Validate -quit -nographics -batchmode -executeMethod Utilities.Editor.BuildPipeline.UnityPlayerBuildTools.ValidateProject -importTMProEssentialsAsset
unity-cli run --unity-editor "${UNITY_EDITOR_PATH}" --unity-project "${UNITY_PROJECT_PATH}" --log-name Build -quit -nographics -batchmode -executeMethod Utilities.Editor.BuildPipeline.UnityPlayerBuildTools.StartCommandLineBuild -sceneList Assets/Scenes/SampleScene.unity
- name: Post Run
unity-cli run --log-name Validate -quit -nographics -batchmode -executeMethod Utilities.Editor.BuildPipeline.UnityPlayerBuildTools.ValidateProject -importTMProEssentialsAsset
unity-cli run --log-name Build -quit -nographics -batchmode -executeMethod Utilities.Editor.BuildPipeline.UnityPlayerBuildTools.StartCommandLineBuild -sceneList Assets/Scenes/SampleScene.unity
- name: Uninstall editor
shell: bash
run: |
if [ -z "${UNITY_EDITOR_PATH}" ]; then
echo "UNITY_EDITOR_PATH is not set, skipping uninstall"
exit 0
fi
unity-cli uninstall-unity --unity-editor "${UNITY_EDITOR_PATH}"
- name: Return license
if: always()
shell: bash
run: |
Expand Down
39 changes: 30 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,29 @@ unity-cli [command] [options]

### Common Commands

- `unity-cli hub-install`: Install Unity Hub
- `unity-cli hub-version`: Print Unity Hub version
- `unity-cli hub-path`: Print Unity Hub executable path
- `unity-cli hub [options] <args...>`: Run [Unity Hub command line arguments](https://docs.unity3d.com/hub/manual/HubCLI.html)
#### Auth

- `unity-cli license-version`: Print the Unity License Client version
- `unity-cli activate-license [options]`: Activate a Unity license
- `unity-cli return-license [options]`: Return a Unity license
- `unity-cli license-version`: Print Unity License Client version
- `unity-cli setup-unity [options]`: Find or install Unity Editor for a project/version
- `unity-cli create-project [options]`: Create a new Unity project from a [template](https://docs.unity3d.com/hub/manual/Templates.html)
- `unity-cli run [options] <args...>`: Run [Unity Editor Command Line Arguments](https://docs.unity3d.com/Manual/EditorCommandLineArguments.html)

#### Unity Hub

- `unity-cli hub-version`: Print the Unity Hub version
- `unity-cli hub-install [options]`: Install or update the Unity Hub
- `unity-cli hub-path`: Print the Unity Hub executable path
- `unity-cli hub [options] <args...>`: Run Unity Hub command line arguments (passes args directly to the hub executable)

#### Unity Editor

- `unity-cli setup-unity [options]`: Find or install the Unity Editor for a project or specific version
- `unity-cli uninstall-unity [options]`: Uninstall a Unity Editor version
- `unity-cli list-project-templates [options]`: List available Unity project templates for an editor
- `unity-cli create-project [options]`: Create a new Unity project from a template
- `unity-cli open-project [options]`: Open a Unity project in the Unity Editor
- `unity-cli run [options] <args...>`: Run Unity Editor command line arguments (passes args directly to the editor)

Run `unity-cli --help` for a full list of commands and options.

#### Install Unity Hub and Editor

Expand All @@ -60,8 +73,16 @@ unity-cli activate-license --email <your-email> --password <your-password> --ser
unity-cli create-project --name "MyGame" --template com.unity.template.3d(-cross-platform)? --unity-editor <path-to-editor>
```

#### Open a project from the command line

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

```bash
unity-cli open-project
```

#### Build a Project

```bash
unity-cli run --unity-editor <path-to-editor> --unity-project <path-to-project> -quit -batchmode -executeMethod StartCommandLineBuild
unity-cli run --unity-project <path-to-project> -quit -batchmode -executeMethod StartCommandLineBuild
```
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rage-against-the-pixel/unity-cli",
"version": "1.2.0",
"version": "1.2.1",
"description": "A command line utility for the Unity Game Engine.",
"author": "RageAgainstThePixel",
"license": "MIT",
Expand Down
Loading
Loading