openclawsetup 2.4.0 → 2.4.2
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/bin/cli.mjs +47 -16
- package/package.json +1 -1
package/bin/cli.mjs
CHANGED
|
@@ -991,13 +991,25 @@ async function runHealthCheck(cliName, autoFix = false) {
|
|
|
991
991
|
fixCmd: `${cliName} config set gateway.port 18790 && ${cliName} gateway restart`,
|
|
992
992
|
});
|
|
993
993
|
} else {
|
|
994
|
-
|
|
994
|
+
const issue = {
|
|
995
995
|
level: 'error',
|
|
996
996
|
title: `端口 ${port} 未监听`,
|
|
997
997
|
detail: 'Gateway 端口未开放,服务可能未正常启动',
|
|
998
998
|
solution: `运行 ${cliName} gateway restart`,
|
|
999
999
|
fixCmd: `${cliName} gateway restart`,
|
|
1000
|
-
}
|
|
1000
|
+
};
|
|
1001
|
+
if (autoFix) {
|
|
1002
|
+
console.log(colors.yellow(' 尝试重启 Gateway...'));
|
|
1003
|
+
const restartResult = safeExec(`${cliName} gateway restart`);
|
|
1004
|
+
if (restartResult.ok) {
|
|
1005
|
+
log.success('Gateway 已重启');
|
|
1006
|
+
fixed.push('Gateway 已自动重启');
|
|
1007
|
+
} else {
|
|
1008
|
+
issues.push(issue);
|
|
1009
|
+
}
|
|
1010
|
+
} else {
|
|
1011
|
+
issues.push(issue);
|
|
1012
|
+
}
|
|
1001
1013
|
}
|
|
1002
1014
|
}
|
|
1003
1015
|
|
|
@@ -1025,13 +1037,25 @@ async function runHealthCheck(cliName, autoFix = false) {
|
|
|
1025
1037
|
}
|
|
1026
1038
|
}
|
|
1027
1039
|
} else {
|
|
1028
|
-
|
|
1040
|
+
const issue = {
|
|
1029
1041
|
level: 'error',
|
|
1030
1042
|
title: 'API 无响应',
|
|
1031
1043
|
detail: '无法连接到 Gateway API',
|
|
1032
1044
|
solution: `重启服务: ${cliName} gateway restart`,
|
|
1033
1045
|
fixCmd: `${cliName} gateway restart`,
|
|
1034
|
-
}
|
|
1046
|
+
};
|
|
1047
|
+
if (autoFix) {
|
|
1048
|
+
console.log(colors.yellow(' 尝试重启 Gateway...'));
|
|
1049
|
+
const restartResult = safeExec(`${cliName} gateway restart`);
|
|
1050
|
+
if (restartResult.ok) {
|
|
1051
|
+
log.success('Gateway 已重启');
|
|
1052
|
+
fixed.push('Gateway 已自动重启(API 无响应)');
|
|
1053
|
+
} else {
|
|
1054
|
+
issues.push(issue);
|
|
1055
|
+
}
|
|
1056
|
+
} else {
|
|
1057
|
+
issues.push(issue);
|
|
1058
|
+
}
|
|
1035
1059
|
}
|
|
1036
1060
|
|
|
1037
1061
|
// 5. 检查模型配置
|
|
@@ -1128,15 +1152,16 @@ async function showInteractiveMenu(existing) {
|
|
|
1128
1152
|
showDashboardAccessInfo();
|
|
1129
1153
|
|
|
1130
1154
|
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')}. 配置 Chat
|
|
1135
|
-
console.log(` ${colors.yellow('5')}.
|
|
1136
|
-
console.log(` ${colors.yellow('6')}.
|
|
1155
|
+
console.log(` ${colors.yellow('1')}. 检查修复`);
|
|
1156
|
+
console.log(` ${colors.yellow('2')}. 检查更新`);
|
|
1157
|
+
console.log(` ${colors.yellow('3')}. 配置模型`);
|
|
1158
|
+
console.log(` ${colors.yellow('4')}. 配置 Chat`);
|
|
1159
|
+
console.log(` ${colors.yellow('5')}. 配置技能`);
|
|
1160
|
+
console.log(` ${colors.yellow('6')}. 重新安装`);
|
|
1161
|
+
console.log(` ${colors.yellow('7')}. 完全卸载`);
|
|
1137
1162
|
console.log(` ${colors.yellow('0')}. 退出`);
|
|
1138
1163
|
|
|
1139
|
-
const choice = await askQuestion('\n请输入选项 (0-
|
|
1164
|
+
const choice = await askQuestion('\n请输入选项 (0-7): ');
|
|
1140
1165
|
|
|
1141
1166
|
switch (choice.trim()) {
|
|
1142
1167
|
case '1':
|
|
@@ -1157,9 +1182,9 @@ async function showInteractiveMenu(existing) {
|
|
|
1157
1182
|
break;
|
|
1158
1183
|
case '4':
|
|
1159
1184
|
console.log(colors.cyan('\n选择聊天渠道:'));
|
|
1160
|
-
console.log(` ${colors.yellow('a')}. Discord
|
|
1161
|
-
console.log(` ${colors.yellow('b')}.
|
|
1162
|
-
console.log(` ${colors.yellow('c')}. Telegram
|
|
1185
|
+
console.log(` ${colors.yellow('a')}. Discord`);
|
|
1186
|
+
console.log(` ${colors.yellow('b')}. 飞书`);
|
|
1187
|
+
console.log(` ${colors.yellow('c')}. Telegram`);
|
|
1163
1188
|
console.log(` ${colors.yellow('0')}. 返回`);
|
|
1164
1189
|
const chatChoice = await askQuestion('\n请选择 (a/b/c/0): ');
|
|
1165
1190
|
switch (chatChoice.trim().toLowerCase()) {
|
|
@@ -1176,6 +1201,12 @@ async function showInteractiveMenu(existing) {
|
|
|
1176
1201
|
await waitForEnter('\n按回车返回菜单...');
|
|
1177
1202
|
break;
|
|
1178
1203
|
case '5':
|
|
1204
|
+
console.log(colors.cyan('\n配置技能(即将支持)...'));
|
|
1205
|
+
// TODO: 等待技能地址提供后实现
|
|
1206
|
+
log.warn('技能配置功能即将上线,请稍后再试');
|
|
1207
|
+
await waitForEnter('\n按回车返回菜单...');
|
|
1208
|
+
break;
|
|
1209
|
+
case '6':
|
|
1179
1210
|
console.log(colors.yellow('\n即将重新安装 OpenClaw...'));
|
|
1180
1211
|
const confirmReinstall = await askQuestion('确认重新安装?(y/N): ');
|
|
1181
1212
|
if (confirmReinstall.toLowerCase() === 'y') {
|
|
@@ -1185,7 +1216,7 @@ async function showInteractiveMenu(existing) {
|
|
|
1185
1216
|
showCompletionInfo(newCliName);
|
|
1186
1217
|
}
|
|
1187
1218
|
break;
|
|
1188
|
-
case '
|
|
1219
|
+
case '7':
|
|
1189
1220
|
console.log(colors.red('\n⚠ 警告:卸载将删除所有配置!'));
|
|
1190
1221
|
const confirmUninstall = await askQuestion('确认卸载?(y/N): ');
|
|
1191
1222
|
if (confirmUninstall.toLowerCase() === 'y') {
|
|
@@ -1199,7 +1230,7 @@ async function showInteractiveMenu(existing) {
|
|
|
1199
1230
|
console.log(colors.gray('\n再见!'));
|
|
1200
1231
|
process.exit(0);
|
|
1201
1232
|
default:
|
|
1202
|
-
log.warn('无效选项,请输入 0-
|
|
1233
|
+
log.warn('无效选项,请输入 0-7');
|
|
1203
1234
|
}
|
|
1204
1235
|
}
|
|
1205
1236
|
}
|