linux安装使用openclaw

一.linux安装openclaw
前提:需要高版本node
安装命令:
npm install -g openclaw@latest

二.配置大模型
1.终端配置LLM(大模型)
openclaw config
选择Model
买的集成的coding plan 选择自定义(Custom Provider)

984ac586d2901adc22cc3383f7ab3ec1

 

2.启动或重启服务生效
启动命令
clawdbot gateway
重启命令
clawdbot gateway restart

3.查看当前大模型配置
clawdbot models status

4.配置后的配置文件 .openclaw/openclaw.json内容基本如下:

{
  "agents": {
    "defaults": {
      "workspace": "/home/openclaw/.openclaw/workspace",
      "model": {
        "primary": "custom-api-duckcoding-ai/claude-haiku-4-5-20251001"
      },
      "models": {
        "custom-api-duckcoding-ai/claude-haiku-4-5-20251001": {
          "alias": "ucloud"
        }
      }
    }
  },
  "gateway": {
    "mode": "local",
    "auth": {
      "mode": "token",
      "token": "97b90234065a51ba6aefc0677594219adf0957720735e59c"
    }
  },
  "meta": {
    "lastTouchedVersion": "2026.4.12",
    "lastTouchedAt": "2026-04-14T12:18:00.200Z"
  },
  "models": {
    "mode": "merge",
    "providers": {
      "custom-api-duckcoding-ai": {
        "baseUrl": "https://api.duckcoding.ai/v1",
        "api": "openai-completions",
        "apiKey": "sk-XXXXXX",
        "models": [
          {
            "id": "claude-haiku-4-5-20251001",
            "name": "claude-haiku-4-5-20251001 (Custom Provider)",
            "contextWindow": 16000,
            "maxTokens": 4096,
            "input": [
              "text"
            ],
            "cost": {
              "input": 0,
              "output": 0,
              "cacheRead": 0,
              "cacheWrite": 0
            },
            "reasoning": false
          }
        ]
      }
    }
  },
  "wizard": {
    "lastRunAt": "2026-04-14T12:16:58.032Z",
    "lastRunVersion": "2026.4.12",
    "lastRunCommand": "configure",
    "lastRunMode": "local"
  }
}

 

三.windows上使用网页版
1.转发到本地
ssh -gfN -L 127.0.0.1:18789:127.0.0.1:18789 openclaw
2.访问
http://127.0.0.1:18789

 

四.openclaw连接TG
1.创建TG机器人
搜索BotFather
创建新机器人:/newbot
新机器人起名字:openclaw
设置唯一username: openclaw_bot
完成后会发你一个机器人api

2.openclaw配置Channels
openclaw config
选择local
选择channels
选择configure/link
选择telegram

17cab24bf4c5f95f88c6024fe946ca7a

选择 Finished
后面都选择默认

3.建立连接对话
TG搜索username:openclaw_bot
/start得到配对码


4 完成配对
openclaw pairing approve telegram 配对码
telgram发送任意信息测试

5.开启web控制台
openclaw dashboard
openclaw gateway

posted @ 2026-04-14 20:39  铿锵有力自信且坚定  阅读(8)  评论(0)    收藏  举报