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"
}
}
然后打开浏览器就可以聊天了