OpenClaw部署
AI IDE:强烈建议安装,用于解决常见报错,可以选择以下任一种:Qoder、cursor、claude code、codex等。如果之前完全没使用过类似的,建议选用Qoder,中文支持较好,下载链接:AI Coding Assistant - Agentic Coding Platform | Qoder
并且后续可以直接和AI IDE对话,让它帮你进化openclaw
Windows部署
1.Qoder 安装
官网安装,Qoder - The Agentic Coding Platform
下载下来后安装,没有特殊需求一直下一步就好
选择skip
选择中文
注册/登录Qoder账号
配置中修改界面展示语言及AI回复语言
选择一个文件夹打开,到这一步安装就算结束了
2.OpenClaw安装
打开Qoder,点击右上角这里,会弹出输入框
依次输入以下命令,并回车(其中会有要求确认是否安装的弹窗,全部允许)最好打开
,不然会有点慢,或者可能出现网络问题:
Start-Process powershell -Verb RunAs
输入后湖回车,会打开窗口:
在蓝色框中执行以下代码:
winget source remove winget
winget source add -n winget https://mirrors.ustc.edu.cn/winget-source
winget source update
winget install --id Git.Git -e --source winget
winget install --id OpenJS.NodeJS -e --source winget
npm config set registry https://registry.npmmirror.com
npm install -g openclaw@latest
3.Openclaw设置
继续输入后回车:
openclaw onboard --install-daemon
会问你一些配置问题
按方向键上下键,选yes,回车
回车后继续选择QuickStart
选择skip for now:
继续选All providers
继续回车
选Skip for now,继续回车:
选择no
这里需要先空格,然后回车
上下键选择第二个:
回车,安装完成后就会打开网页了,但是此时还不能发起会话:
4.API设置
将以下内容告诉给AI IDE,让它帮你配置API:
选择新建文件
命名为api-configure-skill.md
在里面复制以下内容并粘贴:
api key配置
# OpenClaw Model Configuration
Interactive guide for configuring OpenClaw models.
## Usage
Users will provide a JSON configuration file in the following format:
```json
{
"models": {
"mode": "merge",
"providers": {
"bailian": {
"baseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1",
"apiKey": "<API_KEY>",
"api": "openai-completions",
"models": [
{
"id": "<MODEL_ID>",
"name": "<MODEL_ID>",
"reasoning": false,
"input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 128000,
"maxTokens": 8192
}
]
}
}
},
"agents": {
"defaults": {
"model": { "primary": "bailian/<MODEL_ID>" },
"models": { "bailian/<MODEL_ID>": {} }
}
},
"gateway": { "mode": "local" }
}
Step 1: Get Configuration
User provides the complete JSON configuration file. If not provided, ask for it.
Step 2: Write to Both Configuration Files
Write to both paths to ensure configuration consistency:
| File | macOS / Linux | Windows |
|---|---|---|
| models.json | ~/.openclaw/agents/main/agent/models.json |
%USERPROFILE%\.openclaw\agents\main\agent\models.json |
| openclaw.json | ~/.openclaw/openclaw.json |
%USERPROFILE%\.openclaw\openclaw.json |
File 1: models.json
Extract the models.providers section from user’s JSON:
{
"providers": {
"bailian": { ... }
}
}
File 2: openclaw.json
Use the complete JSON configuration provided by user.
Step 3: Execute Configuration Commands
macOS / Linux
# Write models.json
cat > ~/.openclaw/agents/main/agent/models.json << 'EOF'
<extracted providers config>
EOF
# Write openclaw.json
cat > ~/.openclaw/openclaw.json << 'EOF'
<user's complete config>
EOF
Windows (PowerShell)
# Write models.json
$modelsJson = @'
<extracted providers config>
'@
$modelsJson | Set-Content "$env:USERPROFILE\.openclaw\agents\main\agent\models.json" -Encoding UTF8
# Write openclaw.json
$openclawJson = @'
<user's complete config>
'@
$openclawJson | Set-Content "$env:USERPROFILE\.openclaw\openclaw.json" -Encoding UTF8
Step 4: Auto-Execute Post-Configuration Tasks (MANDATORY)
IMPORTANT: After writing configuration files, you MUST automatically execute ALL of the following commands in sequence. Do NOT just display them - actually run them using the terminal.
4.1 Restart Gateway (Required)
Restart the Gateway to apply the new configuration:
macOS / Linux:
openclaw gateway --force --port 18789
Windows (PowerShell):
openclaw gateway --force --port 18789
4.2 Verify Configuration (Required)
Test the configuration by sending a message:
macOS / Linux:
openclaw agent --session-id main --message "hello"
Windows (PowerShell):
openclaw agent --session-id main --message "hello"
4.3 Start Dashboard (Required)
Ask the user if they want to open the Dashboard. If yes, execute:
macOS / Linux:
openclaw dashboard
Windows (PowerShell):
openclaw dashboard
Reminder: All commands in Step 4 MUST be executed automatically after configuration. Never skip these steps.
Troubleshooting
Error: HTTP 401 - Invalid access token or token expired
Cause: Incorrect API Key or wrong baseUrl in configuration.
Solution:
- Verify the API Key is correct
- For Alibaba Cloud Bailian, use the correct endpoint:
NOThttps://dashscope.aliyuncs.com/compatible-mode/v1https://coding.dashscope.aliyuncs.com/v1 - Ensure both
models.jsonandopenclaw.jsonhave the same API Key
Error: Dashboard cannot connect / ERR_CONNECTION_REFUSED
Cause: Gateway service is not running.
Solution:
- Start the Gateway first:
openclaw gateway --port 18789 - Then open Dashboard:
openclaw dashboard
Error: Configuration changes not taking effect
Cause: Gateway needs to be restarted after configuration changes.
Solution:
openclaw gateway --force --port 18789
Error: Model not found / not available
Cause: Model ID does not exist in the provider’s supported models.
Solution:
- Check available models:
openclaw models list - Verify the model ID matches the provider’s official model name
Error: WebSocket disconnected / token_missing
Cause: Dashboard opened without authentication token.
Solution:
- Use the complete Dashboard URL with token:
openclaw dashboard - This will open the browser with the correct token in the URL
References
- OpenClaw Official Documentation
- OpenClaw Configuration Guide
- OpenClaw CLI Reference
- Models CLI
- Configure Command
- OpenClaw GitHub
前往以下表格:API KEY
注意!表格中的API KEY是共享的,为了避免被平台限流、禁用,大家最好选择未使用的,确认自己要使用这个之后,将下拉框换为已使用:
然后复制其中内容(不可用的话就换其他的试试,先别用deepseek的):
再新建一个文件:
命名为api-key.json
在里面粘贴刚刚从在线表格中复制的内容:
点击这里:
选择极致:
输入内容:
参考api-configure-skill.md帮我配置api-key.json中的内容
点击发送:
会帮你自动把api-key配置进去:
配置成功后,即可开始对话:
5.集成钉钉
5.1创建钉钉应用
钉钉开放平台
扫码登录
下载安装钉钉后打开,点击创建团队:
创建后登录钉钉开放平台,点击选择:
创建应用:
填写应用名称和应用描述,在应用图标上传图标,完成后点击保存:
5.2配置钉钉机器人
选择添加机器人:
选择配置:
5.3在控制台配置channel
5.4配置钉钉插件
在Qoder输入命令后回车:
openclaw plugins install @soimy/dingtalk
安装完成后在Qoder对话中要求配置:
```javascript
在openclaw.json 添加 dingtalk的 plugins.allow,参考:
{
"plugins": {
"enabled": true,
"allow": ["dingtalk"]
}
}
添加完成后,前端页面这里可以看到(不需要操作):
5.5配置channel
openclaw configure --section channels
回车
方向键,向下选择:
填入这里的client_id:
填入这里的client_secret:
执行命令:
openclaw gateway restart
5.6测试机器人
打开钉钉,进入群聊:
选择刚刚创建的机器人:
@机器人可以开始对话
6.集成飞书
6.1创建飞书应用
6.2导入权限
{
"scopes": {
"tenant": [
"aily:file:read",
"aily:file:write",
"application:application.app_message_stats.overview:readonly",
"application:application:self_manage",
"application:bot.menu:write",
"cardkit:card:write",
"contact:user.employee_id:readonly",
"corehr:file:download",
"docs:document.content:read",
"event:ip_list",
"im:chat",
"im:chat.access_event.bot_p2p_chat:read",
"im:chat.members:bot_access",
"im:message",
"im:message.group_at_msg:readonly",
"im:message.group_msg",
"im:message.p2p_msg:readonly",
"im:message:readonly",
"im:message:send_as_bot",
"im:resource",
"sheets:spreadsheet",
"wiki:wiki:readonly"
],
"user": ["aily:file:read", "aily:file:write", "im:chat.access_event.bot_p2p_chat:read"]
}
}
将上方代码放入:
6.3配置opencalw
在Qoder中输入:
openclaw plugins install @openclaw/feishu
openclaw channels add
方向键选择:
分别输入这里的APP ID和APP SECRET:
openclaw gateway restart
6.3配置事件订阅
搜索Message,添加所有:
6.4发布应用
随便填写:
6.5配置使用
发送对话,复制回复的这句:
在Qoder命令行中输入并回车:
再次发送消息:
7.部署常见问题
如果有任何弹窗,全都选允许
如果出现未知问题,可以描述问题或者把报错信息直接提供给qoder,让qoder帮忙解决:
修改API key配置之后,需要New session:
如果第二步遇到问题,可执行:
先执行:
Start-Process powershell -Verb RunAs
在蓝色框中执行以下代码:
winget source remove winget
winget source add -n winget https://mirrors.ustc.edu.cn/winget-source
winget source update
winget install --id Git.Git -e --source winget
winget install --id OpenJS.NodeJS -e --source winget
npm config set registry https://registry.npmmirror.com
WSL安装方式
搜搜powershell后输入:
wsl --install -d ubuntu
如果遇到如下报错:
则执行
wsl.exe --list --online
然后执行:
wsl.exe --install Ubuntu
输入小写名字
输入密码(输密码的时候是看不见的,这很正常)
在linux ubuntu中运行:
curl -fsSL https://openclaw.ai/install.sh | bash
以上如果执行失败(或者等的时间很久),则执行:
bash -c 'curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh | bash'
brew install node
npm config set registry https://registry.npmmirror.com
npm install -g openclaw@latest
openclaw onboard --install-daemon
相关文章: