windows电脑安装openclaw步骤(养龙虾)

windows电脑安装openclaw

* 安装nodejs 版本大于20

* 安装pnpm:npm install -g pnpm

* 安装git

下面命令都在powershell中以管理员身份执行

复制代码
* npm config set registry https://registry.npmmirror.com

可能提示:

复制代码
npm : 无法加载文件 D:\nodejs\npm.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Executio

* 然后执行:

复制代码
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force

* 再执行

复制代码
pnpm add -g openclaw  

耐心等等。。。

* 然后选择快速安装

安装完成后会输出done......

安装完正常会自动打开浏览器,如果没有,再执行

复制代码
openclaw onboard

* 然后是配置模型,以阿里的通义千问模型为例:

找到配置文件,一般路径在:C:\Users\Administrator\.openclaw\openclaw.json文件

打开后默认是下面的配置:

复制代码
{
  "wizard": {
    "lastRunAt": "2026-03-10T13:33:13.090Z",
    "lastRunVersion": "2026.3.8",
    "lastRunCommand": "onboard",
    "lastRunMode": "local"
  },
  "agents": {
    "defaults": {
      "workspace": "C:\\Users\\Administrator\\.openclaw\\workspace",
      "compaction": {
        "mode": "safeguard"
      },
      "maxConcurrent": 4,
      "subagents": {
        "maxConcurrent": 8
      }
    }
  },
  "tools": {
    "profile": "coding"
  },
  "messages": {
    "ackReactionScope": "group-mentions"
  },
  "commands": {
    "native": "auto",
    "nativeSkills": "auto",
    "restart": true,
    "ownerDisplay": "raw"
  },
  "session": {
    "dmScope": "per-channel-peer"
  },
  "gateway": {
    "port": 18789,
    "mode": "local",
    "bind": "loopback",
    "auth": {
      "mode": "token",
      "token": "__OPENCLAW_REDACTED__"
    },
    "tailscale": {
      "mode": "off",
      "resetOnExit": false
    },
    "nodes": {
      "denyCommands": [
        "camera.snap",
        "camera.clip",
        "screen.record",
        "contacts.add",
        "calendar.add",
        "reminders.add",
        "sms.send"
      ]
    }
  },
  "meta": {
    "lastTouchedVersion": "2026.3.8",
    "lastTouchedAt": "2026-03-10T13:33:13.111Z"
  }
}

配置完千问模型后如下:

复制代码
{
  "wizard": {
    "lastRunAt": "2026-03-10T13:33:13.090Z",
    "lastRunVersion": "2026.3.8",
    "lastRunCommand": "onboard",
    "lastRunMode": "local"
  },
  "models": {
    "mode": "merge",
    "providers": {
      "bailian": {  
        "baseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1", //北京区域的地址,具体可参考https://help.aliyun.com/zh/model-studio/openclaw#step-config-section
        "apiKey": "", //百炼平台的秘钥
        "api": "openai-completions",  
        "models": [  
          {
            "id": "qwen3-max-2026-01-23",  // qwen-max模型ID(需与百炼平台一致,可在「模型列表」中查看)
            "name": "通义千问Max",  // 模型别名(自定义,便于识别)
            "reasoning": false,  // 必须关闭(否则回复内容为空)
            "input": ["text"],  // 支持输入类型(文本)
            "contextWindow": 262144,  // 上下文窗口大小(qwen3-max的最大支持值)
            "maxTokens": 65536  // 最大输出Token数(可根据需求调整)
          }
        ]
      }
    }
  },
  "agents": {
    "defaults": {
      "workspace": "C:\\Users\\Administrator\\.openclaw\\workspace",
      "compaction": {
        "mode": "safeguard"
      },
      "maxConcurrent": 4,
      "subagents": {
        "maxConcurrent": 8
      },
      "model": {
        "primary": "bailian/qwen3-max-2026-01-23"  // 设置qwen-max为默认模型(格式:provider/modelID)
      },
      "models": {
        "bailian/qwen3-max-2026-01-23": {}  // 启用该模型(必须与primary一致)
      }
    }
  },
  "tools": {
    "profile": "coding"
  },
  "messages": {
    "ackReactionScope": "group-mentions"
  },
  "commands": {
    "native": "auto",
    "nativeSkills": "auto",
    "restart": true,
    "ownerDisplay": "raw"
  },
  "session": {
    "dmScope": "per-channel-peer"
  },
  "gateway": {
    "port": 18789,
    "mode": "local",
    "bind": "loopback",
    "auth": {
      "mode": "token",
      "token": "7ed87de72551d546326f707c493e53a21425e20db7172d1b"
    },
    "tailscale": {
      "mode": "off",
      "resetOnExit": false
    },
    "nodes": {
      "denyCommands": [
        "camera.snap",
        "camera.clip",
        "screen.record",
        "contacts.add",
        "calendar.add",
        "reminders.add",
        "sms.send"
      ]
    }
  },
  "meta": {
    "lastTouchedVersion": "2026.3.8",
    "lastTouchedAt": "2026-03-10T13:33:13.111Z"
  }
}

然后打开浏览器就可以聊天了

相关推荐
豆浆煮粉21 小时前
Ubuntu虚拟机对USB设备无响应且Windows主机设备管理器显示警告
windows·ubuntu
Python私教1 天前
HermesAgent 终端工具 Windows 兼容性修复实战:两个 Bug 的排查与解决
windows·bug
spencer_tseng1 天前
redis.windows.conf 2026.04.27
windows·redis
半拉老头1 天前
修复u盘提示格式化一例
windows
IOT那些事儿1 天前
Windows PowerShell配置Qt5编译运行环境
windows·powershell·qt5
醇氧1 天前
WSL2(Windows Subsystem for Linux ) 从入门到实践指南
linux·运维·服务器·windows·学习
Python私教1 天前
HermesAgent 在 Windows 原生环境安装运行指南
windows
H Journey1 天前
Windows + VSCode + CMake 编译
windows·vscode·cmake
KivenMitnick1 天前
CialloVOL 1.2:便捷好用的轻量化内存取证分析平台
windows·python·安全·网络安全·flask·系统安全·安全威胁分析
阿昭L1 天前
使用内核对象进行线程同步
windows·线程同步