返回顶部
c

clash-verge-auto-switchClash自动切换

Use when the user wants Codex to speed test Clash Verge Rev or Mihomo proxies, auto-detect currently used Clash groups from the live controller, switch a selector group to the fastest working node, diagnose controller connectivity, or install a macOS launchd job with a user-chosen interval.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
89
下载量
免费
免费
1
收藏
概述
安装方式
版本历史

clash-verge-auto-switch

Clash Verge 自动切换

此技能为Codex提供了一套在macOS上可靠切换Clash Verge Rev和Mihomo代理的工作流程。它适用于希望从选择器组中选定具体节点,而非仅依赖被动健康检查的用户。

使用场景

当用户提出以下请求时使用此技能:

  • - 对Clash Verge或Mihomo节点进行速度测试
  • 将当前使用的Clash选择器组切换至最快节点
  • 诊断无法连接Clash控制器的原因
  • 在macOS上安装或移除定时自动切换任务

快速开始

运行主脚本:

bash
/usr/bin/python3 ~/.codex/skills/clash-verge-auto-switch/scripts/switch_fastest.py

默认情况下,它会从运行中的Clash控制器自动发现当前活跃的选择器链。如需查看发现结果:

bash
/usr/bin/python3 ~/.codex/skills/clash-verge-auto-switch/scripts/switch_fastest.py --list-groups

指定目标组:

bash
/usr/bin/python3 ~/.codex/skills/clash-verge-auto-switch/scripts/switch_fastest.py \
--group Proxy \
--group ChatGPT

仅模拟运行,不实际更改选择:

bash
/usr/bin/python3 ~/.codex/skills/clash-verge-auto-switch/scripts/switch_fastest.py --dry-run

工作流程

  1. 1. 检查Mihomo控制器是否可达。
  2. 若用户未指定目标组,则检查运行中的/proxies树,从当前活跃选择链自动发现组。
  3. 将url-test、fallback和load-balance组展开为叶子节点,但除非用户明确指定,否则不重写嵌套的选择器组。
  4. 通过控制器延迟API测试候选节点,并将选择器组切换至延迟最低的健康节点。
  5. 报告获胜节点、测量延迟以及是否发生切换。

组发现

  • - 默认模式为--group-scope current,即跟随运行中Clash代理树的当前选择链。
  • 如需从当前控制器会话中发现所有顶级选择器组,使用--group-scope top-level。
  • 如需发现当前Clash实例中的每一个选择器组,使用--group-scope all。
  • 当用户需要精确控制时,使用显式的--group标志。

定时任务

如需在macOS上设置自定义分钟级定时任务,请使用附带的launchd安装程序,而非Codex自动化功能,因为Codex的周期性调度仅支持小时级间隔。

安装:

bash
~/.codex/skills/clash-verge-auto-switch/scripts/installlaunchagent.sh \
--interval-minutes 30 \
--group-scope current

移除:

bash
~/.codex/skills/clash-verge-auto-switch/scripts/uninstalllaunchagent.sh

注意事项

  • - 如需通用的控制器发现和组检测规则,请阅读runtime-notes.md
  • 如果控制器离线,请询问用户是否应先打开Clash Verge,或使用--launch-if-needed参数运行脚本。

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 clash-verge-auto-switch-1776024981 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 clash-verge-auto-switch-1776024981 技能

通过命令行安装

skillhub install clash-verge-auto-switch-1776024981

下载

⬇ 下载 clash-verge-auto-switch v1.0.0(免费)

文件大小: 9.29 KB | 发布时间: 2026-4-13 09:43

v1.0.0 最新 2026-4-13 09:43
- Initial release of clash-verge-auto-switch.
- Enables speed testing of Clash Verge Rev and Mihomo proxy nodes.
- Automatically discovers and switches selector groups to the fastest working proxy on macOS.
- Diagnoses controller connectivity issues and offers troubleshooting.
- Adds install/uninstall scripts for setting up an automatic switch job using macOS launchd with user-defined intervals.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部