openclawsetup 2.3.0 → 2.4.1

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.
Files changed (2) hide show
  1. package/bin/cli.mjs +36 -33
  2. package/package.json +1 -1
package/bin/cli.mjs CHANGED
@@ -1128,58 +1128,61 @@ async function showInteractiveMenu(existing) {
1128
1128
  showDashboardAccessInfo();
1129
1129
 
1130
1130
  console.log(colors.cyan('\n请选择操作:'));
1131
- console.log(` ${colors.yellow('1')}. 检查 - 诊断配置和服务状态`);
1132
- console.log(` ${colors.yellow('2')}. 修复 - 自动修复常见问题`);
1133
- console.log(` ${colors.yellow('3')}. 更新 - 更新到最新版本`);
1134
- console.log(` ${colors.yellow('4')}. 重启 - 重启 Gateway 服务`);
1135
- console.log(` ${colors.yellow('5')}. 日志 - 查看 Gateway 日志`);
1136
- console.log(` ${colors.yellow('6')}. 配置模型 - 配置 AI 模型`);
1137
- console.log(` ${colors.yellow('7')}. 重新安装 - 完全重新安装`);
1138
- console.log(` ${colors.yellow('8')}. 卸载 - 完全卸载 OpenClaw`);
1131
+ console.log(` ${colors.yellow('1')}. 检查修复`);
1132
+ console.log(` ${colors.yellow('2')}. 检查更新`);
1133
+ console.log(` ${colors.yellow('3')}. 配置模型`);
1134
+ console.log(` ${colors.yellow('4')}. 配置 Chat`);
1135
+ console.log(` ${colors.yellow('5')}. 配置技能`);
1136
+ console.log(` ${colors.yellow('6')}. 重新安装`);
1137
+ console.log(` ${colors.yellow('7')}. 完全卸载`);
1139
1138
  console.log(` ${colors.yellow('0')}. 退出`);
1140
1139
 
1141
- const choice = await askQuestion('\n请输入选项 (0-8): ');
1140
+ const choice = await askQuestion('\n请输入选项 (0-7): ');
1142
1141
 
1143
1142
  switch (choice.trim()) {
1144
1143
  case '1':
1145
- await runHealthCheck(cliName, false);
1144
+ await runHealthCheck(cliName, true);
1146
1145
  await waitForEnter('\n按回车返回菜单...');
1147
1146
  break;
1148
1147
  case '2':
1149
- await runHealthCheck(cliName, true);
1148
+ await updateOpenClaw(cliName);
1150
1149
  await waitForEnter('\n按回车返回菜单...');
1151
1150
  break;
1152
1151
  case '3':
1153
- await updateOpenClaw(cliName);
1152
+ console.log(colors.cyan('\n启动模型配置...'));
1153
+ spawnSync('npx', ['openclawapi@latest'], {
1154
+ stdio: 'inherit',
1155
+ shell: true,
1156
+ });
1154
1157
  await waitForEnter('\n按回车返回菜单...');
1155
1158
  break;
1156
1159
  case '4':
1157
- console.log(colors.cyan('\n重启 Gateway...'));
1158
- const restartResult = safeExec(`${cliName} gateway restart`);
1159
- if (restartResult.ok) {
1160
- log.success('Gateway 已重启');
1161
- } else {
1162
- log.error('重启失败: ' + (restartResult.error || ''));
1160
+ console.log(colors.cyan('\n选择聊天渠道:'));
1161
+ console.log(` ${colors.yellow('a')}. Discord`);
1162
+ console.log(` ${colors.yellow('b')}. 飞书`);
1163
+ console.log(` ${colors.yellow('c')}. Telegram`);
1164
+ console.log(` ${colors.yellow('0')}. 返回`);
1165
+ const chatChoice = await askQuestion('\n请选择 (a/b/c/0): ');
1166
+ switch (chatChoice.trim().toLowerCase()) {
1167
+ case 'a':
1168
+ spawnSync('npx', ['openclawdc@latest'], { stdio: 'inherit', shell: true });
1169
+ break;
1170
+ case 'b':
1171
+ spawnSync('npx', ['openclaw-chat-cn@latest', 'feishu'], { stdio: 'inherit', shell: true });
1172
+ break;
1173
+ case 'c':
1174
+ spawnSync(cliName, ['onboard'], { stdio: 'inherit', shell: true });
1175
+ break;
1163
1176
  }
1164
1177
  await waitForEnter('\n按回车返回菜单...');
1165
1178
  break;
1166
1179
  case '5':
1167
- console.log(colors.cyan('\n显示最近日志(按 Ctrl+C 退出)...\n'));
1168
- spawnSync(cliName, ['gateway', 'logs', '--tail', '50'], {
1169
- stdio: 'inherit',
1170
- shell: true,
1171
- });
1180
+ console.log(colors.cyan('\n配置技能(即将支持)...'));
1181
+ // TODO: 等待技能地址提供后实现
1182
+ log.warn('技能配置功能即将上线,请稍后再试');
1172
1183
  await waitForEnter('\n按回车返回菜单...');
1173
1184
  break;
1174
1185
  case '6':
1175
- console.log(colors.cyan('\n启动模型配置...'));
1176
- spawnSync('npx', ['openclawapi@latest'], {
1177
- stdio: 'inherit',
1178
- shell: true,
1179
- });
1180
- await waitForEnter('\n按回车返回菜单...');
1181
- break;
1182
- case '7':
1183
1186
  console.log(colors.yellow('\n即将重新安装 OpenClaw...'));
1184
1187
  const confirmReinstall = await askQuestion('确认重新安装?(y/N): ');
1185
1188
  if (confirmReinstall.toLowerCase() === 'y') {
@@ -1189,7 +1192,7 @@ async function showInteractiveMenu(existing) {
1189
1192
  showCompletionInfo(newCliName);
1190
1193
  }
1191
1194
  break;
1192
- case '8':
1195
+ case '7':
1193
1196
  console.log(colors.red('\n⚠ 警告:卸载将删除所有配置!'));
1194
1197
  const confirmUninstall = await askQuestion('确认卸载?(y/N): ');
1195
1198
  if (confirmUninstall.toLowerCase() === 'y') {
@@ -1203,7 +1206,7 @@ async function showInteractiveMenu(existing) {
1203
1206
  console.log(colors.gray('\n再见!'));
1204
1207
  process.exit(0);
1205
1208
  default:
1206
- log.warn('无效选项,请输入 0-8');
1209
+ log.warn('无效选项,请输入 0-7');
1207
1210
  }
1208
1211
  }
1209
1212
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclawsetup",
3
- "version": "2.3.0",
3
+ "version": "2.4.1",
4
4
  "description": "OpenClaw 安装向导 - 智能安装、诊断、自动修复",
5
5
  "type": "module",
6
6
  "bin": {