uloop-cli 1.6.2 → 1.6.4

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");
@@ -5482,6 +5486,8 @@ var DirectUnityClient = class {
5482
5486
  this.port = port;
5483
5487
  this.host = host;
5484
5488
  }
5489
+ port;
5490
+ host;
5485
5491
  socket = null;
5486
5492
  requestId = 0;
5487
5493
  receiveBuffer = Buffer.alloc(0);
@@ -5743,6 +5749,7 @@ var UnityNotRunningError = class extends Error {
5743
5749
  super("UNITY_NOT_RUNNING");
5744
5750
  this.projectRoot = projectRoot;
5745
5751
  }
5752
+ projectRoot;
5746
5753
  };
5747
5754
  function normalizePort(port) {
5748
5755
  if (typeof port !== "number") {
@@ -5773,7 +5780,7 @@ function validateProjectPath(projectPath) {
5773
5780
  }
5774
5781
  if (!hasUloopInstalled(resolved)) {
5775
5782
  throw new Error(
5776
- `uLoopMCP is not installed in this project (UserSettings/UnityMcpSettings.json not found): ${resolved}`
5783
+ `${PRODUCT_DISPLAY_NAME} is not installed in this project (UserSettings/UnityMcpSettings.json not found): ${resolved}`
5777
5784
  );
5778
5785
  }
5779
5786
  return resolved;
@@ -5791,9 +5798,7 @@ async function resolveUnityPort(explicitPort, projectPath) {
5791
5798
  }
5792
5799
  const projectRoot = findUnityProjectRoot();
5793
5800
  if (projectRoot === null) {
5794
- throw new Error(
5795
- "Unity project not found. Use --port or --project-path option to specify the target."
5796
- );
5801
+ throw new Error("Unity project not found. Use --project-path option to specify the target.");
5797
5802
  }
5798
5803
  return await readPortFromSettingsOrThrow(projectRoot);
5799
5804
  }
@@ -5804,7 +5809,7 @@ function createSettingsReadError(projectRoot) {
5804
5809
 
5805
5810
  Settings file: ${settingsPath}
5806
5811
 
5807
- Run 'uloop launch -r' to restart Unity, or use --port to specify the port directly.`
5812
+ Run 'uloop launch -r' to restart Unity.`
5808
5813
  );
5809
5814
  }
5810
5815
  async function readPortFromSettingsOrThrow(projectRoot) {
@@ -5848,6 +5853,8 @@ var ProjectMismatchError = class extends Error {
5848
5853
  this.expectedProjectRoot = expectedProjectRoot;
5849
5854
  this.connectedProjectRoot = connectedProjectRoot;
5850
5855
  }
5856
+ expectedProjectRoot;
5857
+ connectedProjectRoot;
5851
5858
  };
5852
5859
  var JSON_RPC_METHOD_NOT_FOUND = -32601;
5853
5860
  async function normalizePath(path) {
@@ -5862,7 +5869,7 @@ async function validateConnectedProject(client, expectedProjectRoot) {
5862
5869
  } catch (error) {
5863
5870
  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
5871
  console.error(
5865
- "Warning: Could not verify project identity (get-version not available). Consider updating uLoopMCP package."
5872
+ `Warning: Could not verify project identity (get-version not available). Consider updating ${PRODUCT_DISPLAY_NAME} package.`
5866
5873
  );
5867
5874
  return;
5868
5875
  }
@@ -5886,7 +5893,7 @@ var import_path4 = require("path");
5886
5893
 
5887
5894
  // src/default-tools.json
5888
5895
  var default_tools_default = {
5889
- version: "1.6.2",
5896
+ version: "1.6.4",
5890
5897
  tools: [
5891
5898
  {
5892
5899
  name: "compile",
@@ -6519,7 +6526,7 @@ function getCachedServerVersion() {
6519
6526
  }
6520
6527
 
6521
6528
  // src/version.ts
6522
- var VERSION = "1.6.2";
6529
+ var VERSION = "1.6.4";
6523
6530
 
6524
6531
  // src/spinner.ts
6525
6532
  var SPINNER_FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
@@ -6821,7 +6828,7 @@ function isVersionOlder(v1, v2) {
6821
6828
  }
6822
6829
  function printVersionWarning(cliVersion, serverVersion) {
6823
6830
  const isCliOlder = isVersionOlder(cliVersion, serverVersion);
6824
- const updateCommand = isCliOlder ? `npm install -g uloop-cli@${serverVersion}` : `Update uLoopMCP package to ${cliVersion} via Unity Package Manager`;
6831
+ const updateCommand = isCliOlder ? `npm install -g uloop-cli@${serverVersion}` : `Update ${PRODUCT_DISPLAY_NAME} package to ${cliVersion} via Unity Package Manager`;
6825
6832
  console.error("\x1B[33m\u26A0\uFE0F Version mismatch detected!\x1B[0m");
6826
6833
  console.error(` uloop-cli version: ${cliVersion}`);
6827
6834
  console.error(` uloop server version: ${serverVersion}`);
@@ -7236,8 +7243,8 @@ function getProjectSkillsDir(target) {
7236
7243
  }
7237
7244
  if (!status.hasUloop) {
7238
7245
  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.`
7246
+ `${PRODUCT_DISPLAY_NAME} is not installed in this Unity project (${status.path}).
7247
+ Please install ${PRODUCT_DISPLAY_NAME} package first, then run this command again.`
7241
7248
  );
7242
7249
  }
7243
7250
  return (0, import_path8.join)(status.path, target.projectDir, "skills");
@@ -9065,10 +9072,10 @@ program2.option("--list-commands", "List all command names (for shell completion
9065
9072
  program2.option("--list-options <cmd>", "List options for a command (for shell completion)");
9066
9073
  program2.commandsGroup(HELP_GROUP_CLI_COMMANDS);
9067
9074
  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) => {
9075
+ program2.command("list").description("List all available tools from Unity").addOption(createHiddenPortOption()).option("--project-path <path>", "Unity project path").action(async (options) => {
9069
9076
  await runWithErrorHandling(() => listAvailableTools(extractGlobalOptions(options)));
9070
9077
  });
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) => {
9078
+ 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
9079
  await runWithErrorHandling(() => syncTools(extractGlobalOptions(options)));
9073
9080
  });
9074
9081
  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 +9110,7 @@ function registerToolCommand(tool, helpGroup) {
9103
9110
  cmd.option(optionStr, description);
9104
9111
  }
9105
9112
  }
9106
- cmd.option("-p, --port <port>", "Unity TCP port");
9113
+ cmd.addOption(createHiddenPortOption());
9107
9114
  cmd.option("--project-path <path>", "Unity project path");
9108
9115
  cmd.action(async (options) => {
9109
9116
  const params = buildParams(options, properties);
@@ -9212,6 +9219,9 @@ function convertValue(value, propInfo) {
9212
9219
  function getToolHelpGroup(toolName, defaultToolNames) {
9213
9220
  return defaultToolNames.has(toolName) ? HELP_GROUP_BUILTIN_TOOLS : HELP_GROUP_THIRD_PARTY_TOOLS;
9214
9221
  }
9222
+ function createHiddenPortOption() {
9223
+ return new Option("-p, --port <port>", "Unity TCP port").hideHelp();
9224
+ }
9215
9225
  function extractGlobalOptions(options) {
9216
9226
  return {
9217
9227
  port: options["port"],
@@ -9227,7 +9237,8 @@ function printToolDisabledError(cmdName) {
9227
9237
  }
9228
9238
  function printConnectionError() {
9229
9239
  console.error("\x1B[31mError: Cannot connect to Unity.\x1B[0m");
9230
- console.error("Make sure Unity Editor is open and uLoopMCP server is running.");
9240
+ console.error(`Make sure Unity Editor is open and ${PRODUCT_DISPLAY_NAME} server is running.`);
9241
+ console.error(`You can start the server from: ${MENU_PATH_SERVER}`);
9231
9242
  console.error("");
9232
9243
  console.error("[For AI] Please report the above to the user.");
9233
9244
  }
@@ -9275,7 +9286,7 @@ async function runWithErrorHandling(fn) {
9275
9286
  console.error("");
9276
9287
  console.error("Another Unity instance was found, but it belongs to a different project.");
9277
9288
  console.error(
9278
- "Start the Unity Editor for this project, or use --port to specify the target."
9289
+ "Start the Unity Editor for this project, or use --project-path to specify the target."
9279
9290
  );
9280
9291
  process.exit(1);
9281
9292
  }