Windows OpenClaw(原名Clawdbot)安装指南

在 Windows 系统上安装 OpenClaw(原名Clawdbot),并配置为使用积木AI代码助手接口。

系统要求

系统
Windows 10/11
依赖
Node.js 16+
Node.js 安装(如果没有安装)
前往 nodejs.org/zh-cn/download 下载。

安装步骤(Windows 终端)

1

打开 PowerShell / Windows Terminal

可在 PowerShell / CMD / Windows Terminal / VSCode 终端执行。

2

安装 OpenClaw

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

若 PowerShell 提示“无法加载 *.ps1,因为在此系统上禁止运行脚本”,请先执行:Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser,然后重新打开终端再试。

3

创建并复制 API Key

登录后到「API Key」页面分别创建 Codex / Claude / Gemini 三条产品线的 Key(各复制一份)。

4

脚本快速配置(推荐)

powershell -NoProfile -ExecutionPolicy Bypass -Command "$env:JIMUXYZ_CODEX_KEY='你的Codex_API_KEY'; $env:JIMUXYZ_CLAUDE_KEY='你的Claude_API_KEY'; $env:JIMUXYZ_GEMINI_KEY='你的Gemini_API_KEY'; iwr -useb https://code.jimuxyz.com/env_deploy/openclaw-deploy.ps1 | iex"

脚本会写入 C:\Users\你的用户名\.openclaw\openclaw.json 并备份旧文件。参数顺序:Codex / Claude / Gemini。

脚本失败排障:

  • 提示“无法加载 *.ps1”:先执行 Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser,重启终端后再试。
  • 提示下载失败:检查网络/代理或稍后重试。
  • 提示 API Key 为空:确认已把 Codex / Claude / Gemini 三个 Key 都替换为真实值。
  • 写入后不生效:关闭并重新启动 OpenClaw。
或者

跳到下方「手动配置」,按手动方式替换 JSON 内容。

手动配置

打开 C:\Users\你的用户名\.openclaw\openclaw.json,将 models 部分替换为以下内容,并把各产品线 apiKey 改成自己的 Key。

{
  "models": {
    "providers": {
      "jimuxyz-claude": {
        "baseUrl": "https://code.jimuxyz.com/p",
        "apiKey": "你的Claude_API_KEY",
        "api": "anthropic-messages",
        "models": [
          {
            "id": "claude-haiku-4-5",
            "name": "Claude Haiku 4.5"
          },
          {
            "id": "claude-sonnet-4-5",
            "name": "Claude Sonnet 4.5"
          },
          {
            "id": "claude-opus-4-5",
            "name": "Claude Opus 4.5"
          },
          {
            "id": "claude-opus-4-6",
            "name": "Claude Opus 4.6"
          }
        ]
      },
      "jimuxyz-codex": {
        "baseUrl": "https://code.jimuxyz.com/p",
        "apiKey": "你的Codex_API_KEY",
        "api": "openai-responses",
        "models": [
          {
            "id": "gpt-5.1-codex-mini",
            "name": "GPT-5.1 Codex Mini"
          },
          {
            "id": "gpt-5.1-codex-max",
            "name": "GPT-5.1 Codex Max"
          },
          {
            "id": "gpt-5.3-codex",
            "name": "GPT-5.3 Codex"
          }
        ]
      },
      "jimuxyz-gemini": {
        "baseUrl": "https://code.jimuxyz.com/p",
        "apiKey": "你的Gemini_API_KEY",
        "models": [
          {
            "id": "gemini-2.5-pro",
            "name": "Gemini 2.5 Pro"
          },
          {
            "id": "gemini-2.5-flash",
            "name": "Gemini 2.5 Flash"
          },
          {
            "id": "gemini-2.5-flash-lite",
            "name": "Gemini 2.5 Flash Lite"
          }
        ]
      }
    }
  }
}