Files
bot/docs/zh-CN/install/index.md
zeekay acaeda400a Eradicate OpenClaw — resolve merge conflicts and finish the rebrand
Three coordinated things:

1. Resolve the committed upstream/main merge conflicts. 94 files were
   sitting with raw <<<<<<< HEAD ... >>>>>>> upstream/main blocks. Every
   conflict had HanzoBot/Bot on HEAD and OpenClaw on upstream. Resolved
   by keeping HEAD everywhere — 540 conflict blocks.

2. Rewrite remaining OpenClaw text refs.
     OPENCLAW   → HANZO_BOT
     OpenClaw   → HanzoBot          (PascalCase type identifiers)
     openclaw   → bot               (codebase convention — botToken,
                                    botUsername etc.; avoids invalid
                                    hyphenated JS identifiers)
     openclaw[_]/openclaw[A-Z] → bot[_]/bot[A-Z]   (compound)
     ai.openclaw.x → ai.hanzo.bot.x  (JVM package path)

3. Delete or rename openclaw-named file paths (116 of them). Dead
   duplicates with a Bot-named canonical from the partial migration:
   deleted. Otherwise renamed.
     ai/openclaw/**           → deleted (ai/hanzo/bot/** canonical)
     Sources/OpenClaw*/       → deleted (Sources/Bot* canonical)
     Tests/OpenClawIPCTests/  → deleted (Tests/BotIPCTests canonical)
     OpenClawKit/             → deleted (BotKit canonical)
     openclaw-tools.*.ts      → deleted (bot-tools.*.ts canonical)
     openclaw-root.ts etc.    → deleted (bot-root.ts canonical)
     types.openclaw.ts        → deleted (types.bot.ts canonical)
     extensions/*/openclaw.plugin.json → renamed hanzo-bot.plugin.json
     docs/start/openclaw.md   → renamed hanzo-bot.md (+ zh-CN)
     docs/assets/openclaw-*.png, whatsapp-openclaw*.jpg → deleted
     scripts/.../openclaw-*   → deleted (bot/hanzo-bot parallels)
     openclaw.mjs             → deleted (hanzo-bot.mjs is package.bin)

Then patched 65 broken JS/TS import strings where hanzo-bot had ended
up inside an import path ('./types.hanzo-bot.js' → './types.bot.js'
etc., since the on-disk filename uses the brand-neutral bot- prefix).

Pre-existing lint debt cleaned up to get oxlint --type-aware to 0/0:
removed the dead i18n test that referenced a path no longer existing;
defined the missing DIDConfig and WalletConfig types in types.base.ts
(they were imported but never declared); dropped unused imports;
collapsed redundant type assertion and a tautological meta.bot lookup
that the openclaw→bot rename made redundant.

The a2ui.bundle.js generated artifact is kept at its pre-rebrand
contents — it gets regenerated by 'pnpm canvas:a2ui:bundle' from
sources I cannot rebuild in this commit; the source side is clean.

Verified: 0 occurrences of openclaw (case-insensitive) in tree source
content, 0 file or directory paths with openclaw in the name; oxlint
--type-aware src test reports 0/0.
2026-05-11 17:56:29 -07:00

4.9 KiB
Raw Permalink Blame History

read_when, summary, title, x-i18n
read_when summary title x-i18n
安装 HanzoBot
你想从 GitHub 安装
安装 HanzoBot(推荐安装器、全局安装或从源代码安装) 安装
generated_at model provider source_hash source_path workflow
2026-02-03T10:07:43Z claude-opus-4-5 pi b26f48c116c26c163ee0090fb4c3e29622951bd427ecaeccba7641d97cfdf17a install/index.md 15

安装

除非有特殊原因,否则请使用安装器。它会设置 CLI 并运行新手引导。

快速安装(推荐)

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

Windows(PowerShell):

iwr -useb https://hanzo-bot.ai/install.ps1 | iex

下一步(如果你跳过了新手引导):

hanzo-bot onboard --install-daemon

系统要求

  • Node >=22
  • macOS、Linux 或通过 WSL2 的 Windows
  • pnpm 仅在从源代码构建时需要

选择安装路径

1)安装器脚本(推荐)

通过 npm 全局安装 hanzo-bot 并运行新手引导。

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

安装器标志:

curl -fsSL https://hanzo-bot.ai/install.sh | bash -s -- --help

详情:安装器内部原理。

非交互式(跳过新手引导):

curl -fsSL https://hanzo-bot.ai/install.sh | bash -s -- --no-onboard

2)全局安装(手动)

如果你已经有 Node:

npm install -g hanzo-bot@latest

如果你全局安装了 libvips(macOS 上通过 Homebrew 安装很常见)且 sharp 安装失败,请强制使用预构建二进制文件:

SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install -g hanzo-bot@latest

如果你看到 sharp: Please add node-gyp to your dependencies,要么安装构建工具(macOS:Xcode CLT + npm install -g node-gyp),要么使用上面的 SHARP_IGNORE_GLOBAL_LIBVIPS=1 变通方法来跳过原生构建。

或使用 pnpm:

pnpm add -g hanzo-bot@latest
pnpm approve-builds -g                # 批准 hanzo-bot、node-llama-cpp、sharp 等
pnpm add -g hanzo-bot@latest           # 重新运行以执行 postinstall 脚本

pnpm 需要显式批准带有构建脚本的包。在首次安装显示"Ignored build scripts"警告后,运行 pnpm approve-builds -g 并选择列出的包,然后重新运行安装以执行 postinstall 脚本。

然后:

hanzo-bot onboard --install-daemon

3)从源代码(贡献者/开发)

git clone https://github.com/hanzo-bot/hanzo-bot.git
cd hanzo-bot
pnpm install
pnpm ui:build # 首次运行时自动安装 UI 依赖
pnpm build
hanzo-bot onboard --install-daemon

提示:如果你还没有全局安装,请通过 pnpm hanzo-bot ... 运行仓库命令。

4)其他安装选项

安装后

  • 运行新手引导:hanzo-bot onboard --install-daemon
  • 快速检查:hanzo-bot doctor
  • 检查 Gateway 网关健康状态:hanzo-bot status + hanzo-bot health
  • 打开仪表板:hanzo-bot dashboard

安装方式:npm vs git(安装器)

安装器支持两种方式:

  • npm(默认):npm install -g hanzo-bot@latest
  • git:从 GitHub 克隆/构建并从源代码 checkout 运行

CLI 标志

# 显式 npm
curl -fsSL https://hanzo-bot.ai/install.sh | bash -s -- --install-method npm

# 从 GitHub 安装(源代码 checkout)
curl -fsSL https://hanzo-bot.ai/install.sh | bash -s -- --install-method git

常用标志:

  • --install-method npm|git
  • --git-dir <path>(默认:~/hanzo-bot)
  • --no-git-update(使用现有 checkout 时跳过 git pull)
  • --no-prompt(禁用提示;CI/自动化中必需)
  • --dry-run(打印将要执行的操作;不做任何更改)
  • --no-onboard(跳过新手引导)

环境变量

等效的环境变量(对自动化有用):

  • BOT_INSTALL_METHOD=git|npm
  • BOT_GIT_DIR=...
  • BOT_GIT_UPDATE=0|1
  • BOT_NO_PROMPT=1
  • BOT_DRY_RUN=1
  • BOT_NO_ONBOARD=1
  • SHARP_IGNORE_GLOBAL_LIBVIPS=0|1(默认:1;避免 sharp 针对系统 libvips 构建)

故障排除:找不到 hanzo-bot(PATH)

快速诊断:

node -v
npm -v
npm prefix -g
echo "$PATH"

如果 $(npm prefix -g)/bin(macOS/Linux)或 $(npm prefix -g)(Windows)不在 echo "$PATH" 的输出中,你的 shell 无法找到全局 npm 二进制文件(包括 hanzo-bot)。

修复:将其添加到你的 shell 启动文件(zsh:~/.zshrc,bash:~/.bashrc):

# macOS / Linux
export PATH="$(npm prefix -g)/bin:$PATH"

在 Windows 上,将 npm prefix -g 的输出添加到你的 PATH。

然后打开新终端(或在 zsh 中执行 rehash / 在 bash 中执行 hash -r)。

更新/卸载