Clawdbot 安装指南
在 macOS、Linux 和 Windows 上安装 Clawdbot AI 助手的完整指南。一条命令快速安装或手动设置选项。
Clawdbot 安装概述
除非有特殊原因,否则请使用 Clawdbot 安装程序。它会自动设置 CLI 并运行引导程序。
快速安装(推荐)
使用一条命令安装 Clawdbot:
curl -fsSL https://clawd.bot/install.sh | bashWindows (PowerShell):
iwr -useb https://clawd.bot/install.ps1 | iex下一步(如果跳过了引导):
clawdbot onboard --install-daemon系统要求
| 要求 | 详情 |
|---|---|
| Node.js | 版本 22 或更高 |
| 操作系统 | macOS、Linux 或通过 WSL2 的 Windows |
| pnpm | 仅在从源码构建时需要 |
选择安装方式
1. 安装脚本(推荐)
Clawdbot 安装程序通过 npm 全局安装并运行引导:
curl -fsSL https://clawd.bot/install.sh | bash安装程序标志:
curl -fsSL https://clawd.bot/install.sh | bash -s -- --help非交互式(跳过引导):
curl -fsSL https://clawd.bot/install.sh | bash -s -- --no-onboard2. 全局安装(手动)
如果您已安装 Node.js:
npm install -g clawdbot@latest如果全局安装了 libvips 且 sharp 失败:
SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install -g clawdbot@latest使用 pnpm:
pnpm add -g clawdbot@latest
pnpm approve-builds -g # 批准 clawdbot、node-llama-cpp、sharp 等然后运行引导:
clawdbot onboard --install-daemon3. 从源码安装(贡献者/开发)
git clone https://github.com/clawdbot/clawdbot.git
cd clawdbot
pnpm install
pnpm ui:build
pnpm build
clawdbot onboard --install-daemon4. 其他安装选项
- Docker:参见 Docker 安装
- Nix:参见 Nix 安装
- Ansible:参见 Ansible 安装
安装后
运行这些命令验证您的 Clawdbot 安装:
# 运行引导
clawdbot onboard --install-daemon
# 快速检查
clawdbot doctor
# 检查网关健康
clawdbot status
clawdbot health
# 打开仪表板
clawdbot dashboard安装方式:npm vs git
Clawdbot 安装程序支持两种方式:
| 方式 | 描述 |
|---|---|
npm(默认) | npm install -g clawdbot@latest |
git | 从 GitHub 源码检出克隆/构建 |
CLI 标志:
# 显式 npm
curl -fsSL https://clawd.bot/install.sh | bash -s -- --install-method npm
# 从 GitHub 安装(源码检出)
curl -fsSL https://clawd.bot/install.sh | bash -s -- --install-method git常用标志:
| 标志 | 描述 |
|---|---|
--install-method npm|git | 选择安装方式 |
--git-dir <path> | Git 目录(默认:~/clawdbot) |
--no-git-update | 跳过现有检出的 git pull |
--no-prompt | 禁用提示(用于 CI/自动化) |
--dry-run | 打印将要执行的操作 |
--no-onboard | 跳过引导 |
环境变量
用于自动化的环境变量:
CLAWDBOT_INSTALL_METHOD=git|npm
CLAWDBOT_GIT_DIR=...
CLAWDBOT_GIT_UPDATE=0|1
CLAWDBOT_NO_PROMPT=1
CLAWDBOT_DRY_RUN=1
CLAWDBOT_NO_ONBOARD=1
SHARP_IGNORE_GLOBAL_LIBVIPS=0|1故障排除:找不到 clawdbot(PATH)
快速诊断:
node -v
npm -v
npm prefix -g
echo "$PATH"如果 $(npm prefix -g)/bin 不在您的 PATH 中,将其添加到 shell 启动文件:
macOS / Linux(~/.zshrc 或 ~/.bashrc):
export PATH="$(npm prefix -g)/bin:$PATH"Windows: 将 npm prefix -g 的输出添加到 PATH 环境变量。
然后打开新终端或运行 hash -r(bash)/ rehash(zsh)。
更新 / 卸载
- 更新:参见 更新 Clawdbot
- 卸载:参见 卸载 Clawdbot
下一步
- Clawdbot 设置指南 - 完整设置指南
- Clawdbot 网关 - 网关配置
- Clawdbot WhatsApp - 连接到 WhatsApp