Clawdbot 安装指南

在 macOS、Linux 和 Windows 上安装 Clawdbot AI 助手的完整指南。一条命令快速安装或手动设置选项。

Clawdbot 安装概述

除非有特殊原因,否则请使用 Clawdbot 安装程序。它会自动设置 CLI 并运行引导程序。

快速安装(推荐)

使用一条命令安装 Clawdbot:

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

Windows (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-onboard

2. 全局安装(手动)

如果您已安装 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-daemon

3. 从源码安装(贡献者/开发)

git clone https://github.com/clawdbot/clawdbot.git
cd clawdbot
pnpm install
pnpm ui:build
pnpm build
clawdbot onboard --install-daemon

4. 其他安装选项

安装后

运行这些命令验证您的 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)。

更新 / 卸载

下一步