@rage-against-the-pixel/unity-cli 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 RageAgainstThePixel
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,63 @@
1
+ # unity-cli
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,0 +1,7 @@
1
+ /**
2
+ * Checks if the required Android SDK is installed for the given Unity Editor and Project.
3
+ * @param editorPath The path to the Unity Editor executable.
4
+ * @param projectPath The path to the Unity project.
5
+ * @returns A promise that resolves when the check is complete.
6
+ */
7
+ export declare function CheckAndroidSdkInstalled(editorPath: string, projectPath: string): Promise<void>;
@@ -0,0 +1,144 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CheckAndroidSdkInstalled = CheckAndroidSdkInstalled;
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const os_1 = __importDefault(require("os"));
9
+ const path_1 = __importDefault(require("path"));
10
+ const child_process_1 = require("child_process");
11
+ const unity_editor_1 = require("./unity-editor");
12
+ const utilities_1 = require("./utilities");
13
+ const logging_1 = require("./logging");
14
+ const logger = logging_1.Logger.instance;
15
+ /**
16
+ * Checks if the required Android SDK is installed for the given Unity Editor and Project.
17
+ * @param editorPath The path to the Unity Editor executable.
18
+ * @param projectPath The path to the Unity project.
19
+ * @returns A promise that resolves when the check is complete.
20
+ */
21
+ async function CheckAndroidSdkInstalled(editorPath, projectPath) {
22
+ logger.ci(`Checking Android SDK installation for:\n > Editor: ${editorPath}\n > Project: ${projectPath}`);
23
+ let sdkPath = undefined;
24
+ await createRepositoryCfg();
25
+ const rootEditorPath = unity_editor_1.UnityEditor.GetEditorRootPath(editorPath);
26
+ const projectSettingsPath = path_1.default.join(projectPath, 'ProjectSettings/ProjectSettings.asset');
27
+ const projectSettingsContent = await (0, utilities_1.ReadFileContents)(projectSettingsPath);
28
+ const matchResult = projectSettingsContent.match(/(?<=AndroidTargetSdkVersion: )\d+/);
29
+ const androidTargetSdk = matchResult ? parseInt(matchResult[0]) : 0;
30
+ logger.ci(`AndroidTargetSdkVersion:\n > ${androidTargetSdk}`);
31
+ if (androidTargetSdk === undefined || androidTargetSdk === 0) {
32
+ return;
33
+ }
34
+ sdkPath = await getAndroidSdkPath(rootEditorPath, androidTargetSdk);
35
+ if (sdkPath) {
36
+ logger.ci(`Target Android SDK android-${androidTargetSdk} Installed in:\n > "${sdkPath}"`);
37
+ return;
38
+ }
39
+ logger.info(`Installing Android Target SDK:\n > android-${androidTargetSdk}`);
40
+ const sdkManagerPath = await getSdkManager(rootEditorPath);
41
+ const javaSdk = await getJDKPath(rootEditorPath);
42
+ await execSdkManager(sdkManagerPath, javaSdk, ['--licenses']);
43
+ await execSdkManager(sdkManagerPath, javaSdk, ['--update']);
44
+ await execSdkManager(sdkManagerPath, javaSdk, ['platform-tools', `platforms;android-${androidTargetSdk}`]);
45
+ sdkPath = await getAndroidSdkPath(rootEditorPath, androidTargetSdk);
46
+ if (!sdkPath) {
47
+ throw new Error(`Failed to install android-${androidTargetSdk} in ${rootEditorPath}`);
48
+ }
49
+ logger.ci(`Target Android SDK Installed in:\n > "${sdkPath}"`);
50
+ }
51
+ async function createRepositoryCfg() {
52
+ const androidPath = path_1.default.join(os_1.default.homedir(), '.android');
53
+ await fs_1.default.promises.mkdir(androidPath, { recursive: true });
54
+ const fileHandle = await fs_1.default.promises.open(path_1.default.join(androidPath, 'repositories.cfg'), 'w');
55
+ await fileHandle.close();
56
+ }
57
+ async function getJDKPath(rootEditorPath) {
58
+ const jdkPath = await (0, utilities_1.ResolveGlobToPath)([rootEditorPath, '**', 'AndroidPlayer', 'OpenJDK']);
59
+ if (!jdkPath) {
60
+ throw new Error(`Failed to resolve OpenJDK in ${rootEditorPath}`);
61
+ }
62
+ await fs_1.default.promises.access(jdkPath, fs_1.default.constants.R_OK);
63
+ logger.ci(`jdkPath:\n > "${jdkPath}"`);
64
+ return jdkPath;
65
+ }
66
+ async function getSdkManager(rootEditorPath) {
67
+ let globPath = [];
68
+ switch (process.platform) {
69
+ case 'darwin':
70
+ case 'linux':
71
+ globPath = [rootEditorPath, '**', 'AndroidPlayer', '**', 'sdkmanager'];
72
+ break;
73
+ case 'win32':
74
+ globPath = [rootEditorPath, '**', 'AndroidPlayer', '**', 'sdkmanager.bat'];
75
+ break;
76
+ default:
77
+ throw new Error(`Unsupported platform: ${process.platform}`);
78
+ }
79
+ const sdkmanagerPath = await (0, utilities_1.ResolveGlobToPath)(globPath);
80
+ if (!sdkmanagerPath) {
81
+ throw new Error(`Failed to resolve sdkmanager in ${globPath}`);
82
+ }
83
+ await fs_1.default.promises.access(sdkmanagerPath, fs_1.default.constants.R_OK);
84
+ logger.ci(`sdkmanagerPath:\n > "${sdkmanagerPath}"`);
85
+ return sdkmanagerPath;
86
+ }
87
+ async function getAndroidSdkPath(rootEditorPath, androidTargetSdk) {
88
+ logger.ci(`Attempting to locate Android SDK Path...\n > editorPath: ${rootEditorPath}\n > androidTargetSdk: ${androidTargetSdk}`);
89
+ const sdkPath = await (0, utilities_1.ResolveGlobToPath)([rootEditorPath, '**', 'PlaybackEngines', 'AndroidPlayer', 'SDK', 'platforms', `android-${androidTargetSdk}/`]);
90
+ try {
91
+ await fs_1.default.promises.access(sdkPath, fs_1.default.constants.R_OK);
92
+ }
93
+ catch (error) {
94
+ logger.debug(`android-${androidTargetSdk} not installed`);
95
+ return undefined;
96
+ }
97
+ logger.ci(`Android sdkPath:\n > "${sdkPath}"`);
98
+ return sdkPath;
99
+ }
100
+ async function execSdkManager(sdkManagerPath, javaPath, args) {
101
+ const acceptBuffer = Buffer.from(Array(10).fill('y').join('\n'), 'utf8');
102
+ let output = '';
103
+ let exitCode = 0;
104
+ logger.startGroup(`\x1b[34m${sdkManagerPath} ${args.join(' ')}\x1b[0m`);
105
+ if (sdkManagerPath.includes(path_1.default.sep)) {
106
+ fs_1.default.accessSync(sdkManagerPath, fs_1.default.constants.R_OK | fs_1.default.constants.X_OK);
107
+ }
108
+ try {
109
+ exitCode = await new Promise((resolve, reject) => {
110
+ const child = (0, child_process_1.spawn)(sdkManagerPath, args, {
111
+ stdio: ['pipe', 'pipe', 'pipe'],
112
+ env: { ...process.env, JAVA_HOME: javaPath }
113
+ });
114
+ process.once('SIGINT', () => child.kill('SIGINT'));
115
+ process.once('SIGTERM', () => child.kill('SIGTERM'));
116
+ child.stdout.on('data', (data) => {
117
+ const chunk = data.toString();
118
+ output += chunk;
119
+ if (output.includes('Accept? (y/N):')) {
120
+ child.stdin?.write(acceptBuffer);
121
+ output = '';
122
+ }
123
+ process.stdout.write(chunk);
124
+ });
125
+ child.stderr.on('data', (data) => {
126
+ const chunk = data.toString();
127
+ output += chunk;
128
+ process.stderr.write(chunk);
129
+ });
130
+ child.on('error', (error) => reject(error));
131
+ child.on('close', (code) => {
132
+ process.stdout.write('\n');
133
+ resolve(code === null ? 0 : code);
134
+ });
135
+ });
136
+ }
137
+ finally {
138
+ logger.endGroup();
139
+ if (exitCode !== 0) {
140
+ throw new Error(`${sdkManagerPath} ${args.join(' ')} failed with exit code ${exitCode}`);
141
+ }
142
+ }
143
+ }
144
+ //# sourceMappingURL=android-sdk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"android-sdk.js","sourceRoot":"","sources":["../src/android-sdk.ts"],"names":[],"mappings":";;;;;AAsBA,4DAkCC;AAxDD,4CAAoB;AACpB,4CAAoB;AACpB,gDAAwB;AACxB,iDAAsC;AACtC,iDAA6C;AAC7C,2CAGqB;AACrB,uCAGmB;AAEnB,MAAM,MAAM,GAAG,gBAAM,CAAC,QAAQ,CAAC;AAE/B;;;;;GAKG;AACI,KAAK,UAAU,wBAAwB,CAAC,UAAkB,EAAE,WAAmB;IAClF,MAAM,CAAC,EAAE,CAAC,uDAAuD,UAAU,kBAAkB,WAAW,EAAE,CAAC,CAAC;IAC5G,IAAI,OAAO,GAAG,SAAS,CAAC;IACxB,MAAM,mBAAmB,EAAE,CAAC;IAC5B,MAAM,cAAc,GAAG,0BAAW,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;IACjE,MAAM,mBAAmB,GAAG,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,uCAAuC,CAAC,CAAC;IAC5F,MAAM,sBAAsB,GAAG,MAAM,IAAA,4BAAgB,EAAC,mBAAmB,CAAC,CAAC;IAC3E,MAAM,WAAW,GAAG,sBAAsB,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;IACtF,MAAM,gBAAgB,GAAG,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CA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CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;oBACjC,MAAM,GAAG,EAAE,CAAC;gBAChB,CAAC;gBAED,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAChC,CAAC,CAAC,CAAC;YACH,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE;gBACrC,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAC9B,MAAM,IAAI,KAAK,CAAC;gBAChB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAChC,CAAC,CAAC,CAAC;YACH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAY,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YACnD,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAmB,EAAE,EAAE;gBACtC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBAC3B,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YACtC,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;YAAS,CAAC;QACP,MAAM,CAAC,QAAQ,EAAE,CAAC;QAElB,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,GAAG,cAAc,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,0BAA0B,QAAQ,EAAE,CAAC,CAAC;QAC7F,CAAC;IACL,CAAC;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import 'source-map-support/register';
package/dist/index.js ADDED
@@ -0,0 +1,298 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ require("source-map-support/register");
38
+ const os = __importStar(require("os"));
39
+ const commander_1 = require("commander");
40
+ const fs_1 = require("fs");
41
+ const path_1 = __importStar(require("path"));
42
+ const license_client_1 = require("./license-client");
43
+ const utilities_1 = require("./utilities");
44
+ const unity_hub_1 = require("./unity-hub");
45
+ const logging_1 = require("./logging");
46
+ const unity_version_1 = require("./unity-version");
47
+ const unity_project_1 = require("./unity-project");
48
+ const android_sdk_1 = require("./android-sdk");
49
+ const unity_editor_1 = require("./unity-editor");
50
+ const pkgPath = (0, path_1.join)(__dirname, '..', 'package.json');
51
+ const pkg = JSON.parse((0, fs_1.readFileSync)(pkgPath, 'utf-8'));
52
+ const program = new commander_1.Command();
53
+ program.name('unity-cli')
54
+ .description('A command line utility for the Unity Game Engine.')
55
+ .version(pkg.version);
56
+ program.command('license-version')
57
+ .description('Print the version of the Unity License Client.')
58
+ .action(async () => {
59
+ const client = new license_client_1.LicensingClient();
60
+ await client.Version();
61
+ });
62
+ program.command('activate-license')
63
+ .description('Activate a Unity license.')
64
+ .option('-e, --email <email>', 'Email associated with the Unity account. Required when activating a personal or professional license.')
65
+ .option('-p, --password <password>', 'Password for the Unity account. Required when activating a personal or professional license.')
66
+ .option('-s, --serial <serial>', 'License serial number. Required when activating a professional license.')
67
+ .option('-l, --license <license>', 'License type (personal, professional, floating).')
68
+ .option('-c, --config <config>', 'Path to the configuration file. Required when activating a floating license.')
69
+ .option('--verbose', 'Enable verbose logging.')
70
+ .action(async (options) => {
71
+ if (options.verbose) {
72
+ logging_1.Logger.instance.logLevel = logging_1.LogLevel.DEBUG;
73
+ }
74
+ logging_1.Logger.instance.debug(JSON.stringify(options));
75
+ const client = new license_client_1.LicensingClient();
76
+ const licenseStr = options.license?.toString()?.trim();
77
+ if (!licenseStr || licenseStr.length === 0) {
78
+ throw new Error('License type is required. Use -l or --license to specify it.');
79
+ }
80
+ const licenseType = options.license.toLowerCase();
81
+ if (![license_client_1.LicenseType.personal, license_client_1.LicenseType.professional, license_client_1.LicenseType.floating].includes(licenseType)) {
82
+ throw new Error(`Invalid license type: ${licenseType}`);
83
+ }
84
+ if (licenseType !== license_client_1.LicenseType.floating) {
85
+ if (!options.email) {
86
+ options.email = await (0, utilities_1.PromptForSecretInput)('Email: ');
87
+ }
88
+ if (!options.password) {
89
+ options.password = await (0, utilities_1.PromptForSecretInput)('Password: ');
90
+ }
91
+ if (licenseType === license_client_1.LicenseType.professional && !options.serial) {
92
+ options.serial = await (0, utilities_1.PromptForSecretInput)('Serial: ');
93
+ }
94
+ }
95
+ await client.Activate(licenseType, options.config, options.serial, options.email, options.password);
96
+ });
97
+ program.command('return-license')
98
+ .description('Return a Unity license.')
99
+ .option('-l, --license <license>', 'License type (personal, professional, floating)')
100
+ .option('--verbose', 'Enable verbose logging.')
101
+ .action(async (options) => {
102
+ if (options.verbose) {
103
+ logging_1.Logger.instance.logLevel = logging_1.LogLevel.DEBUG;
104
+ }
105
+ logging_1.Logger.instance.debug(JSON.stringify(options));
106
+ const client = new license_client_1.LicensingClient();
107
+ const licenseStr = options.license?.toString()?.trim();
108
+ if (!licenseStr || licenseStr.length === 0) {
109
+ throw new Error('License type is required. Use -l or --license to specify it.');
110
+ }
111
+ const licenseType = licenseStr.toLowerCase();
112
+ if (![license_client_1.LicenseType.personal, license_client_1.LicenseType.professional, license_client_1.LicenseType.floating].includes(licenseType)) {
113
+ throw new Error(`Invalid license type: ${licenseType}`);
114
+ }
115
+ await client.Deactivate(licenseType);
116
+ });
117
+ program.command('hub-version')
118
+ .description('Print the version of the Unity Hub.')
119
+ .action(async () => {
120
+ const unityHub = new unity_hub_1.UnityHub();
121
+ const version = await unityHub.Version();
122
+ process.stdout.write(`${version}\n`);
123
+ });
124
+ program.command('hub-install')
125
+ .description('Install the Unity Hub.')
126
+ .option('--verbose', 'Enable verbose logging.')
127
+ .option('--json', 'Prints the last line of output as JSON string.')
128
+ .action(async (options) => {
129
+ if (options.verbose) {
130
+ logging_1.Logger.instance.logLevel = logging_1.LogLevel.DEBUG;
131
+ }
132
+ const unityHub = new unity_hub_1.UnityHub();
133
+ const hubPath = await unityHub.Install();
134
+ if (options.json) {
135
+ process.stdout.write(`\n${JSON.stringify({ UNITY_HUB_PATH: hubPath })}\n`);
136
+ }
137
+ else {
138
+ process.stdout.write(`${hubPath}\n`);
139
+ }
140
+ });
141
+ program.command('hub-path')
142
+ .description('Print the path to the Unity Hub executable.')
143
+ .option('--json', 'Prints the last line of output as JSON string.')
144
+ .action(async (options) => {
145
+ const hub = new unity_hub_1.UnityHub();
146
+ if (options.json) {
147
+ process.stdout.write(`\n${JSON.stringify({ UNITY_HUB_PATH: hub.executable })}\n`);
148
+ }
149
+ else {
150
+ process.stdout.write(`${hub.executable}\n`);
151
+ }
152
+ });
153
+ program.command('hub')
154
+ .description('Run commands directly to the Unity Hub. (You need not to pass --headless or -- to this command).')
155
+ .allowUnknownOption(true)
156
+ .argument('<args...>', 'Arguments to pass to the Unity Hub executable.')
157
+ .option('--verbose', 'Enable verbose logging.')
158
+ .action(async (args, options) => {
159
+ if (options.verbose) {
160
+ logging_1.Logger.instance.logLevel = logging_1.LogLevel.DEBUG;
161
+ }
162
+ logging_1.Logger.instance.debug(JSON.stringify({ args, options }));
163
+ const unityHub = new unity_hub_1.UnityHub();
164
+ await unityHub.Exec(args, { silent: false, showCommand: logging_1.Logger.instance.logLevel === logging_1.LogLevel.DEBUG });
165
+ });
166
+ program.command('setup-unity')
167
+ .description('Sets up the environment for the specified project and finds or installs the Unity Editor version for it.')
168
+ .option('-p, --unity-project <unityProjectPath>', 'The path to a Unity project or "none" to skip project detection.')
169
+ .option('-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.')
170
+ .option('-c, --changeset <changeset>', 'The Unity changeset to get (e.g. 1234567890ab).')
171
+ .option('-a, --arch <architecture>', 'The Unity architecture to get (e.g. x86_64, arm64). Defaults to the architecture of the current process.')
172
+ .option('-b, --build-targets <buildTargets>', 'The Unity build target to get (e.g. iOS, Android).')
173
+ .option('-m, --modules <modules>', 'The Unity module to get (e.g. ios, android).')
174
+ .option('-i, --install-path <installPath>', 'The path to install the Unity Editor to. By default, it will be installed to the default Unity Hub location.')
175
+ .option('--verbose', 'Enable verbose logging.')
176
+ .option('--json', 'Prints the last line of output as JSON string.')
177
+ .action(async (options) => {
178
+ if (options.verbose) {
179
+ logging_1.Logger.instance.logLevel = logging_1.LogLevel.DEBUG;
180
+ }
181
+ logging_1.Logger.instance.debug(JSON.stringify(options));
182
+ let unityProject;
183
+ if (options.unityProject) {
184
+ unityProject = await unity_project_1.UnityProject.GetProject(options.unityProject);
185
+ }
186
+ if (!options.unityVersion && !unityProject) {
187
+ throw new Error('You must specify a Unity version or project with -u, --unity-version, -p, --unity-project.');
188
+ }
189
+ const unityVersion = unityProject?.version ?? new unity_version_1.UnityVersion(options.unityVersion, options.changeset);
190
+ const modules = options.modules ? options.modules.split(/[ ,]+/).filter(Boolean) : [];
191
+ const buildTargets = options.buildTargets ? options.buildTargets.split(/[ ,]+/).filter(Boolean) : [];
192
+ const moduleBuildTargetMap = unity_hub_1.UnityHub.GetPlatformTargetModuleMap();
193
+ for (const target of buildTargets) {
194
+ const module = moduleBuildTargetMap[target];
195
+ if (module === undefined) {
196
+ if (target.toLowerCase() !== 'none') {
197
+ logging_1.Logger.instance.warn(`${target} is not a valid build target for ${os.type()}`);
198
+ }
199
+ continue;
200
+ }
201
+ if (!modules.includes(module)) {
202
+ modules.push(module);
203
+ }
204
+ }
205
+ if (modules.includes('none') ||
206
+ modules.includes('None')) {
207
+ modules.length = 0;
208
+ }
209
+ const unityHub = new unity_hub_1.UnityHub();
210
+ const editorPath = await unityHub.GetEditor(unityVersion, modules);
211
+ const output = {
212
+ 'UNITY_HUB_PATH': unityHub.executable,
213
+ 'UNITY_EDITOR': editorPath
214
+ };
215
+ if (unityProject) {
216
+ output['UNITY_PROJECT_PATH'] = unityProject.projectPath;
217
+ if (modules.includes('android')) {
218
+ await (0, android_sdk_1.CheckAndroidSdkInstalled)(editorPath, unityProject.projectPath);
219
+ }
220
+ }
221
+ if (options.json) {
222
+ process.stdout.write(`\n${JSON.stringify(output)}\n`);
223
+ }
224
+ });
225
+ program.command('create-project')
226
+ .description('Create a new Unity project.')
227
+ .option('--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.')
228
+ .option('--path <projectPath>', 'The path to create the new Unity project. If unspecified, the current working directory will be used.')
229
+ .option('--template <projectTemplate>', 'The name of the template package to use for creating the unity project. Supports regex patterns.', 'com.unity.template.3d(-cross-platform)?')
230
+ .option('--unity-editor <unityEditorPath>', 'The path to the Unity Editor executable. If unspecified, the UNITY_EDITOR environment variable must be set.')
231
+ .option('--verbose', 'Enable verbose logging.')
232
+ .option('--json', 'Prints the last line of output as JSON string.')
233
+ .action(async (options) => {
234
+ if (options.verbose) {
235
+ logging_1.Logger.instance.logLevel = logging_1.LogLevel.DEBUG;
236
+ }
237
+ logging_1.Logger.instance.debug(JSON.stringify(options));
238
+ const editorPath = options.unityEditor?.toString()?.trim() || process.env.UNITY_EDITOR;
239
+ if (!editorPath || editorPath.length === 0) {
240
+ throw new Error('The Unity Editor path was not specified. Use -e or --unity-editor to specify it, or set the UNITY_EDITOR environment variable.');
241
+ }
242
+ const unityEditor = new unity_editor_1.UnityEditor(editorPath);
243
+ if (!options.template || options.template.length === 0) {
244
+ throw new Error('The project template name was not specified. Use -t or --template to specify it.');
245
+ }
246
+ const templatePath = unityEditor.GetTemplatePath(options.template);
247
+ const projectName = options.name?.toString()?.trim();
248
+ let projectPath = options.path?.toString()?.trim() || process.cwd();
249
+ if (projectName && projectName.length > 0) {
250
+ projectPath = path_1.default.join(projectPath, projectName);
251
+ }
252
+ await unityEditor.Run({
253
+ projectPath: projectPath,
254
+ args: [
255
+ '-quit',
256
+ '-nographics',
257
+ '-batchmode',
258
+ '-createProject', projectPath,
259
+ '-cloneFromTemplate', templatePath
260
+ ]
261
+ });
262
+ if (options.json) {
263
+ process.stdout.write(`\n${JSON.stringify({ UNITY_PROJECT_PATH: projectPath })}\n`);
264
+ }
265
+ });
266
+ program.command('run')
267
+ .description('Run command line args directly to the Unity Editor.')
268
+ .option('--unity-editor <unityEditorPath>', 'The path to the Unity Editor executable. If unspecified, the UNITY_EDITOR environment variable must be set.')
269
+ .option('--unity-project <unityProjectPath>', 'The path to a Unity project. If unspecified, the UNITY_PROJECT_PATH environment variable or the current working directory will be used.')
270
+ .option('--log-name <logName>', 'The name of the log file.')
271
+ .allowUnknownOption(true)
272
+ .argument('<args...>', 'Arguments to pass to the Unity Editor executable.')
273
+ .option('--verbose', 'Enable verbose logging.')
274
+ .action(async (args, options) => {
275
+ if (options.verbose) {
276
+ logging_1.Logger.instance.logLevel = logging_1.LogLevel.DEBUG;
277
+ }
278
+ logging_1.Logger.instance.debug(JSON.stringify({ options, args }));
279
+ const editorPath = options.unityEditor?.toString()?.trim() || process.env.UNITY_EDITOR;
280
+ if (!editorPath || editorPath.length === 0) {
281
+ throw new Error('The Unity Editor path was not specified. Use -e or --unity-editor to specify it, or set the UNITY_EDITOR environment variable.');
282
+ }
283
+ const unityEditor = new unity_editor_1.UnityEditor(editorPath);
284
+ const projectPath = options.unityProject?.toString()?.trim() || process.env.UNITY_PROJECT_PATH || process.cwd();
285
+ const unityProject = await unity_project_1.UnityProject.GetProject(projectPath);
286
+ if (!unityProject) {
287
+ throw new Error(`The specified path is not a valid Unity project: ${projectPath}`);
288
+ }
289
+ if (!args.includes('-logFile')) {
290
+ const logPath = unityEditor.GenerateLogFilePath(unityProject.projectPath, options.logName);
291
+ args.push('-logFile', logPath);
292
+ }
293
+ await unityEditor.Run({
294
+ args: [...args]
295
+ });
296
+ });
297
+ program.parse(process.argv);
298
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,uCAAqC;AACrC,uCAAyB;AACzB,yCAAoC;AACpC,2BAAkC;AAClC,6CAAkC;AAClC,qDAAgE;AAChE,2CAAmD;AACnD,2CAAuC;AACvC,uCAA6C;AAC7C,mDAA+C;AAC/C,mDAA+C;AAC/C,+CAAyD;AACzD,iDAA6C;AAE7C,MAAM,OAAO,GAAG,IAAA,WAAI,EAAC,SAAS,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;AACtD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAA,iBAAY,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;AACvD,MAAM,OAAO,GAAG,IAA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
4
+ floating = "floating"
5
+ }
6
+ export declare class LicensingClient {
7
+ private unityHub;
8
+ private licenseClientPath;
9
+ private licenseVersion;
10
+ private logger;
11
+ constructor(licenseVersion?: string | undefined);
12
+ init(): Promise<string>;
13
+ private getUnityCommonDir;
14
+ private getExitCodeMessage;
15
+ private patchBinary;
16
+ private patchLicenseVersion;
17
+ private exec;
18
+ private maskSerialInOutput;
19
+ Version(): Promise<void>;
20
+ Activate(licenseType: LicenseType, servicesConfig?: string | undefined, serial?: string | undefined, username?: string | undefined, password?: string | undefined): Promise<void>;
21
+ Deactivate(licenseType: LicenseType): Promise<void>;
22
+ private showEntitlements;
23
+ private activateLicense;
24
+ private returnLicense;
25
+ }