soulhubcli 1.0.19 → 1.0.20

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
@@ -90,8 +90,8 @@ soulhub install --from https://example.com/agent-team.zip
90
90
  # 安装到自定义目录(不依赖 OpenClaw/LightClaw 环境)
91
91
  soulhub install writer-wechat --dir ./my-agents
92
92
 
93
- # 指定 claw 安装目录(只安装到该 claw)
94
- soulhub install writer-wechat --claw-dir ~/.lightclaw
93
+ # 指定 claw 类型(只安装到该 claw)
94
+ soulhub install writer-wechat --clawtype LightClaw
95
95
  ```
96
96
 
97
97
  ### 列出已安装的 Agent
@@ -119,7 +119,7 @@ soulhub uninstall ops-assistant
119
119
 
120
120
  - **默认安装为 Worker Agent**(子 agent),部署到 `workspace-<agentId>/` 目录
121
121
  - 使用 `--main` 参数可安装为主 Agent,部署到 `workspace/` 目录
122
- - **自动安装到所有检测到的 claw 目录**(OpenClaw / LightClaw),使用 `--claw-dir` 可指定单个 claw
122
+ - **自动安装到所有检测到的 claw 目录**(OpenClaw / LightClaw),使用 `--clawtype` 可指定单个 claw
123
123
  - 如果目标目录已存在,CLI 会**自动备份**(复制到 `agentbackup/`)
124
124
  - 仅覆盖 `IDENTITY.md`、`SOUL.md` 等灵魂文件,不影响 workspace 中的其他运行时文件
125
125
  - 安装完成后自动重启 OpenClaw Gateway;若重启失败会提示手动重启
@@ -148,11 +148,11 @@ export SOULHUB_REGISTRY_URL=https://your-registry.example.com
148
148
 
149
149
  CLI 按以下优先级查找 claw 安装目录:
150
150
 
151
- 1. `--claw-dir` 命令行参数(指定时只安装到该 claw)
151
+ 1. `--clawtype` 命令行参数(指定时只安装到该 claw)
152
152
  2. `OPENCLAW_HOME` / `LIGHTCLAW_HOME` 环境变量
153
153
  3. 默认路径 `~/.openclaw`、`~/.lightclaw`
154
154
 
155
- 未指定 `--claw-dir` 时,CLI 会检测所有可用的 claw 目录并全部安装。
155
+ 未指定 `--clawtype` 时,CLI 会检测所有可用的 claw 目录并全部安装。
156
156
 
157
157
  ## 环境要求
158
158
 
package/dist/index.cjs CHANGED
@@ -19033,11 +19033,15 @@ function copyAgentFilesFromPackage(packageDir, targetDir) {
19033
19033
  }
19034
19034
  function findOpenClawDir(customDir) {
19035
19035
  if (customDir) {
19036
- const resolved = import_node_path11.default.resolve(customDir);
19037
- if (import_node_fs8.default.existsSync(resolved)) {
19038
- return resolved;
19036
+ const home2 = import_node_os2.default.homedir();
19037
+ const lower = customDir.toLowerCase();
19038
+ if (lower === "openclaw") {
19039
+ return import_node_path11.default.join(home2, ".openclaw");
19039
19040
  }
19040
- return resolved;
19041
+ if (lower === "lightclaw") {
19042
+ return import_node_path11.default.join(home2, ".lightclaw");
19043
+ }
19044
+ throw new Error(`Unsupported claw type: "${customDir}". Only "OpenClaw" or "LightClaw" is supported (case-insensitive).`);
19041
19045
  }
19042
19046
  const envHome = process.env.OPENCLAW_HOME || process.env.LIGHTCLAW_HOME;
19043
19047
  if (envHome) {
@@ -19063,8 +19067,15 @@ function findOpenClawDir(customDir) {
19063
19067
  }
19064
19068
  function findAllClawDirs(customDir) {
19065
19069
  if (customDir) {
19066
- const resolved = import_node_path11.default.resolve(customDir);
19067
- return import_node_fs8.default.existsSync(resolved) ? [resolved] : [resolved];
19070
+ const home2 = import_node_os2.default.homedir();
19071
+ const lower = customDir.toLowerCase();
19072
+ if (lower === "openclaw") {
19073
+ return [import_node_path11.default.join(home2, ".openclaw")];
19074
+ }
19075
+ if (lower === "lightclaw") {
19076
+ return [import_node_path11.default.join(home2, ".lightclaw")];
19077
+ }
19078
+ throw new Error(`Unsupported claw type: "${customDir}". Only "OpenClaw" or "LightClaw" is supported (case-insensitive).`);
19068
19079
  }
19069
19080
  const envHome = process.env.OPENCLAW_HOME || process.env.LIGHTCLAW_HOME;
19070
19081
  if (envHome) {
@@ -19207,9 +19218,10 @@ function writeOpenClawConfig(clawDir, config) {
19207
19218
  import_node_fs8.default.writeFileSync(configPath, JSON.stringify(config, null, 2));
19208
19219
  }
19209
19220
  function updateOpenClawConfig(clawDir, updater) {
19210
- const config = readOpenClawConfig(clawDir);
19221
+ let config = readOpenClawConfig(clawDir);
19211
19222
  if (!config) {
19212
- return false;
19223
+ logger.info(`Config file not found in ${clawDir}, creating default config.`);
19224
+ config = { agents: { list: [] } };
19213
19225
  }
19214
19226
  const updated = updater(config);
19215
19227
  writeOpenClawConfig(clawDir, updated);
@@ -19765,15 +19777,15 @@ var installCommand = new Command("install").description("Install an agent or tea
19765
19777
  "--dir <path>",
19766
19778
  "Target directory (defaults to OpenClaw/LightClaw workspace)"
19767
19779
  ).option(
19768
- "--claw-dir <path>",
19769
- "OpenClaw/LightClaw installation directory (overrides OPENCLAW_HOME/LIGHTCLAW_HOME env var, defaults to ~/.openclaw or ~/.lightclaw)"
19780
+ "--clawtype <type>",
19781
+ "Specify claw type: OpenClaw or LightClaw (case-insensitive)"
19770
19782
  ).action(async (name, options) => {
19771
19783
  try {
19772
19784
  const asMain = !!options.main;
19773
19785
  if (options.from) {
19774
- await installFromSource(options.from, options.dir, options.clawDir, asMain);
19786
+ await installFromSource(options.from, options.dir, options.clawtype, asMain);
19775
19787
  } else if (name) {
19776
- await installFromRegistry(name, options.dir, options.clawDir, asMain);
19788
+ await installFromRegistry(name, options.dir, options.clawtype, asMain);
19777
19789
  } else {
19778
19790
  console.error(source_default.red("Please specify an agent or team name, or use --from to install from a local source."));
19779
19791
  console.log(source_default.dim(" Examples:"));
@@ -19781,7 +19793,7 @@ var installCommand = new Command("install").description("Install an agent or tea
19781
19793
  console.log(source_default.dim(" soulhub install writer-wechat --main # Install as main agent"));
19782
19794
  console.log(source_default.dim(" soulhub install dev-squad # Install a team from registry"));
19783
19795
  console.log(source_default.dim(" soulhub install --from ./agent-team/ # Install from local directory"));
19784
- console.log(source_default.dim(" soulhub install writer-wechat --claw-dir ~/.lightclaw # Install to specific claw"));
19796
+ console.log(source_default.dim(" soulhub install writer-wechat --clawtype LightClaw # Install to specific claw"));
19785
19797
  process.exit(1);
19786
19798
  }
19787
19799
  } catch (error) {
@@ -20401,7 +20413,7 @@ async function extractZipToDir(zip, targetDir) {
20401
20413
  }
20402
20414
  function printOpenClawInstallHelp() {
20403
20415
  console.log(source_default.dim(" Please install OpenClaw or LightClaw first, or use one of the following options:"));
20404
- console.log(source_default.dim(" --claw-dir <path> Specify OpenClaw/LightClaw installation directory"));
20416
+ console.log(source_default.dim(" --clawtype <type> Specify claw type: OpenClaw or LightClaw"));
20405
20417
  console.log(source_default.dim(" --dir <path> Specify agent target directory directly"));
20406
20418
  console.log(source_default.dim(" OPENCLAW_HOME=<path> Set environment variable (for OpenClaw)"));
20407
20419
  console.log(source_default.dim(" LIGHTCLAW_HOME=<path> Set environment variable (for LightClaw)"));
@@ -20534,16 +20546,16 @@ var updateCommand = new Command("update").description("Update installed agents t
20534
20546
  var import_node_fs11 = __toESM(require("fs"), 1);
20535
20547
  var import_node_path13 = __toESM(require("path"), 1);
20536
20548
  var rollbackCommand = new Command("rollback").description("Rollback to a previous agent installation state").option("--list", "List available rollback records").option("--id <id>", "Rollback to a specific backup record by ID").option(
20537
- "--claw-dir <path>",
20538
- "OpenClaw/LightClaw installation directory (overrides OPENCLAW_HOME/LIGHTCLAW_HOME env var)"
20549
+ "--clawtype <type>",
20550
+ "Specify claw type: OpenClaw or LightClaw (case-insensitive)"
20539
20551
  ).action(async (options) => {
20540
20552
  try {
20541
20553
  if (options.list) {
20542
20554
  listBackupRecords();
20543
20555
  } else if (options.id) {
20544
- await performRollback(options.id, options.clawDir);
20556
+ await performRollback(options.id, options.clawtype);
20545
20557
  } else {
20546
- await performRollback(void 0, options.clawDir);
20558
+ await performRollback(void 0, options.clawtype);
20547
20559
  }
20548
20560
  } catch (error) {
20549
20561
  logger.errorObj("Rollback command failed", error);
@@ -20715,13 +20727,13 @@ function formatInstallType(type2) {
20715
20727
 
20716
20728
  // src/index.ts
20717
20729
  var program2 = new Command();
20718
- program2.name("soulhub").description("SoulHub CLI - Discover, install and manage AI agent souls").version("1.0.19").option("--verbose", "Enable verbose debug logging").hook("preAction", () => {
20730
+ program2.name("soulhub").description("SoulHub CLI - Discover, install and manage AI agent souls").version("1.0.20").option("--verbose", "Enable verbose debug logging").hook("preAction", () => {
20719
20731
  const opts = program2.opts();
20720
20732
  const verbose = opts.verbose || process.env.SOULHUB_DEBUG === "1";
20721
20733
  logger.init(verbose);
20722
20734
  logger.info("CLI started", {
20723
20735
  args: process.argv.slice(2),
20724
- version: "1.0.19",
20736
+ version: "1.0.20",
20725
20737
  node: process.version
20726
20738
  });
20727
20739
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "soulhubcli",
3
- "version": "1.0.19",
3
+ "version": "1.0.20",
4
4
  "description": "SoulHub CLI - Install and manage AI agent persona templates for OpenClaw",
5
5
  "type": "module",
6
6
  "bin": {