uloop-cli 1.6.1 → 1.6.3

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/README.md CHANGED
@@ -70,25 +70,18 @@ Custom skills defined in your project are also automatically detected.
70
70
 
71
71
  You can also call the CLI directly without using Skills.
72
72
 
73
- ### Project Path / Port Specification
73
+ ### Project Path Specification
74
74
 
75
- If `--project-path` / `--port` is omitted, the port is automatically selected from the Unity project detected in the current directory.
75
+ If `--project-path` is omitted, the port is automatically selected from the Unity project detected in the current directory.
76
76
 
77
- To operate multiple Unity instances from a single LLM tool, explicitly specify a project path or port:
77
+ To operate multiple Unity instances from a single LLM tool, explicitly specify a project path:
78
78
 
79
79
  ```bash
80
80
  # Specify by project path (absolute or relative)
81
81
  uloop compile --project-path /Users/foo/my-unity-project
82
82
  uloop compile --project-path ../other-project
83
-
84
- # Specify by port number
85
- uloop compile --port {target-port}
86
83
  ```
87
84
 
88
- > [!NOTE]
89
- > - `--project-path` and `--port` cannot be used together.
90
- > - You can find the port number in each Unity's uLoopMCP Window.
91
-
92
85
  ### Chaining Commands
93
86
 
94
87
  Chain commands with `&&` to automate a sequence of operations:
package/README_ja.md CHANGED
@@ -70,25 +70,18 @@ Skills はUnityプロジェクト内の uLoopMCP パッケージから動的に
70
70
 
71
71
  Skills を使わずに、CLI を直接呼び出すこともできます。
72
72
 
73
- ### プロジェクトパス指定 / ポート指定
73
+ ### プロジェクトパス指定
74
74
 
75
- `--project-path` / `--port` を省略した場合は、カレントディレクトリの Unity プロジェクトで設定されたポートが自動選択されます。
75
+ `--project-path` を省略した場合は、カレントディレクトリの Unity プロジェクトで設定されたポートが自動選択されます。
76
76
 
77
- 一つのLLMツールから複数のUnityインスタンスを操作したい場合、プロジェクトパスまたはポートを明示的に指定します:
77
+ 一つのLLMツールから複数のUnityインスタンスを操作したい場合、プロジェクトパスを明示的に指定します:
78
78
 
79
79
  ```bash
80
80
  # プロジェクトパスで指定(絶対パス・相対パスどちらも可)
81
81
  uloop compile --project-path /Users/foo/my-unity-project
82
82
  uloop compile --project-path ../other-project
83
-
84
- # ポート番号で指定
85
- uloop compile --port {target-port}
86
83
  ```
87
84
 
88
- > [!NOTE]
89
- > - `--project-path` と `--port` は同時に指定できません。
90
- > - ポート番号は各Unityの uLoopMCP Window で確認できます。
91
-
92
85
  ### コマンドの連携
93
86
 
94
87
  `&&` でコマンドを連結することで、一連の操作を自動化できます:
@@ -795,7 +795,7 @@ ${itemIndentStr}`);
795
795
  var require_option = __commonJS({
796
796
  "node_modules/commander/lib/option.js"(exports2) {
797
797
  var { InvalidArgumentError: InvalidArgumentError2 } = require_error();
798
- var Option3 = class {
798
+ var Option2 = class {
799
799
  /**
800
800
  * Initialize a new `Option` with the given `flags` and `description`.
801
801
  *
@@ -1099,7 +1099,7 @@ var require_option = __commonJS({
1099
1099
  );
1100
1100
  return { shortFlag, longFlag };
1101
1101
  }
1102
- exports2.Option = Option3;
1102
+ exports2.Option = Option2;
1103
1103
  exports2.DualOptions = DualOptions;
1104
1104
  }
1105
1105
  });
@@ -1195,7 +1195,7 @@ var require_command = __commonJS({
1195
1195
  var { Argument: Argument2, humanReadableArgName } = require_argument();
1196
1196
  var { CommanderError: CommanderError2 } = require_error();
1197
1197
  var { Help: Help2, stripColor } = require_help();
1198
- var { Option: Option3, DualOptions } = require_option();
1198
+ var { Option: Option2, DualOptions } = require_option();
1199
1199
  var { suggestSimilar } = require_suggestSimilar();
1200
1200
  var Command2 = class _Command extends EventEmitter {
1201
1201
  /**
@@ -1680,7 +1680,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1680
1680
  * @return {Option} new option
1681
1681
  */
1682
1682
  createOption(flags, description) {
1683
- return new Option3(flags, description);
1683
+ return new Option2(flags, description);
1684
1684
  }
1685
1685
  /**
1686
1686
  * Wrap parseArgs to catch 'commander.invalidArgument'.
@@ -1805,7 +1805,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1805
1805
  * @private
1806
1806
  */
1807
1807
  _optionEx(config, flags, description, fn, defaultValue) {
1808
- if (typeof flags === "object" && flags instanceof Option3) {
1808
+ if (typeof flags === "object" && flags instanceof Option2) {
1809
1809
  throw new Error(
1810
1810
  "To add an Option object use addOption() instead of option() or requiredOption()"
1811
1811
  );
@@ -3437,13 +3437,13 @@ var require_commander = __commonJS({
3437
3437
  var { Command: Command2 } = require_command();
3438
3438
  var { CommanderError: CommanderError2, InvalidArgumentError: InvalidArgumentError2 } = require_error();
3439
3439
  var { Help: Help2 } = require_help();
3440
- var { Option: Option3 } = require_option();
3440
+ var { Option: Option2 } = require_option();
3441
3441
  exports2.program = new Command2();
3442
3442
  exports2.createCommand = (name) => new Command2(name);
3443
- exports2.createOption = (flags, description) => new Option3(flags, description);
3443
+ exports2.createOption = (flags, description) => new Option2(flags, description);
3444
3444
  exports2.createArgument = (name, description) => new Argument2(name, description);
3445
3445
  exports2.Command = Command2;
3446
- exports2.Option = Option3;
3446
+ exports2.Option = Option2;
3447
3447
  exports2.Argument = Argument2;
3448
3448
  exports2.Help = Help2;
3449
3449
  exports2.CommanderError = CommanderError2;
@@ -5382,6 +5382,10 @@ var require_semver2 = __commonJS({
5382
5382
  }
5383
5383
  });
5384
5384
 
5385
+ // src/cli-constants.ts
5386
+ var PRODUCT_DISPLAY_NAME = "Unity CLI Loop";
5387
+ var MENU_PATH_SERVER = "Window > Unity CLI Loop > Server";
5388
+
5385
5389
  // src/cli.ts
5386
5390
  var import_fs8 = require("fs");
5387
5391
  var import_path10 = require("path");
@@ -5773,7 +5777,7 @@ function validateProjectPath(projectPath) {
5773
5777
  }
5774
5778
  if (!hasUloopInstalled(resolved)) {
5775
5779
  throw new Error(
5776
- `uLoopMCP is not installed in this project (UserSettings/UnityMcpSettings.json not found): ${resolved}`
5780
+ `${PRODUCT_DISPLAY_NAME} is not installed in this project (UserSettings/UnityMcpSettings.json not found): ${resolved}`
5777
5781
  );
5778
5782
  }
5779
5783
  return resolved;
@@ -5791,9 +5795,7 @@ async function resolveUnityPort(explicitPort, projectPath) {
5791
5795
  }
5792
5796
  const projectRoot = findUnityProjectRoot();
5793
5797
  if (projectRoot === null) {
5794
- throw new Error(
5795
- "Unity project not found. Use --port or --project-path option to specify the target."
5796
- );
5798
+ throw new Error("Unity project not found. Use --project-path option to specify the target.");
5797
5799
  }
5798
5800
  return await readPortFromSettingsOrThrow(projectRoot);
5799
5801
  }
@@ -5804,7 +5806,7 @@ function createSettingsReadError(projectRoot) {
5804
5806
 
5805
5807
  Settings file: ${settingsPath}
5806
5808
 
5807
- Run 'uloop launch -r' to restart Unity, or use --port to specify the port directly.`
5809
+ Run 'uloop launch -r' to restart Unity.`
5808
5810
  );
5809
5811
  }
5810
5812
  async function readPortFromSettingsOrThrow(projectRoot) {
@@ -5862,7 +5864,7 @@ async function validateConnectedProject(client, expectedProjectRoot) {
5862
5864
  } catch (error) {
5863
5865
  if (error instanceof Error && (error.message.includes(`${JSON_RPC_METHOD_NOT_FOUND}`) || /method not found/i.test(error.message) || /unknown tool/i.test(error.message))) {
5864
5866
  console.error(
5865
- "Warning: Could not verify project identity (get-version not available). Consider updating uLoopMCP package."
5867
+ `Warning: Could not verify project identity (get-version not available). Consider updating ${PRODUCT_DISPLAY_NAME} package.`
5866
5868
  );
5867
5869
  return;
5868
5870
  }
@@ -5886,7 +5888,7 @@ var import_path4 = require("path");
5886
5888
 
5887
5889
  // src/default-tools.json
5888
5890
  var default_tools_default = {
5889
- version: "1.6.1",
5891
+ version: "1.6.3",
5890
5892
  tools: [
5891
5893
  {
5892
5894
  name: "compile",
@@ -6519,7 +6521,7 @@ function getCachedServerVersion() {
6519
6521
  }
6520
6522
 
6521
6523
  // src/version.ts
6522
- var VERSION = "1.6.1";
6524
+ var VERSION = "1.6.3";
6523
6525
 
6524
6526
  // src/spinner.ts
6525
6527
  var SPINNER_FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
@@ -6821,7 +6823,7 @@ function isVersionOlder(v1, v2) {
6821
6823
  }
6822
6824
  function printVersionWarning(cliVersion, serverVersion) {
6823
6825
  const isCliOlder = isVersionOlder(cliVersion, serverVersion);
6824
- const updateCommand = isCliOlder ? `npm install -g uloop-cli@${serverVersion}` : `Update uLoopMCP package to ${cliVersion} via Unity Package Manager`;
6826
+ const updateCommand = isCliOlder ? `npm install -g uloop-cli@${serverVersion}` : `Update ${PRODUCT_DISPLAY_NAME} package to ${cliVersion} via Unity Package Manager`;
6825
6827
  console.error("\x1B[33m\u26A0\uFE0F Version mismatch detected!\x1B[0m");
6826
6828
  console.error(` uloop-cli version: ${cliVersion}`);
6827
6829
  console.error(` uloop server version: ${serverVersion}`);
@@ -7236,8 +7238,8 @@ function getProjectSkillsDir(target) {
7236
7238
  }
7237
7239
  if (!status.hasUloop) {
7238
7240
  throw new Error(
7239
- `uLoopMCP is not installed in this Unity project (${status.path}).
7240
- Please install uLoopMCP package first, then run this command again.`
7241
+ `${PRODUCT_DISPLAY_NAME} is not installed in this Unity project (${status.path}).
7242
+ Please install ${PRODUCT_DISPLAY_NAME} package first, then run this command again.`
7241
7243
  );
7242
7244
  }
7243
7245
  return (0, import_path8.join)(status.path, target.projectDir, "skills");
@@ -9065,10 +9067,10 @@ program2.option("--list-commands", "List all command names (for shell completion
9065
9067
  program2.option("--list-options <cmd>", "List options for a command (for shell completion)");
9066
9068
  program2.commandsGroup(HELP_GROUP_CLI_COMMANDS);
9067
9069
  program2.helpCommand(true);
9068
- program2.command("list").description("List all available tools from Unity").option("-p, --port <port>", "Unity TCP port").option("--project-path <path>", "Unity project path").action(async (options) => {
9070
+ program2.command("list").description("List all available tools from Unity").addOption(createHiddenPortOption()).option("--project-path <path>", "Unity project path").action(async (options) => {
9069
9071
  await runWithErrorHandling(() => listAvailableTools(extractGlobalOptions(options)));
9070
9072
  });
9071
- program2.command("sync").description("Sync tool definitions from Unity to local cache").option("-p, --port <port>", "Unity TCP port").option("--project-path <path>", "Unity project path").action(async (options) => {
9073
+ program2.command("sync").description("Sync tool definitions from Unity to local cache").addOption(createHiddenPortOption()).option("--project-path <path>", "Unity project path").action(async (options) => {
9072
9074
  await runWithErrorHandling(() => syncTools(extractGlobalOptions(options)));
9073
9075
  });
9074
9076
  program2.command("completion").description("Setup shell completion").option("--install", "Install completion to shell config file").option("--shell <type>", "Shell type: bash, zsh, or powershell").action((options) => {
@@ -9103,7 +9105,7 @@ function registerToolCommand(tool, helpGroup) {
9103
9105
  cmd.option(optionStr, description);
9104
9106
  }
9105
9107
  }
9106
- cmd.option("-p, --port <port>", "Unity TCP port");
9108
+ cmd.addOption(createHiddenPortOption());
9107
9109
  cmd.option("--project-path <path>", "Unity project path");
9108
9110
  cmd.action(async (options) => {
9109
9111
  const params = buildParams(options, properties);
@@ -9212,6 +9214,9 @@ function convertValue(value, propInfo) {
9212
9214
  function getToolHelpGroup(toolName, defaultToolNames) {
9213
9215
  return defaultToolNames.has(toolName) ? HELP_GROUP_BUILTIN_TOOLS : HELP_GROUP_THIRD_PARTY_TOOLS;
9214
9216
  }
9217
+ function createHiddenPortOption() {
9218
+ return new Option("-p, --port <port>", "Unity TCP port").hideHelp();
9219
+ }
9215
9220
  function extractGlobalOptions(options) {
9216
9221
  return {
9217
9222
  port: options["port"],
@@ -9227,7 +9232,8 @@ function printToolDisabledError(cmdName) {
9227
9232
  }
9228
9233
  function printConnectionError() {
9229
9234
  console.error("\x1B[31mError: Cannot connect to Unity.\x1B[0m");
9230
- console.error("Make sure Unity Editor is open and uLoopMCP server is running.");
9235
+ console.error(`Make sure Unity Editor is open and ${PRODUCT_DISPLAY_NAME} server is running.`);
9236
+ console.error(`You can start the server from: ${MENU_PATH_SERVER}`);
9231
9237
  console.error("");
9232
9238
  console.error("[For AI] Please report the above to the user.");
9233
9239
  }
@@ -9275,7 +9281,7 @@ async function runWithErrorHandling(fn) {
9275
9281
  console.error("");
9276
9282
  console.error("Another Unity instance was found, but it belongs to a different project.");
9277
9283
  console.error(
9278
- "Start the Unity Editor for this project, or use --port to specify the target."
9284
+ "Start the Unity Editor for this project, or use --project-path to specify the target."
9279
9285
  );
9280
9286
  process.exit(1);
9281
9287
  }