“Openclaw(Clawdbot)_install 安装教程

Node.js 22+

# 添加 NodeSource 仓库
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -

# 安装
apt-get install -y nodejs

# 验证
node -v
# 输出 v22.x.x 就对了

安装 ClawdBot

# npm install -g clawdbot@latest
npm install -g openclaw@latest
openclaw --version

配置文件

mkdir -p ~/.openclaw
vim ~/.openclaw/openclaw.json

注意providers随着模型修改, 模型需要可以工具调用的

{
  "gateway": {
    "mode": "local",
    "bind": "lan",
    "port": 18789,
    "auth": {
      "token": "自己设置token"
    },
    "controlUi": {
      "allowInsecureAuth": true
    }
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "zhipu/glm-4.7"
      },
	  "elevatedDefault": "full" ,
      "workspace": "/wangwang",
      "compaction": {
        "mode": "safeguard"
      },
      "maxConcurrent": 4,
      "subagents": {
        "maxConcurrent": 8
      }
    }
  },
  "models": {
    "mode": "merge",
    "providers": {
      "zhipu": {
        "baseUrl": "https://open.bigmodel.cn/api/coding/paas/v4",
        "apiKey": ".",
        "api": "openai-completions",
        "models": [
          {
            "id": "glm-4.7",
            "name": "glm-4.7"
          }
        ]
      }
    }
  },
  "channels": {
    "telegram": {
      "botToken": ":",
      "groupPolicy": "disabled",
	  "streamMode": "partial",
	  #"proxy": "http://192.168.1.3:"
    }
  },
  "plugins": {
    "entries": {
      "telegram": {
        "enabled": true
      }
    }
  }
}

启动

openclaw gateway --verbose

配对

先给bot发消息, 之后在shell执行Pairing code

openclaw pairing approve telegram **Pairing code** 

Re

https://linux.do/t/topic/1548984

https://linux.do/t/topic/1521459