diff --git a/DOCS.md b/DOCS.md index 9499577..28ffaee 100644 --- a/DOCS.md +++ b/DOCS.md @@ -2,7 +2,7 @@ This add-on runs a Moltbot Assistant instance on Home Assistant OS (Supervisor add-on). -> Note: Moltbot is the new name for the upstream Clawdbot project. Internally, this add-on may still use the `clawdbot` CLI/package as a compatibility layer. +> Note: The upstream project has gone through renames. This add-on currently installs **OpenClaw** (the successor of Clawdbot) and also provides a `clawdbot` shim for backwards compatibility. ## What this add-on provides diff --git a/README.md b/README.md index 4a4a6e1..dcec268 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ This repository contains a Home Assistant add-on that runs a **Moltbot Assistant** instance on **HAOS**. -Upstream note: Moltbot is the new name for the Clawdbot project. The add-on may still install/use the `clawdbot` npm package/CLI for compatibility until the upstream transition fully settles. +Upstream note: the project has gone through renames. This add-on currently installs **OpenClaw** and keeps a `clawdbot` shim for backwards compatibility. ## What you get - Always-on personal assistant running as a Supervisor-managed container diff --git a/moltbot_assistant/Dockerfile b/moltbot_assistant/Dockerfile index 8c222a5..b48600d 100644 --- a/moltbot_assistant/Dockerfile +++ b/moltbot_assistant/Dockerfile @@ -42,9 +42,12 @@ RUN set -eu; \ libstdc++ libgcc libatomic; \ /usr/local/bin/node -v; /usr/local/bin/npm -v -# Install clawdbot globally +# Install OpenClaw globally (successor of Clawdbot) +# We also provide a lightweight `clawdbot` shim for backwards compatibility. RUN npm config set fund false && npm config set audit false \ - && npm install -g clawdbot + && npm install -g openclaw@2026.1.29 \ + && printf '%s\n' '#!/usr/bin/env sh' 'exec openclaw "$@"' > /usr/local/bin/clawdbot \ + && chmod +x /usr/local/bin/clawdbot COPY run.sh /run.sh COPY nginx.conf.tpl /etc/nginx/nginx.conf.tpl diff --git a/moltbot_assistant/config.yaml b/moltbot_assistant/config.yaml index c237e04..fdd161a 100644 --- a/moltbot_assistant/config.yaml +++ b/moltbot_assistant/config.yaml @@ -1,5 +1,5 @@ name: Moltbot Assistant -version: "0.4.7" +version: "0.4.8" slug: moltbot_assistant description: Run Moltbot Assistant (Clawdbot-compatible) as a Home Assistant add-on. url: https://github.com/techartdev/MoltBotHomeAssistant diff --git a/moltbot_assistant/run.sh b/moltbot_assistant/run.sh index 1d78a18..0cd4be8 100644 --- a/moltbot_assistant/run.sh +++ b/moltbot_assistant/run.sh @@ -149,7 +149,9 @@ if [ -z "$GW_TOKEN" ]; then GW_AUTH_BLOCK="auth: { mode: \"token\" }" fi -# Write Clawdbot gateway config (JSON5) into the expected location. +# Write gateway config (JSON5). +# We keep legacy Clawdbot paths for compatibility, and also write OpenClaw paths. +mkdir -p /config/.clawdbot /config/.openclaw cat > /config/.clawdbot/clawdbot.json < /config/.clawdbot/clawdbot.json </dev/null || true + echo "Model primary=${MODEL_PRIMARY}" echo "Gateway bind=${GW_BIND} port=${GW_PORT} token=${GW_TOKEN:+(set)}${GW_TOKEN:-(auto)}" echo "Telegram dmPolicy=${DM_POLICY}${ALLOW_FROM_RAW:+ (allowFrom=${ALLOW_FROM_RAW})}" @@ -229,7 +234,7 @@ RUN_DOCTOR=$(jq -r '.run_doctor_on_start // false' "$OPTIONS_FILE") if [ "$RUN_DOCTOR" = "true" ]; then echo "Running assistant doctor (auto-fix) ..." - (timeout 60s clawdbot doctor --fix --yes) || true + (timeout 60s "${CLI_BIN:-clawdbot}" doctor --fix --yes) || true else echo "Skipping clawdbot doctor on startup (run_doctor_on_start=false)" fi @@ -267,8 +272,18 @@ trap shutdown INT TERM NGINX_PID="" TTYD_PID="" -echo "Starting Moltbot Assistant gateway (clawdbot-compatible)..." -clawdbot gateway run & +CLI_BIN="" +if command -v openclaw >/dev/null 2>&1; then + CLI_BIN="openclaw" +elif command -v clawdbot >/dev/null 2>&1; then + CLI_BIN="clawdbot" +else + echo "ERROR: Neither openclaw nor clawdbot is installed." + exit 1 +fi + +echo "Starting Moltbot Assistant gateway (${CLI_BIN}-compatible)..." +"${CLI_BIN}" gateway run & GW_PID=$! # Start web terminal (optional)