OpenClaw 配置文件 openclaw.json 完整參數(shù)說明
發(fā)布時(shí)間:2026-04-13 11:07:24 作者:SP八岐大兔
我要評(píng)論
文章詳細(xì)介紹了OpenClaw配置文件openclaw.json的各項(xiàng)參數(shù)配置,包括系統(tǒng)版本信息、配置向?qū)в涗洝⒄J(rèn)證方式、模型服務(wù)配置、智能體默認(rèn)配置、工具集配置、命令權(quán)限、會(huì)話策略、日志鉤子、飛書通道配置、網(wǎng)關(guān)服務(wù)配置和插件配置等內(nèi)容,感興趣的朋友一起看看吧
注:修改配置后必須執(zhí)行:openclaw gateway restart
編輯配置文件命令:
nano ~/.openclaw/openclaw.json
1. meta 配置段
"meta": {
"lastTouchedVersion": "2026.3.13",
"lastTouchedAt": "2026-03-16T05:36:26.133Z"
}說明
- lastTouchedVersion:OpenClaw 版本號(hào)
- lastTouchedAt:配置最后修改時(shí)間
- 系統(tǒng)自動(dòng)生成,禁止手動(dòng)修改
2. wizard 配置段
"wizard": {
"lastRunAt": "2026-03-16T05:10:35.535Z",
"lastRunVersion": "2026.3.13",
"lastRunCommand": "configure",
"lastRunMode": "local"
}
說明
- 記錄配置向?qū)ё詈筮\(yùn)行信息
- 無需修改,系統(tǒng)自動(dòng)維護(hù)
3. auth 認(rèn)證配置段
"auth": {
"profiles": {
"minimax:cn": {
"provider": "minimax",
"mode": "api_key"
},
"ollama:local": {
"provider": "ollama",
"mode": "api_key"
}
}
}
說明
- 定義模型服務(wù)商的認(rèn)證方式
- minimax:云端千問模型,API Key 認(rèn)證
- ollama:本地模型,模擬認(rèn)證
- mode 可選值:api_key / none
4. models 模型服務(wù)配置(核心)
"models": {
"mode": "merge",
"providers": {
"minimax": {
"baseUrl": "https://api.minimaxi.com/anthropic",
"api": "anthropic-messages",
"authHeader": true,
"models": [
{
"id": "MiniMax-M2.5",
"name": "MiniMax M2.5",
"reasoning": true,
"input": [
"text"
],
"cost": {
"input": 0.3,
"output": 1.2,
"cacheRead": 0.03,
"cacheWrite": 0.12
},
"contextWindow": 200000,
"maxTokens": 8192
}
]
},
"ollama": {
"baseUrl": "http://127.0.0.1:11434",
"api": "ollama",
"apiKey": "ollama-local",
"authHeader": true
}
}
}說明
- mode:模型加載策略
- merge:合并所有服務(wù)商模型(默認(rèn))
- override:僅使用配置內(nèi)模型
- ollama.baseUrl:Ollama 本地地址(固定 127.0.0.1:11434)
- ollama.apiKey:本地任意填寫,無需真實(shí)密鑰
5. agents 智能體默認(rèn)配置(最常改)
"agents": {
"defaults": {
"model": {
"primary": "ollama/qwen2.5:7b",
"fallbacks": ["minimax/MiniMax-M2.5"]
},
"models": {
"minimax/MiniMax-M2.5": {
"alias": "Minimax"
},
"ollama/qwen2.5:7b": {
"alias": "Ollama-Qwen"
}
},
"workspace": "/home/ubuntu24/.openclaw/workspace"
}
}
說明
- primary:默認(rèn)使用模型
- ollama/qwen2.5:7b = 本地Ollama模型
- minimax/MiniMax-M2.5 = 云端模型
- fallbacks:主模型不可用時(shí)自動(dòng)切換
- alias:模型顯示別名,可自定義
- workspace:文件操作工作目錄,可修改
6. tools 工具集配置
"tools": {
"profile": "coding"
}
說明
- 工具集類型
- 可選值:coding / basic / full
7. commands 命令權(quán)限配置
"commands": {
"native": "auto",
"nativeSkills": "auto",
"restart": true
}
說明
- native:系統(tǒng)命令執(zhí)行權(quán)限
- auto:智能判斷(默認(rèn))
- allow:允許
- deny:禁止
- restart:崩潰自動(dòng)重啟(true/false)
8. session 會(huì)話策略配置
"session": {
"dmScope": "per-channel-peer"
}
說明
- 會(huì)話上下文隔離策略
- 可選值:
- per-channel-peer:按對(duì)話場(chǎng)景獨(dú)立(推薦)
- global:全局共享會(huì)話
9. hooks 日志鉤子配置
"hooks": {
"internal": {
"enabled": true,
"entries": {
"command-logger": {
"enabled": true
}
}
}
}
說明
- 系統(tǒng)內(nèi)部日志鉤子
- command-logger:命令日志記錄
- 默認(rèn)開啟即可,無需修改
10. channels 飛書通道配置
"channels": {
"feishu": {
"enabled": true,
"connectionMode": "websocket",
"verificationToken": "xxxxxxxxxxx",
"dmPolicy": "pairing",
"accounts": {
"main": {
"appId": "xxxxxxxxxxxxx",
"appSecret": "xxxxxxxxxxxx",
"botName": "xxxxxxx"
}
}
}
}
說明
- enabled:是否啟用飛書機(jī)器人(true/false)
- botName:機(jī)器人顯示名稱,可修改
- appId / appSecret 禁止修改
11. gateway 網(wǎng)關(guān)服務(wù)配置
"gateway": {
"port": 18789,
"mode": "local",
"bind": "loopback",
"auth": {
"mode": "token",
"token": "xxxx"
},
"tailscale": {
"mode": "off",
"resetOnExit": false
},
"nodes": {
"denyCommands": [
"camera.snap",
"camera.clip",
"screen.record",
"contacts.add",
"calendar.add",
"reminders.add",
"sms.send"
]
}
}
說明
- port:網(wǎng)關(guān)端口,可自定義
- mode:訪問范圍
- local:僅本機(jī)訪問
- network:局域網(wǎng)可訪問
- auth.mode:認(rèn)證方式
- token:令牌認(rèn)證(安全)
- none:無認(rèn)證
12. plugins 插件配置
"plugins": {
"entries": {
"feishu": {
"enabled": true
}
}
}
說明
- 插件開關(guān)
- feishu.enabled:飛書插件啟用/禁用
? 修改配置后必須執(zhí)行
openclaw gateway restart
到此這篇關(guān)于OpenClaw 配置文件 openclaw.json 完整參數(shù)說明的文章就介紹到這了,更多相關(guān)OpenClaw 配置文件 openclaw.json 內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持腳本之家!
相關(guān)文章
這篇文章主要介紹了OpenClaw CLI 和配置文件參考完整指南,本指南全面涵蓋了這兩方面,首先介紹配置文件:格式、結(jié)構(gòu)以及每個(gè)主要部分的示例,需要的朋友可以參考下2026-03-23
OpenClaw 使用 JSON/JSON5 格式的配置文件來管理系統(tǒng)所有組件的設(shè)置,支持靈活的配置覆蓋、環(huán)境變量注入、多配置文件合并、熱重載等功能,本文就來詳細(xì)的介紹一下OpenClaw主2026-03-10



