推荐替代

推荐使用原生国产开源替代:Lingti-Bot

从这里开始

Setup(配置与工作流)

强调将定制保存在仓库外,保持更新不破坏。

TL;DR

  • 定制放在仓库外:~/clawd(工作区) + ~/.clawdbot/clawdbot.json(配置)
  • 稳定流程:安装 macOS 应用,让它管理内置网关
  • 前沿流程:用 pnpm gateway:watch 跑网关,应用以 Local 模式附着

前置条件(源码)

  • Node >=22
  • pnpm
  • Docker(可选;容器化/端到端测试)

定制策略(避免升级破坏)

把个性化内容保存在工作区和配置中,避免放到源码仓库。

clawdbot setup

没有全局安装时可用:pnpm clawdbot setup

稳定流程(macOS 应用优先)

  • 安装并启动 Clawdbot.app(菜单栏)
  • 完成 TCC 权限提示
  • 确认 Gateway 为 Local 且运行中
  • 链接渠道(例如 WhatsApp):clawdbot channels login
  • 健康检查:clawdbot health
如果构建没有 onboarding:运行 clawdbot setupclawdbot channels loginclawdbot gateway

前沿流程(终端运行网关)

目标:开发网关并保持 macOS UI 附着。

./scripts/restart-mac.sh
pnpm install
pnpm gateway:watch

在 Clawdbot.app 中将 Connection Mode 设置为 Local。

验证

  • App 中网关状态应显示 “Using existing gateway …”
  • CLI:clawdbot health

常见踩坑

  • 端口不一致:默认 WS 是 ws://127.0.0.1:18789
  • 状态目录:~/.clawdbot/,会话:~/.clawdbot/agents/<agentId>/sessions/,日志:/tmp/clawdbot/

凭据存储地图

  • WhatsApp:~/.clawdbot/credentials/whatsapp/<accountId>/creds.json
  • Telegram:config/env 或 channels.telegram.tokenFile
  • Discord:config/env(token 文件尚不支持)
  • 配对 allowlist:~/.clawdbot/credentials/<channel>-allowFrom.json
  • 模型 auth profiles:~/.clawdbot/agents/<agentId>/agent/auth-profiles.json
  • Legacy OAuth:~/.clawdbot/credentials/oauth.json

Linux(systemd 用户服务)

systemd 默认会在用户登出时停止服务;可启用 lingering:

sudo loginctl enable-linger $USER

中文交流群

扫码加入中文交流群,分享网关搭建、渠道接入与运维经验。

OpenClaw 中文交流群二维码