@tencent-weixin/openclaw-weixin-cli 1.0.0 → 1.0.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.
- package/cli.mjs +12 -3
- package/package.json +1 -1
package/cli.mjs
CHANGED
|
@@ -8,11 +8,11 @@ const CHANNEL_ID = "openclaw-weixin";
|
|
|
8
8
|
// ── helpers ──────────────────────────────────────────────────────────────────
|
|
9
9
|
|
|
10
10
|
function log(msg) {
|
|
11
|
-
console.log(`\x1b[36m[weixin]\x1b[0m ${msg}`);
|
|
11
|
+
console.log(`\x1b[36m[openclaw-weixin]\x1b[0m ${msg}`);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
function error(msg) {
|
|
15
|
-
console.error(`\x1b[31m[weixin]\x1b[0m ${msg}`);
|
|
15
|
+
console.error(`\x1b[31m[openclaw-weixin]\x1b[0m ${msg}`);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
function run(cmd, { silent = true } = {}) {
|
|
@@ -81,7 +81,16 @@ function install() {
|
|
|
81
81
|
console.log(` openclaw channels login --channel ${CHANNEL_ID}`);
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
// 4.
|
|
84
|
+
// 4. Restart gateway so it picks up the new account
|
|
85
|
+
log("正在重启 OpenClaw Gateway...");
|
|
86
|
+
try {
|
|
87
|
+
run(`openclaw gateway restart`, { silent: false });
|
|
88
|
+
} catch {
|
|
89
|
+
error("重启失败,可手动执行:");
|
|
90
|
+
console.log(` openclaw gateway restart`);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// 5. Done
|
|
85
94
|
console.log();
|
|
86
95
|
log("\x1b[32m安装完成!\x1b[0m");
|
|
87
96
|
console.log();
|