> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jige.io/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenClaw

> 在 Windows + WSL 环境中安装并配置 OpenClaw

通过以下步骤，你可以在 Windows + WSL 环境中安装 OpenClaw 并接入极鸽。

> 当前流程依赖可正常访问外部网络的环境。如果你在安装过程中遇到异常，请联系技术支持。

## 前置准备

* 你使用的是 Windows 系统
* 你可以使用管理员权限打开终端
* 建议提前安装 Terminal Canary，后续复制和粘贴更方便

## 安装步骤

<Steps>
  <Step title="安装 WSL">
    用管理员身份打开 Terminal Canary、PowerShell 或 CMD，然后运行：

    ```powershell theme={null}
    wsl --install
    ```

    安装完成后，重启电脑。

    首次打开 Ubuntu（WSL）时，系统会提示你创建用户名和密码。
  </Step>

  <Step title="更新 Linux 系统">
    在 Ubuntu 终端中运行：

    ```bash theme={null}
    sudo apt update && sudo apt upgrade -y
    ```
  </Step>

  <Step title="安装 Git">
    ```bash theme={null}
    sudo apt install git -y
    git --version
    ```
  </Step>

  <Step title="安装 NVM">
    ```bash theme={null}
    curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
    source ~/.bashrc
    ```
  </Step>

  <Step title="安装 Node.js">
    推荐安装 Node.js 24：

    ```bash theme={null}
    nvm install 24
    nvm use 24
    node -v
    npm -v
    ```

    正常情况下，`node -v` 会显示 `v24.x.x`，`npm -v` 会显示 `11.x.x`。
  </Step>

  <Step title="将 GitHub SSH 改为 HTTPS">
    如果当前环境访问 GitHub SSH 有问题，可以执行：

    ```bash theme={null}
    git config --global url."https://github.com/".insteadOf "git@github.com:"
    git config --global url."https://github.com/".insteadOf "ssh://git@github.com/"
    ```
  </Step>

  <Step title="安装 OpenClaw">
    ```bash theme={null}
    npm install -g openclaw
    openclaw --help
    ```
  </Step>

  <Step title="定位配置文件">
    如果你还不确定配置文件位置，可以先搜索：

    ```bash theme={null}
    find ~ -name "*openclaw*" 2>/dev/null
    ```

    常见路径如下：

    * Linux：`/home/用户名/.openclaw` 或 `/home/用户名/.config/openclaw`
    * Windows：`\\wsl$\Ubuntu\home\用户名\.openclaw`
  </Step>

  <Step title="配置 OpenClaw">
    用文本编辑器打开 `openclaw.json`，替换为以下内容：

    ```json theme={null}
    {
      "models": {
        "mode": "merge",
        "providers": {
          "jige": {
            "baseUrl": "https://jige.rsss.xyz/v1",
            "apiKey": "sk-你在极鸽平台创建的令牌，复制进来即可",
            "api": "openai-responses",
            "models": [
              {
                "id": "gpt-5.3-codex",
                "name": "gpt-5.3-codex",
                "reasoning": false,
                "input": ["text", "image"],
                "contextWindow": 128000
              },
              {
                "id": "gpt-5.4",
                "name": "gpt-5.4",
                "reasoning": true,
                "input": ["text", "image"],
                "contextWindow": 128000
              }
            ]
          }
        }
      },
      "agents": {
        "defaults": {
          "model": {
            "primary": "jige/gpt-5.3-codex"
          },
          "models": {
            "jige/gpt-5.3-codex": {
              "alias": "gpt-5.3-codex"
            },
            "jige/gpt-5.4": {
              "alias": "gpt-5.4"
            }
          },
          "compaction": {
            "mode": "safeguard"
          }
        }
      },
      "tools": {
        "profile": "coding",
        "web": {
          "fetch": {
            "enabled": true
          }
        }
      }
    }
    ```

    如果你需要更多模型，可以在此基础上继续添加 `models`。
  </Step>

  <Step title="启动 OpenClaw">
    在 Ubuntu 终端中运行：

    ```bash theme={null}
    openclaw gateway
    ```

    启动成功后，在浏览器中打开 `http://127.0.0.1:18789/`。

    页面会要求你输入令牌。这个令牌可以在 `openclaw.json` 中的 `gateway.auth.token` 找到，例如：

    ```json theme={null}
    "gateway": {
      "mode": "local",
      "auth": {
        "mode": "token",
        "token": "05****"
      }
    }
    ```

    将该令牌填入页面后，你就可以开始使用 OpenClaw。
  </Step>
</Steps>

## 可选优化

* 使用国内镜像加速依赖安装：`npm config set registry https://registry.npmmirror.com`
* 安装 VS Code 和 WSL 扩展后，你可以在 WSL 中运行 `code .` 直接打开项目

## 注意事项

* 建议使用 NVM 安装 Node.js，这样可以避免权限问题
* Node.js 版本需要大于等于 22
* 全局安装 npm 包时不要使用 `sudo`
