@yyy9527/openclaw-manager 0.1.2 → 0.2.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/README.md +37 -38
- package/package.json +1 -2
- package/scripts/openclaw_ctl.sh +6 -6
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
面向 macOS 的 OpenClaw 多实例部署与协作编排脚手架,支持:
|
|
4
4
|
|
|
5
5
|
- 一键环境初始化与非交互安装
|
|
6
|
-
- `
|
|
6
|
+
- `clawctl` 命令统一管理
|
|
7
7
|
- TUI 交互
|
|
8
8
|
- 飞书通知适配
|
|
9
9
|
- 多实例隔离与统一命名规范
|
|
@@ -20,53 +20,52 @@
|
|
|
20
20
|
## 2. 快速开始
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
|
+
npm i -g @yyy9527/openclaw-manager
|
|
23
24
|
cp config/openclaw.env.example config/openclaw.env
|
|
24
25
|
cp .env.example .env
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
clawctl setup
|
|
27
|
+
clawctl deploy
|
|
28
|
+
clawctl status
|
|
29
|
+
clawctl --help
|
|
29
30
|
```
|
|
30
31
|
|
|
31
|
-
> 首次执行 `
|
|
32
|
+
> 首次执行 `clawctl deploy` 需要拉取官方镜像,可能耗时较长(取决于网络)。
|
|
32
33
|
> clawhub 在 macOS 安装后,只有把 skills 安装到 `OPENCLAW_HOME_ROOT` 可见目录并挂载到容器,才能持久化并在容器内生效。
|
|
33
34
|
|
|
34
35
|
## 3. 常用命令
|
|
35
36
|
|
|
36
|
-
- `
|
|
37
|
-
- `
|
|
38
|
-
- `
|
|
39
|
-
- `
|
|
40
|
-
- `
|
|
41
|
-
- `
|
|
42
|
-
- `
|
|
43
|
-
- `
|
|
44
|
-
- `
|
|
45
|
-
- `
|
|
46
|
-
- `
|
|
47
|
-
- `
|
|
48
|
-
- `
|
|
49
|
-
- `
|
|
50
|
-
- `
|
|
51
|
-
- `
|
|
52
|
-
- `
|
|
53
|
-
- `
|
|
54
|
-
- `
|
|
55
|
-
- `
|
|
56
|
-
- `npm run health-check`:检查 Docker / Gitee 令牌与仓库 / 飞书配置可用性
|
|
57
|
-
- `npm run self-test`:执行基础自测
|
|
37
|
+
- `clawctl --help`:查看友好的 CLI 帮助
|
|
38
|
+
- `clawctl setup`:初始化环境(幂等)
|
|
39
|
+
- `clawctl deploy`:按配置启动全部实例
|
|
40
|
+
- `clawctl start|stop|restart|status`
|
|
41
|
+
- `clawctl list-claw`:列出当前配置的 claw 名称
|
|
42
|
+
- `clawctl start-claw <name>`:启动指定实例
|
|
43
|
+
- `clawctl stop-claw <name>`:停止指定实例
|
|
44
|
+
- `clawctl status-claw <name>`:查看指定实例状态
|
|
45
|
+
- `clawctl logs-claw <name>`:查看指定实例日志
|
|
46
|
+
- `clawctl logs`:查看日志
|
|
47
|
+
- `clawctl tui`:进入终端交互界面
|
|
48
|
+
- `clawctl chat-claw <name>`:进入指定容器内 OpenClaw 的对话 TUI
|
|
49
|
+
- `clawctl check-env`:检查你是否已补齐关键 `.env` 变量
|
|
50
|
+
- `clawctl sync-skills`:创建共享/专属 skills 目录,并优先通过 clawhub 搜索安装
|
|
51
|
+
- `clawctl sync-model-configs`:将各实例家目录的 `model.env` 同步到各自 `openclaw.json`
|
|
52
|
+
- `clawctl apply-config`:配置变更后统一生效(先同步模型配置,再重启)
|
|
53
|
+
- `clawctl bootstrap-models`:显式覆盖为 Ollama(需先开启覆盖开关)
|
|
54
|
+
- `clawctl set-qwen`:非交互切换到厂商 Qwen(DashScope/OpenAI 兼容)
|
|
55
|
+
- `clawctl health-check`:检查 Docker / Gitee 令牌与仓库 / 飞书配置可用性
|
|
56
|
+
- `clawctl self-test`:执行基础自测
|
|
58
57
|
|
|
59
58
|
## 3.1 `--help` 与配置文件切换
|
|
60
59
|
|
|
61
60
|
脚本入口支持统一全局参数:
|
|
62
61
|
|
|
63
62
|
```bash
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
clawctl --help
|
|
64
|
+
clawctl --config ./config/openclaw.dev.env status
|
|
65
|
+
clawctl --config ./config/openclaw.prod.env --env-file ./.env.prod apply-config
|
|
67
66
|
```
|
|
68
67
|
|
|
69
|
-
|
|
68
|
+
如果在仓库开发态通过 `npm run` 使用,也可以把参数透传给底层脚本(注意 `--`):
|
|
70
69
|
|
|
71
70
|
```bash
|
|
72
71
|
npm run ctl -- --config ./config/openclaw.dev.env status
|
|
@@ -97,9 +96,9 @@ npm run ctl -- --config ./config/openclaw.prod.env --env-file ./.env.prod apply-
|
|
|
97
96
|
|
|
98
97
|
> `clawhub` 通过 `pnpm` 安装(`pnpm add -g clawhub`)。
|
|
99
98
|
> `sync-skills` 会先尝试安装 `find-skills`,再按检索词搜索最佳匹配并安装;遇到超时会自动重试。
|
|
100
|
-
> 若出现 `Rate limit exceeded`,请先执行 `
|
|
101
|
-
> 如果 TUI 报 `No API key found for provider "anthropic"`,先执行 `
|
|
102
|
-
> 如果 TUI 报 `not connected to gateway`,通常是网关刚重启尚未就绪;`
|
|
99
|
+
> 若出现 `Rate limit exceeded`,请先执行 `clawhub login` 再重试 `clawctl sync-skills`。
|
|
100
|
+
> 如果 TUI 报 `No API key found for provider "anthropic"`,先执行 `clawctl apply-config`。
|
|
101
|
+
> 如果 TUI 报 `not connected to gateway`,通常是网关刚重启尚未就绪;`chat-claw` 内置等待逻辑,超时可执行 `clawctl apply-config` 后重试。
|
|
103
102
|
|
|
104
103
|
### 非交互切换到厂商 Qwen
|
|
105
104
|
|
|
@@ -110,11 +109,11 @@ npm run ctl -- --config ./config/openclaw.prod.env --env-file ./.env.prod apply-
|
|
|
110
109
|
2. 执行:
|
|
111
110
|
|
|
112
111
|
```bash
|
|
113
|
-
|
|
112
|
+
clawctl set-qwen
|
|
114
113
|
```
|
|
115
114
|
|
|
116
115
|
该命令会自动为每个实例写入 `~/openclaws/{instance}/model.env`,再同步到家目录 `openclaw.json`。
|
|
117
|
-
最终通过 `
|
|
116
|
+
最终通过 `clawctl apply-config` 重启生效,无需交互式 `openclaw configure`。
|
|
118
117
|
|
|
119
118
|
你也可以按实例准备模板(可选):
|
|
120
119
|
|
|
@@ -192,4 +191,4 @@ npm login
|
|
|
192
191
|
npm publish --access public
|
|
193
192
|
```
|
|
194
193
|
|
|
195
|
-
>
|
|
194
|
+
> 当前包名:`@yyy9527/openclaw-manager`。CLI 主命令为 `clawctl`。
|
package/package.json
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yyy9527/openclaw-manager",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "OpenClaw multi-instance manager for macOS with docker, TUI, and collaboration workflow.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"bin": {
|
|
9
|
-
"openclaw-manager": "./scripts/openclaw_ctl.sh",
|
|
10
9
|
"clawctl": "./scripts/openclaw_ctl.sh"
|
|
11
10
|
},
|
|
12
11
|
"files": [
|
package/scripts/openclaw_ctl.sh
CHANGED
|
@@ -14,7 +14,7 @@ usage() {
|
|
|
14
14
|
OpenClaw Manager CLI(多实例运维入口)
|
|
15
15
|
|
|
16
16
|
用法:
|
|
17
|
-
|
|
17
|
+
clawctl [--config <path>] [--env-file <path>] <command> [args]
|
|
18
18
|
|
|
19
19
|
全局参数:
|
|
20
20
|
-h, --help 显示帮助
|
|
@@ -40,8 +40,8 @@ OpenClaw Manager CLI(多实例运维入口)
|
|
|
40
40
|
self-test
|
|
41
41
|
|
|
42
42
|
示例:
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
clawctl --config ./config/openclaw.dev.env status
|
|
44
|
+
clawctl --env-file ./.env.prod start-claw master
|
|
45
45
|
EOF
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -122,7 +122,7 @@ chat_with_claw() {
|
|
|
122
122
|
local running_service
|
|
123
123
|
running_service="$(run_compose_for_instance "${claw_name}" ps --status running --services 2>/dev/null | awk 'NF{print $1; exit}')"
|
|
124
124
|
if [ "${running_service}" != "openclaw" ]; then
|
|
125
|
-
echo "实例 ${claw_name} 当前未运行,请先执行:
|
|
125
|
+
echo "实例 ${claw_name} 当前未运行,请先执行: clawctl start-claw ${claw_name}" >&2
|
|
126
126
|
exit 1
|
|
127
127
|
fi
|
|
128
128
|
|
|
@@ -131,7 +131,7 @@ chat_with_claw() {
|
|
|
131
131
|
until run_compose_for_instance "${claw_name}" exec -T openclaw sh -lc 'openclaw health >/dev/null 2>&1'; do
|
|
132
132
|
waited=$((waited + 2))
|
|
133
133
|
if [ "${waited}" -ge "${max_wait}" ]; then
|
|
134
|
-
echo "实例 ${claw_name} 网关尚未就绪(等待 ${max_wait}s 超时)。可先执行:
|
|
134
|
+
echo "实例 ${claw_name} 网关尚未就绪(等待 ${max_wait}s 超时)。可先执行: clawctl apply-config" >&2
|
|
135
135
|
exit 1
|
|
136
136
|
fi
|
|
137
137
|
sleep 2
|
|
@@ -269,7 +269,7 @@ case "${command}" in
|
|
|
269
269
|
;;
|
|
270
270
|
chat-claw)
|
|
271
271
|
claw_name="${2:-}"
|
|
272
|
-
[ -n "${claw_name}" ] || { echo "用法:
|
|
272
|
+
[ -n "${claw_name}" ] || { echo "用法: clawctl chat-claw <name>" >&2; exit 1; }
|
|
273
273
|
chat_with_claw "${claw_name}"
|
|
274
274
|
;;
|
|
275
275
|
status-claw)
|