skills/disabled/openclaw-config/SKILL.md
# OpenClaw 配置全局规范 ## 概述 本文档定义了 OpenClaw 配置的标准规范,确保所有配置修改都正确、安全、可追溯。 **版本**: OpenClaw 2026.2.1 **最后更新**: 2026-02-02 --- ## 📁 配置文件结构 ### 主要配置文件 | 文件路径 | 用途 | 格式 | |---------|------|------| | `~/.openclaw/openclaw.json` | 主配置文件 | JSON5 | | `~/.openclaw/agents/main/agent/models.json` | Agent 模型配置 | JSON | | `~/.openclaw/agents/main/agent/auth-profiles.json` | API 密钥和认证 | JSON | | `~/.openclaw/agents/main/agent/agent.json` | Agent 特定配置 | JSON | ### 配置文件层级 ``` ~/.openclaw/ ├── openclaw.json
npx skillsauth add aaaaqwq/claude-code-skills skills/disabled/openclaw-configInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
本文档定义了 OpenClaw 配置的标准规范,确保所有配置修改都正确、安全、可追溯。
版本: OpenClaw 2026.2.1 最后更新: 2026-02-02
| 文件路径 | 用途 | 格式 |
|---------|------|------|
| ~/.openclaw/openclaw.json | 主配置文件 | JSON5 |
| ~/.openclaw/agents/main/agent/models.json | Agent 模型配置 | JSON |
| ~/.openclaw/agents/main/agent/auth-profiles.json | API 密钥和认证 | JSON |
| ~/.openclaw/agents/main/agent/agent.json | Agent 特定配置 | JSON |
~/.openclaw/
├── openclaw.json # 主配置(Gateway + Channels + Agents)
├── .env # 环境变量(可选)
├── agents/
│ └── main/
│ └── agent/
│ ├── models.json # 模型定义
│ ├── auth-profiles.json # 认证配置
│ └── agent.json # Agent 配置
├── credentials/
│ └── whatsapp/ # WhatsApp 认证
└── logs/ # 日志目录
# 查看配置
openclaw config get <path>
# 设置配置
openclaw config set <path> <value>
# 删除配置
openclaw config unset <path>
# 模型相关
openclaw models set <provider/model>
openclaw models fallbacks add <provider/model>
openclaw models aliases set <alias> <provider/model>
# 获取配置(包含 hash)
openclaw gateway call config.get --params '{}'
# 部分更新(推荐)
openclaw gateway call config.patch --params '{
"raw": "{ channels: { telegram: { enabled: true } } }",
"baseHash": "<hash-from-config.get>"
}'
# 完整替换(谨慎使用)
openclaw gateway call config.apply --params '{
"raw": "<完整配置>",
"baseHash": "<hash>"
}'
⚠️ 注意事项:
cp ~/.openclaw/openclaw.json ~/.openclaw/openclaw.json.bakopenclaw doctoropenclaw gateway restart{
// 元数据(自动管理)
"meta": {
"lastTouchedVersion": "2026.2.1",
"lastTouchedAt": "2026-02-02T12:00:00.000Z"
},
// 环境变量
"env": {
"vars": {
"OPENROUTER_VIP_API_KEY": "sk-xxx",
"ZAI_API_KEY": "xxx"
}
},
// 认证配置
"auth": {
"profiles": {
"github-copilot:github": {
"provider": "github-copilot",
"mode": "token"
},
"zai:default": {
"provider": "zai",
"mode": "api_key"
}
}
},
// 模型配置
"models": {
"mode": "merge",
"providers": {
"<provider-name>": {
"baseUrl": "https://api.example.com",
"apiKey": "sk-xxx",
"auth": "api-key", // api-key | oauth | token
"api": "anthropic-messages", // anthropic-messages | openai-completions
"models": [
{
"id": "model-id",
"name": "Display Name",
"reasoning": false,
"input": ["text"], // text | image
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 200000,
"maxTokens": 8192
}
]
}
}
},
// Agent 配置
"agents": {
"defaults": {
"model": {
"primary": "provider/model",
"fallbacks": ["provider/model2", "provider/model3"]
},
"models": {
"provider/model": {
"alias": "shortname"
}
},
"workspace": "/home/aa/clawd",
"compaction": {
"mode": "safeguard"
},
"maxConcurrent": 4,
"subagents": {
"maxConcurrent": 8
}
}
},
// 消息配置
"messages": {
"ackReactionScope": "group-mentions",
"queue": {
"mode": "collect",
"debounceMs": 1000,
"cap": 20
}
},
// 命令配置
"commands": {
"native": "auto",
"nativeSkills": "auto"
},
// 钩子配置
"hooks": {
"internal": {
"enabled": true,
"entries": {
"boot-md": { "enabled": true },
"command-logger": { "enabled": true },
"session-memory": { "enabled": true }
}
}
},
// 通道配置
"channels": {
"whatsapp": {
"dmPolicy": "allowlist",
"selfChatMode": true,
"allowFrom": ["+xxx"],
"groupPolicy": "allowlist",
"mediaMaxMb": 50
},
"telegram": {
"enabled": true,
"dmPolicy": "allowlist",
"botToken": "xxx:xxx",
"allowFrom": ["user_id"],
"groupPolicy": "allowlist",
"streamMode": "partial"
}
},
// Gateway 配置
"gateway": {
"port": 18789,
"mode": "local",
"bind": "loopback",
"auth": {
"mode": "token",
"token": "xxx"
},
"tailscale": {
"mode": "off",
"resetOnExit": false
}
},
// Skills 配置
"skills": {
"install": {
"nodeManager": "npm"
}
},
// 插件配置
"plugins": {
"entries": {
"whatsapp": { "enabled": true },
"telegram": { "enabled": true }
}
}
}
# CLI 方式(推荐)
openclaw models set anapi/opus-4.5
# 验证
openclaw models status
openclaw models aliases set opus45 anapi/opus-4.5
openclaw models fallbacks add <provider>/glm-4.7
openclaw models fallbacks add github-copilot/claude-sonnet-4-5
在 ~/.openclaw/openclaw.json 的 models.providers 中添加:
"<provider-name>": {
"baseUrl": "https://api.example.com",
"apiKey": "sk-xxx",
"auth": "api-key",
"api": "anthropic-messages", // 或 "openai-completions"
"models": [
{
"id": "model-id",
"name": "Model Name",
"reasoning": false,
"input": ["text"],
"contextWindow": 200000,
"maxTokens": 8192
}
]
}
"channels": {
"telegram": {
"enabled": true,
"botToken": "BOT_TOKEN",
"dmPolicy": "allowlist",
"allowFrom": ["USER_ID"],
"groupPolicy": "allowlist",
"streamMode": "partial"
}
}
"channels": {
"whatsapp": {
"dmPolicy": "allowlist",
"selfChatMode": true,
"allowFrom": ["+PHONE_NUMBER"],
"groupPolicy": "allowlist",
"mediaMaxMb": 50
}
}
在修改任何配置前,必须确认:
${VAR_NAME}openclaw doctor 验证配置openclaw gateway restart 重启生效| 类型 | 存储位置 |
|------|---------|
| 模型 API Key | ~/.openclaw/openclaw.json → models.providers.<name>.apiKey |
| OAuth Token | ~/.openclaw/agents/main/agent/auth-profiles.json |
| 环境变量 | ~/.openclaw/.env 或 env.vars |
{
"models": {
"providers": {
"custom": {
"apiKey": "${CUSTOM_API_KEY}"
}
}
}
}
# 查看详细错误
openclaw doctor
# 自动修复
openclaw doctor --fix
# 检查状态
openclaw gateway status
# 查看日志
openclaw logs
# 强制重启
openclaw gateway restart --force
# 检查模型状态
openclaw models status
# 检查认证
openclaw models auth status
每次修改配置时,记录以下信息:
### 配置变更 - YYYY-MM-DD HH:MM
**修改内容**:
- 修改了 xxx
**修改原因**:
- 因为 xxx
**影响范围**:
- 影响 xxx 功能
**验证结果**:
- [ ] doctor 通过
- [ ] 功能测试通过
**回滚方法**:
- 恢复备份:`cp ~/.openclaw/openclaw.json.bak ~/.openclaw/openclaw.json`
| 版本 | 日期 | 变更 | |------|------|------| | 1.0 | 2026-02-02 | 初始版本 |
本规范由小a维护,确保所有配置修改都正确、安全、可追溯。
testing
通用自媒体文章自动发布工具。支持百家号、搜狐号、知乎、微信公众号、小红书、抖音号六个平台的自动化发布流程。使用Playwright自动化实现平台导航和发布,支持通过storageState管理Cookie实现账号切换。
development
# SKILL.md - Model Configuration Status (mcstatus) ## 触发条件 - `/mcstatus` 命令 - 用户询问模型配备、模型配置、model status、模型列表等 ## 功能 实时生成 Agent + Cron 的模型配置报告,展示当前所有 agent 的主模型/fallback链和所有 cron 任务的模型分配。 ## 执行步骤 ### Step 1: 收集 Agent 模型配置 读取各 agent 的 models.json 获取主模型和 fallback 链: ```bash for agent in main ops code quant data research content market finance pm law product sales batch; do config=$(cat ~/.openclaw/agents/$agent/agent/models.json 2>/dev/null) if [ -n "$config" ]; then echo "=== $agent
tools
MCP 服务器智能管理助手。自动检测 MCP 可用性、智能开关、功能问答,提供人性化的 MCP 管理体验。
tools
从GitHub搜索并自动安装配置MCP(Model Context Protocol)服务器工具到Claude配置文件。当用户需要安装MCP工具时触发此技能。工作流程:搜索GitHub上的MCP项目 -> 提取npx配置 -> 添加到~/.claude.json -> 处理API密钥(如有)。