Rocky9安装openClaw 使用kimi2.0模型 并且使用飞书聊天沟通openclaw

  1. 安装依赖

    yum -y install tar vim git make cmake gcc gcc-c++
    
  2. 修改代理(**,需要自己买)

    export http_proxy=http://192.168.100.128:7890
    export https_proxy=http://192.168.100.128:7890
    

    这样是零时有效,重启就没了

    建议搞个可执行命令,需要的时候就运行一下,不需要的时候就去掉

  3. 安装工具

    #下载nvm并且安装,这是一个关闭node版本的工具
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash
    
    #刷新配置文件
    source .bashrc
    
    #指定node版本是24
    nvm install 24
    
    #检查版本(这个版本我们并不关心)
    npm -v
    
    #检查版本,这就是我们指定的24版的node
    node -v
    
  4. 配置node镜像源

    npm config set registry https://registry.npmmirror.com
    
  5. 指定git路径

    npm config set git $(which git)
    
  6. 改用git全局配置

    git config --global url."https://github.com/".insteadOf "git@github.com:"
    
  7. 安装openClaw

    npm install -g openclaw@latest --verbose
    
    #检查版本
    openclaw -v
    
  8. 初始化配置(这过程中需要选选很多选项选模型)
    我选的kimi2.5

    openclaw onboard --install-daemon
    
  9. 注册kimi账号,然后完成认证会送15块,然后就能用kimi2.5的模型,如果已经有买过别的大模型直接配你已经有的
    地址:Kimi API 开放平台

  10. 直接个人认证
    image-20260324175101279

  11. 创建app-key(app-key只有才生成的时候回出现,这时候要保持下来,后面就看不到了,只能看到Id)
    image-20260324175127295

  12. 认证成功松了15快
    image-20260324175151953

  13. 回到openClaw的配置修改,默认只能本地访问

    本地访问地址:http://localhost:18789/

  14. 如果需要远程访问修改配置文件(比如安装虚拟机里面)

    #把root@192.168.100.66(虚拟机)上的127.0.0.1:18789 映射到 本地18789端口
    ssh -N -L 18789:127.0.0.1:18789 root@192.168.100.66
    
  15. 在window上直接访问 http://localhost:18789/ ,然后输出token(安装完成的时候有,新版本在配置文件里面openclaw dashboar 里面没有了 )
    image-20260324175913760

  16. 不记得了通过 openclaw dashboard查看

    #查询登录地址
    openclaw dashboard
    

    image-20260324180031351

  17. 然后让它帮你干活,开始燃烧你的token
    image-20260324180119244

  18. 如果你需要通过飞书和openclaw聊天,需要在飞书添加机器人(这里假设已经添加好了)

    • 飞书开发者平台地址:飞书开放平台

    • 进入开发者后台
      image-20260326144441323

    • 创建应用
      image-20260326144524187

    • 密钥在这里
      image-20260326144613100

    • 点击箭头会出现2的机器人
      image-20260326144720483

      下面的权限是飞书文档上粘贴过来的,下面的参考3中的数据

      {
        "scopes": {
          "tenant": [
            "contact:contact.base:readonly",
            "docx:document:readonly",
            "im:chat:read",
            "im:chat:update",
            "im:message.group_at_msg:readonly",
            "im:message.p2p_msg:readonly",
            "im:message.pins:read",
            "im:message.pins:write_only",
            "im:message.reactions:read",
            "im:message.reactions:write_only",
            "im:message:readonly",
            "im:message:recall",
            "im:message:send_as_bot",
            "im:message:send_multi_users",
            "im:message:send_sys_msg",
            "im:message:update",
            "im:resource",
            "application:application:self_manage",
            "cardkit:card:write",
            "cardkit:card:read",
            "contact:user.basic_profile:readonly"
          ],
          "user": [
            "contact:user.employee_id:readonly",
            "offline_access","base:app:copy",
            "base:field:create",
            "base:field:delete",
            "base:field:read",
            "base:field:update",
            "base:record:create",
            "base:record:delete",
            "base:record:retrieve",
            "base:record:update",
            "base:table:create",
            "base:table:delete",
            "base:table:read",
            "base:table:update",
            "base:view:read",
            "base:view:write_only",
            "base:app:create",
            "base:app:update",
            "base:app:read",
            "sheets:spreadsheet.meta:read",
            "sheets:spreadsheet:read",
            "sheets:spreadsheet:create",
            "sheets:spreadsheet:write_only",
            "docs:document:export",
            "docs:document.media:upload",
            "board:whiteboard:node:create",
            "board:whiteboard:node:read",
            "calendar:calendar:read",
            "calendar:calendar.event:create",
            "calendar:calendar.event:delete",
            "calendar:calendar.event:read",
            "calendar:calendar.event:reply",
            "calendar:calendar.event:update",
            "calendar:calendar.free_busy:read",
            "contact:contact.base:readonly",
            "contact:user.base:readonly",
            "contact:user:search",
            "docs:document.comment:create",
            "docs:document.comment:read",
            "docs:document.comment:update",
            "docs:document.media:download",
            "docs:document:copy",
            "docx:document:create",
            "docx:document:readonly",
            "docx:document:write_only",
            "drive:drive.metadata:readonly",
            "drive:file:download",
            "drive:file:upload",
            "im:chat.members:read",
            "im:chat:read",
            "im:message",
            "im:message.group_msg:get_as_user",
            "im:message.p2p_msg:get_as_user",
            "im:message:readonly",
            "search:docs:read",
            "search:message",
            "space:document:delete",
            "space:document:move",
            "space:document:retrieve",
            "task:comment:read",
            "task:comment:write",
            "task:task:read",
            "task:task:write",
            "task:task:writeonly",
            "task:tasklist:read",
            "task:tasklist:write",
            "wiki:node:copy",
            "wiki:node:create",
            "wiki:node:move",
            "wiki:node:read",
            "wiki:node:retrieve",
            "wiki:space:read",
            "wiki:space:retrieve",
            "wiki:space:write_only",
            "contact:user.basic_profile:readonly"
          ]
        }
      }
      
    • 配置权限
      image-20260326144835514

    • 事件选长连接对应 openclaw 添加渠道选的 websocket(没有外网)
      image-20260326144912545

    • 然后就是发布
      image-20260326145020495

    • 发布以后以后可以在控制到找到你发布的应用,也能建立一个群然后添加群机器人把他家加进来
      image-20260326145158976

      image-20260326145537824

  19. 添加联调渠道

    openclaw channels add
    
  20. 选飞书,然后输入飞书的 App ID 和 App Secret

    一些选项应该怎选

    • Configure chat channels now?
      • 选:yes
    • Select a channel
      • 选:Feishu/Lark (飞书) ,如果这时候有二维码,直接扫描就会自动创建飞书机器人和设置密钥和id
    • Enter Feishu App Secret
      • 输出密钥
    • Enter Feishu App ID
      • 输入app id
    • Feishu connection mode
      • 选:WebSocket (default),这个不需要外网
    • Which Feishu domain?
      • 选: Feishu (feishu.cn) - China
    • Group chat policy
      • 选: Open - respond in all groups (requires mention) 响应所有群聊天
    • Select a channel
      • 选: Finished
    • Feishu DM policy
      • 选: Open (public inbound DMs) 所有直接聊天都会只能回复,选其他会部分回复挥着拒绝
    • Add display names for these accounts? (optional)
      • 选: 选yes ,然后取一个给飞书聊天名字,不取默认是id(在openclaw聊天页面里面)
    • Bind configured channel accounts to agents now?
    • yes 绑定到智能体
    • Route feishu account "default" to agent
      • 选:main (default) 使用默认智能体
  21. 然后重启openclaw

  22. 在群里@你的小助手就可以了,箭头的那个表情表示openClaw在回复你
    image-20260326142844346

参考1:使用 OpenClaw 连接 Kimi K2.5 模型 - Kimi API 开放平台

参考2:飞书 - OpenClaw

参看3:OpenClaw飞书官方插件上线|一文讲清功能、安装更新教程与常见问题! - 飞书官网

配置模型后的配置例子

{
  "agents": {
    "defaults": {
      "workspace": "/root/.openclaw/workspace",
      "models": {                               #默认模型列表
        "openAI/gpt-5.4": { "alias": "GPT-5.4" },
        "openAI/gpt-5.5": { "alias": "GPT-5.5" },
        "openAI/gpt-5.3-codex": { "alias": "GPT-5.3-Codex" }
      },
      "model": {
        "primary": "openAI/gpt-5.4",            #默认模型
        "fallbacks": [
          "openAI/gpt-5.5",						#备用模型列表,也是就默认模型失败的时候自动切下面的
          "openAI/gpt-5.3-codex"
        ]
      }
    }
  },
  "models": {
    "mode": "merge",
    "providers": {                              
      "openAI": {								#模型提供者的名字,是一个引用模型的前缀
        "baseUrl": "baseUrl",                   #服务地址一般是xxx/v1
        "api": "openai-completions",           #api版本名字
        "apiKey": "你的token",                  #token
        "models": [
          {
            "id": "gpt-5.4",
            "name": "GPT-5.4",
            "contextWindow": 4000,
            "maxTokens": 4096,
            "input": ["text","image"],
            "cost": {"input":0,"output":0,"cacheRead":0,"cacheWrite":0},
            "reasoning": false
          },
          {
            "id": "gpt-5.5",
            "name": "GPT-5.5",
            "contextWindow": 4000,
            "maxTokens": 4096,
            "input": ["text","image"],
            "cost": {"input":0,"output":0,"cacheRead":0,"cacheWrite":0},
            "reasoning": false
          },
          {
            "id": "gpt-5.3-codex",
            "name": "GPT-5.3-Codex",
            "contextWindow": 4000,
            "maxTokens": 4096,
            "input": ["text"],
            "cost": {"input":0,"output":0,"cacheRead":0,"cacheWrite":0},
            "reasoning": false
          }
        ]
      }
    }
  }
  #省略其他
}

下面是一个配置了飞书的部分配置

{

  #省略其他
  "channels": {
    "feishu": {
      "enabled": true,
      "appId": "xxx",
      "appSecret": "xxx",
      "connectionMode": "websocket",
      "domain": "feishu",
      "dmPolicy": "pairing",
      "allowFrom": [
        "ou_c36da31a295a31ed30ff76c9cbf73e3d"
      ],
      "groupPolicy": "open",
      "requireMention": true
    }
  },
  "bindings": [
    {
      "agentId": "main",
      "match": {
        "channel": "feishu",
        "accountId": "default"
      }
    }
  ]
}

权限限制问题

新版默认不给权限了需要制定

{
  #省略其他
  "tools": {
    "profile": "coding",
	"elevated": {
		"enabled": true,               #允许提升权限
		"allowFrom": {
		  "webchat": ["*"],            #允许网页聊天提权
		  "feishu": ["*"]              #允许所有提权
		}
	}
  }
}

远程连接和证书问题

openclaw如果要使用远程连接,需要https环境,但是它本身不能配置证书

只能在在外面套一个nginx,nginx设置http证书,然后重定向到openclaw,这时候要用wss:协议

{
    
  "gateway": {
    "mode": "local",
    "auth": {
      "mode": "token",
      "token": "7d6da867be848f29a3f31fdef7829c5bb03a89e95a3e790"
    },
    "port": 18789,
    "bind": "lan",                        #这个好像不用改成蓝也行
    "tailscale": {
      "mode": "off",
      "resetOnExit": false
    },
    "controlUi": {
      "allowInsecureAuth": true,
      "allowedOrigins": [                  #跨域需要制定
        "*"
      ]
    },
    "trustedProxies": [
      "127.0.0.1/32",
      "192.168.100.0/24"
    ],
    "remote": {
      "url": "wss://192.168.100.66"              #主要是改这个
    },
    "nodes": {
      "denyCommands": [
        "camera.snap",
        "camera.clip",
        "screen.record",
        "contacts.add",
        "calendar.add",
        "reminders.add",
        "sms.send",
        "sms.search"
      ]
    }
  }

}

设配配对问题

有个安全机制,需要授权以后才能登录

点登陆以后提示:device pairing required (requestId: 9a00d5bb-4b9b-4661-a1f4-8f9b432d9886) 类似异常

#在终端列出设备编号
openclaw devices list 

#然后直接同意,其实登录的时候已经有设备编号了,直接同意也行
openclaw devices approve xxxDeviceID

给一个最终的版本openclaw.json

{
  "agents": {
    "defaults": {
      "workspace": "/root/.openclaw/workspace",
      "compaction": {
        "reserveTokensFloor": 20000
      },
      "models": {
        "CactusAPI/gpt-5.4": {
          "alias": "GPT-5.4"
        },
        "CactusAPI/gpt-5.5": {
          "alias": "GPT-5.5"
        },
        "CactusAPI/gpt-5.3-codex": {
          "alias": "GPT-5.3-Codex"
        }
      },
      "model": {
        "primary": "CactusAPI/gpt-5.4",
        "fallbacks": []
      }
    }
  },
  "models": {
    "mode": "merge",
    "providers": {
      "CactusAPI": {
        "baseUrl": "https://xxx.xxx.xyz/v1",
        "api": "openai-completions",
        "apiKey": "sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "models": [
          {
            "id": "gpt-5.4",
            "name": "GPT-5.4",
            "contextWindow": 128000,
            "maxTokens": 4096,
            "input": [
              "text",
              "image"
            ],
            "cost": {
              "input": 0,
              "output": 0,
              "cacheRead": 0,
              "cacheWrite": 0
            },
            "reasoning": false
          },
          {
            "id": "gpt-5.5",
            "name": "GPT-5.5",
            "contextWindow": 128000,
            "maxTokens": 4096,
            "input": [
              "text",
              "image"
            ],
            "cost": {
              "input": 0,
              "output": 0,
              "cacheRead": 0,
              "cacheWrite": 0
            },
            "reasoning": false
          },
          {
            "id": "gpt-5.3-codex",
            "name": "GPT-5.3-Codex",
            "contextWindow": 128000,
            "maxTokens": 4096,
            "input": [
              "text"
            ],
            "cost": {
              "input": 0,
              "output": 0,
              "cacheRead": 0,
              "cacheWrite": 0
            },
            "reasoning": false
          }
        ]
      }
    }
  },
  "gateway": {
    "mode": "local",
    "auth": {
      "mode": "token",
      "token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    },
    "port": 18789,
    "bind": "lan",
    "tailscale": {
      "mode": "off",
      "resetOnExit": false
    },
    "controlUi": {
      "allowInsecureAuth": true,
      "allowedOrigins": [
        "*"
      ]
    },
    "trustedProxies": [
      "127.0.0.1/32",
      "192.168.100.0/24"
    ],
    "remote": {
      "url": "wss://xxx.xxx.xxx"
    },
    "nodes": {
      "denyCommands": [
        "camera.snap",
        "camera.clip",
        "screen.record",
        "contacts.add",
        "calendar.add",
        "reminders.add",
        "sms.send",
        "sms.search"
      ]
    }
  },
  "session": {
    "dmScope": "per-channel-peer"
  },
  "tools": {
    "profile": "coding",
    "elevated": {
      "enabled": true,
      "allowFrom": {
        "webchat": [
          "*"
        ],
        "feishu": [
          "*"
        ]
      }
    }
  },
  "plugins": {
    "entries": {
      "feishu": {
        "enabled": true
      }
    }
  },
  "meta": {
    "lastTouchedVersion": "2026.5.5",
    "lastTouchedAt": "2026-05-07T14:33:00.351Z"
  },
  "channels": {
    "feishu": {
      "enabled": true,
      "appId": "cli_xxxxxxxxxxxxxxxxxxxx",
      "appSecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
      "connectionMode": "websocket",
      "domain": "feishu",
      "dmPolicy": "pairing",
      "groupPolicy": "open",
      "requireMention": true
    }
  },
  "bindings": [
    {
      "agentId": "main",
      "match": {
        "channel": "feishu",
        "accountId": "default"
      }
    }
  ],
  "commands": {}
}

常见命令


#重启,启动和停止 ,网关能正常接收消息就算启动了
openclaw gateway restart           #最常用编辑配置以后需要重启网关
openclaw gateway start
openclaw gateway stop

# 查看运行状态
openclaw status


# 打开编辑配置文件
openclaw config


# 实时看日志
openclaw logs

#查看版本
openclaw -v

# 升级到最新版
openclaw update


# 列出已安装插件
openclaw plugin list

# 启用插件
openclaw plugin enable feishu

# 禁用插件
openclaw plugin disable feishu




posted on 2026-03-27 21:03  zhangyukun  阅读(91)  评论(0)    收藏  举报

导航