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/agi-super-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
AI驱动的智能浏览器自动化工具。使用LLM理解页面并自动执行任务,比传统Playwright更智能、更省token。适用于复杂交互、动态页面、需要智能决策的浏览器操作。Chrome浏览器优先。
tools
网页登录态管理。使用 fast-browser-use (fbu) 管理各平台登录状态,定期检查可用性,新平台授权时自动保存 profile。
development
Monitor and report on API provider quotas, balances, and usage. Query official providers (Moonshot, DeepSeek, xAI, Google AI Studio) and relay/proxy providers (Xingjiabiapi, Aixn, WoW) via their billing APIs. Also checks subscription services (Brave Search, OpenRouter). Generates quota reports. Triggers on "查额度", "API余额", "quota check", "billing report", "api balance", "供应商额度", "中转站余额", "费用报告", "check balance", "how much credit".
development
# A股基金监控 Skill A股基金净值监控,支持实时估值和盘后净值,自动判断交易日/节假日。 ## 用法 ### 快速监控(命令行) ```bash # 默认配置,输出到控制台 bash ~/clawd/skills/a-fund-monitor/scripts/monitor.sh # 推送到群(使用--push参数) bash ~/clawd/skills/a-fund-monitor/scripts/monitor.sh --push # 监控指定基金 bash ~/clawd/skills/a-fund-monitor/scripts/monitor.sh --codes "000979 002943" ``` ### Agent调用 ``` 执行A股基金监控任务。 1. 读取配置文件: ~/clawd/skills/a-fund-monitor/config.json 2. 获取实时净值数据 3. 非交易日自动切换为简短报告 配置文件格式: { "funds": [ {"code": "000979", "name": "景顺长城沪港深精选股票