Skip to content

Instantly share code, notes, and snippets.

@seandong
Last active January 26, 2026 10:20
Show Gist options
  • Select an option

  • Save seandong/92675171b6e24b9e9272704e71870594 to your computer and use it in GitHub Desktop.

Select an option

Save seandong/92675171b6e24b9e9272704e71870594 to your computer and use it in GitHub Desktop.

适用于 macOS,包含 CLI、Gateway 常驻、Browser Extension。


一、环境准备

1. 安装 nvm

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

重新打开终端,确认:

nvm --version

2. 使用 nvm 安装 Node.js(≥ 22)

nvm install 22
nvm use 22
nvm alias default 22

验证:

node -v
# v22.x.x

二、安装 Clawdbot CLI + Gateway

官方安装脚本(推荐)

curl -fsSL https://clawd.bot/install.sh | bash

验证:

clawdbot --version

三、启动并验证 Gateway

1. 手动启动(验证用)

clawdbot gateway --verbose

另开一个终端:

clawdbot status

应看到:

Gateway │ local · ws://127.0.0.1:18789 · reachable

成功后,回到原终端按 Ctrl + C 停止。


四、安装 Gateway 后台常驻(launchd)

clawdbot onboard --install-daemon

按提示选择:

  • Local gateway → Yes
  • Install daemon → Yes

验证:

clawdbot status

五、安装 Browser Extension(必装)

Clawdbot 的浏览器能力通过官方扩展提供。

安装命令

clawdbot browser extension install

该命令会:

  • 打开 Chrome / Chromium 扩展安装页面
  • 引导你完成扩展安装与授权

安装完成后,重启浏览器即可生效。


六、常用命令

clawdbot status
clawdbot gateway --verbose
clawdbot gateway stop
clawdbot onboard --install-daemon
clawdbot browser extension install

七、快速排查

Gateway unreachable / ECONNREFUSED

clawdbot gateway --verbose
  • 能启动 → 重新执行 clawdbot onboard --install-daemon
  • 不能启动 → 检查 Node 版本是否为 22+

八、卸载(可选)

# 卸载 daemon
ls ~/Library/LaunchAgents | grep -i claw
launchctl unload -w ~/Library/LaunchAgents/<clawdbot-plist>
rm ~/Library/LaunchAgents/<clawdbot-plist>

# 卸载 CLI
npm uninstall -g clawdbot

# 删除配置
rm -rf ~/.clawdbot

完成 🎉

Clawdbot 已在 macOS 上完成安装并后台运行。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment