1. 安装 nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
重新打开终端,确认:
nvm --version
2. 安装 Node.js(≥ 22)
nvm install 22
nvm use 22
nvm alias default 22
验证:
node -v
二、安装 ClawDBot CLI + Gateway
官方安装脚本(推荐)
curl -fsSL https://clawd.bot/install.sh | bash
验证:
clawdbot --version
三、启动并验证 Gateway
3.1 手动启动(验证用)
clawdbot gateway --verbose
另开一个终端:
clawdbot status
应看到:
Gateway │ local · ws://127.0.0.1:18789 · reachable
成功后,回到原终端按 Ctrl + C 停止。
3.2 配置环境变量
修改 ~/.zshrc:
export DEEPSEEK_API_KEY="YOUR_DEEPSEEK_API_KEY"
或者创建 .env 文件:
echo "DEEPSEEK_API_KEY=YOUR_DEEPSEEK_API_KEY" >> ~/.clawdbot/.env
source ~/.zshrc
四、卸载与清理
4.1 卸载 Daemon
ls ~/Library/LaunchAgents | grep -i claw
launchctl unload -w ~/Library/LaunchAgents/
rm ~/Library/LaunchAgents/
4.2 卸载 CLI
npm uninstall -g clawdbot

