谷歌的 colab 是一个免费的容器,拥有 2c12g 100g配置

可以方便我们体验 clawdbot

1、官网 https://colab.research.google.com/

2、使用谷歌登录,文件——在云端硬盘新建笔记本

3、注意那些代码块只能运行Python代码,如果是终端命令,需要在前面加!

4、运行 clawdbot 安装命令 !curl -fsSL https://clawd.bot/install.sh | bash

5、去Cloudflare tunnel 上创建一个隧道 https://one.dash.cloudflare.com/ ,记住Token

6、安装一个Cloudflare tunnel 实现内网穿透 !wget https://github.com/cloudflare/cloudflared/releases/download/2026.1.1/cloudflared-linux-amd64

7、给权限 !find /content -mindepth 1 -maxdepth 1 -not -name "drive" -exec sudo chmod -R 777 {} +

8、连接 tunnel , eyJhIjo 换成你的token,很长
!nohup ./cloudflared-linux-amd64 tunnel run --token eyJhIjo > /content/tunnel.log 2>&1 &

9、Cloudflare 控制台添加已发布应用程序路由,子域自己填,服务: http,url: 127.0.0.1:18789

10、配置 clawdbot 支持代理 :!clawdbot config set gateway.trustedProxies '["127.0.0.1"]'

11、运行 clawdbot: !nohup clawdbot gateway --auth password --password 'admin' --port 18789 --verbose > /content/Clawdbot.log 2>&1 &

12、这时候,应该可以通过 Cloudflare 的域名访问页面了

13、在 clawdbot 网页的左边 Overview,Gateway Access,填上面的密码,admin,然后点 connect。
过一会应该会报错:disconnected (1008): pairing required

14、回到 colab,运行
!clawdbot devices list --password 'admin'
你能看到有一个 Pending 的请求,复制这个Request 下面的 id (不太好复制,注意核对)

15、同意配对:
!clawdbot devices approve <requestId>

16、这时候你就能回到 clawdbot 页面,右上角 Health OK

17、在config —— models —— Providers 里面添加 ai api

18、在config —— Agents 往下找,找到 model 的配置项, Primary Model 配置模型

19、这时候就能在 chat 对话了

20、添加 telegram ,在 @BotFather ,创建一个机器人,记住 token,123:abc 的格式

21、colab运行:
!clawdbot config set channels.telegram.botToken '123:abc'
!clawdbot config set channels.telegram.dmPolicy "pairing"
!clawdbot config set channels.telegram.enabled true

22、重新启动 clawdbot
!ps aux | grep clawdbot
找到 id,比如8677,kill
!kill -9 8677
重新启动
!nohup clawdbot gateway --auth password --password 'admin' --port 18789 --verbose > /content/Clawdbot.log 2>&1 &

23、和波特机器人对话,会发来一个配对码

23、telegram 配对
!clawdbot pairing approve telegram 699XHA1Z

24、配对成功后就能对话了

RZfHWlV6BrMSGFZrCYdDJfQU1o1UILAv.avif