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)。

更新 / 解除安裝

下一步