name: openclaw-model-switch displayName: OpenClaw Model Switch - AI 模型切换 version: 1.0.1 description: | OpenClaw AI 模型切换技能 - 用自然语言切换和添加 AI 模型。 支持 9+ 预置提供商(Gemini/GPT/Claude/Qwen/Kimi 等),智能判断模型特性,一键配置 API Key。 自动备份配置,安全重启网关。 关键词:openclaw, model, switch, ai, multi-model, configuration, api license: MIT-0 acceptLicenseTerms: true tags: - openclaw - model - switch - multi-model - configuration - api-management - ai-providers - gemini - gpt - claude
用自然语言指令切换和添加 AI 模型。
use <model> - 切换到指定模型切换模型 - 进入交互式引导当前模型 - 查看当前模型新增模型 - 进入优化后的新增流程cd ~/.openclaw/workspace/skills
# 技能已安装在:~/.openclaw/workspace/skills/model-switch
chmod +x model-switch/scripts/*.py
就这么简单!所有脚本已包含,无需外部克隆。
# 切换模型
python3 scripts/switch-model.py gemini
# 新增模型(优化版)
python3 scripts/add-model-guide.py
# 查看模型列表
python3 scripts/check-status.py
本技能会修改 OpenClaw 配置文件:
读取:
- ~/.openclaw/openclaw.json - 主配置文件
- ~/.openclaw/workspace/skills/model-switch/config/models.json - 模型预设
写入:
- ~/.openclaw/openclaw.json - 更新模型配置和 API Key
- ~/.openclaw/openclaw.json.bak - 自动备份(切换前)
本技能会执行系统命令:
- openclaw gateway restart - 重启网关(应用新配置)
- openclaw gateway status - 检查网关状态
影响: - 重启期间服务短暂不可用(约 5-10 秒) - 正在进行的会话可能中断
API Key 存储方式:
- 位置: ~/.openclaw/openclaw.json
- 格式: 明文存储(未加密)
- 权限: 取决于文件权限(建议 chmod 600)
安全建议:
1. 备份配置文件:cp ~/.openclaw/openclaw.json ~/.openclaw/openclaw.json.bak
2. 设置文件权限:chmod 600 ~/.openclaw/openclaw.json
3. 不要将配置文件提交到 Git
4. 如需要更安全的存储,手动编辑 openclaw.json 并使用外部密钥管理
openclaw gateway restart 会触发网络请求小葱技能站7w4.net每天更新,海量AI技能等你发现。
~/.openclaw/openclaw.jsonchmod 600)作者: @williamwg2025
版本: 1.0.1
许可证: MIT-0
这是一款实用的模型切换工具,能帮助用户快速在 Gemini、GPT、Claude 等模型间切换,配有详细的中文文档和安全提示。它的一大亮点是会自动备份配置、验证网关状态,用起来比较放心。不过实际支持的模型数量比宣传的少一些,而且缺少自动化测试,长远使用可能存在隐患。适合需要频繁换模型、对配置有一定了解的用户。