TopRank Skills

Home / Claw Skills / Git / GitHub / Clash Auto Switch
Official OpenClaw rules 36%

Clash Auto Switch

clash auto switch

Stars

0

Installs

0

Status

ACTIVE

Visibility

PUBLIC

安装方式

直接复制以下提示词,发送给你的 AI 助手即可完成安装。

请先检查是否已安装 SkillHub 商店,若未安装,请根据 https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/skillhub.md 安装 SkillHub 商店,然后安装 Clash Auto Switch 技能。 若已安装,则直接安装 Clash Auto Switch 技能。

Overview

Skill Key
adminlove520/clash-auto-switch
Author
adminlove520
Source Repo
openclaw/skills
Version
-
Source Path
skills/adminlove520/clash-auto-switch
Latest Commit SHA
5b487eac006d865a07426100718094acee2a586e

Extracted Content

SKILL.md excerpt

# clash-auto-switch

> Clash 代理自动切换 Skill for OpenClaw

自动检测代理健康状态并在故障时自动切换到最佳节点。

## 配置

首次使用需要配置 Clash API:

```bash
# 设置 API 地址和密钥
/clash config set --api http://127.0.0.1:58871 --secret 你的密钥
```

或通过环境变量:
- `CLASH_API`: Clash API 地址
- `CLASH_SECRET`: API 密钥
- `CLASH_PROXY`: 代理地址 (默认: http://127.0.0.1:7890)

## 功能

### 健康检查

检查当前代理是否正常工作:

```
/clash health
```

返回示例:
```
✓ 代理健康 (3/3)
- Telegram: OK
- Google: OK
- Anthropic: OK
```

### 列出节点

查看所有代理组和可用节点:

```
/clash list
```

### 自动切换

自动检测并切换到最佳节点:

```
/clash auto
```

逻辑:
1. 测试 Telegram / Google / Anthropic 连通性
2. 如果不健康,遍历所有节点
3. 测试延迟,优先选择新加坡/日本/香港/美国节点
4. 切换到最佳节点

### 手动切换

切换到指定节点:

```
/clash switch ChatGPT 新加坡-优化-Gemini-GPT
```

### 区域切换

快速切换到指定区域:

```
/clash sg    # 切换到新加坡
/clash us    # 切换到美国
/clash jp    # 切换到日本
/clash hk    # 切换到香港
```

### 状态查询

查看当前代理状态:

```
/clash status
```

## 在 Cron 中使用

添加到 cron job 实现定时健康检查:

```json
{
  "name": "clash-health-check",
  "schedule": {
    "kind": "every",
    "everyMs": 900000
  },
  "payload": {
    "kind": "agentTurn",
    "message": "/clash auto"
  },
  "sessionTarget": "isolated"
}
```

## 在 Heartbeat 中使用

在 heartbeat 中添加健康检查:

```
# 在 HEARTBEAT.md 中添加
/clash health
```

## 支持的代理组

- ChatGPT
- Copilot
- GLOBAL
- Netflix
- Steam
- Telegram
- TikTok
- Twitter
- WhatsApp
- 境内使用
- 海外使用
- 节点选择
- 谷歌服务
- 微软服务
- 苹果服务

## 示例对话

**用户**: 检查代理状态  
**小溪**: 调用 `/clash health` → 返回健康度

**用户**: 代理好像很慢  
**小溪**: 调用 `/clash auto` → 自动切换到最佳节点

**用户**: 切换到新加坡节点  
**小溪**: 调用 `/clash sg` → 切换完成

## 实现原理

1. 调用 Clash API (`/proxies`) 获取所有代理组
2. 对每个 Selector 类型的代理组执行健康检查
3. 如果不健康,测...

README excerpt

# Clash Auto Switch

> 自动切换 Clash 代理节点的脚本工具,支持 Linux / macOS / Windows 和 OpenClaw Skill

[English](./README.md) | [中文](./README_zh.md)

## 功能

- ✅ 健康检查:测试当前代理连通性
- ✅ 自动切换:检测到故障时自动切换到最佳节点
- ✅ 区域优先:优先选择新加坡/日本/香港/美国节点
- ✅ 手动切换:支持切换到指定节点或区域
- ✅ OpenClaw Skill:支持在 OpenClaw 中直接调用

## 支持平台

| 平台 | 脚本 | 说明 |
|------|------|------|
| 🐧 Linux / macOS | `clash-switch.sh` | Bash 脚本 |
| 🐧 Linux / macOS | `clash-switch-v2.sh` | 增强版 (日志+状态) |
| 🪟 Windows | `clash-switch.ps1` | PowerShell 脚本 |
| 🌐 跨平台 | `clash-switch.py` | Python 脚本 (推荐) |
| 🤖 OpenClaw | Skill | `/clash` 命令 |

## 快速开始

### Python (推荐,跨平台)

```bash
# 安装依赖
pip install requests

# 设置环境变量
export CLASH_API="http://127.0.0.1:58871"
export CLASH_SECRET="your-secret"

# 列出代理组
python clash-switch.py --list

# 健康检查
python clash-switch.py --health

# 自动切换
python clash-switch.py --auto
```

### OpenClaw Skill

```bash
/clash health    # 健康检查
/clash list     # 列出节点
/clash auto     # 自动切换
/clash status   # 查看状态
/clash sg       # 切换到新加坡
```

## 安装

### OpenClaw Skill

```bash
npx clawdhub install clash-auto-switch
```

### 手动安装

```bash
# Clone 仓库
git clone https://github.com/adminlove520/clash-auto-switch.git
cd clash-auto-switch

# 使用 Python 版本
pip install requests
python clash-switch.py --help
```

## 配置

### 环境变量

| 变量 | 默认值 | 说明 |
|------|---------|------|
| `CLASH_API` | `http://127.0.0.1:58871` | Clash API 地址 |
| `CLASH_SECRET` | - | API 密钥 (必填) |
| `CLASH_PROXY` | `http://127.0.0.1:7890` | 代理地址 |

### 配置文件

复制 `config.example.sh` 为 `config.sh` 并修改:

```bash
CLASH_API="http://127.0.0.1:58871"
CLASH_SECRET="your-secret"
```

## 使用方法

### Python 版本

```bash
# 列出所有代理组
python clash-switch.py --list

# 健康检查
python clash-switch.py --health

# 自动切换到最佳节点
python clash-...

Related Claw Skills

heyixuan2

bambu-studio-ai

★ 41

Bambu Lab 3D printer control and automation. Activate when user mentions: printer status, 3D printing, slice, analyze model, generate 3D, AMS filament, print monitor, Bambu Lab, or any 3D printing task. Full pipeline: search → generate → analyze → colorize → preview → open BS → user slice → print → monitor. Supports all 9 Bambu Lab printers (A1 Mini, A1, P1S, P2S, X1C, X1E, H2C, H2S, H2D).

capt-marbles

geo-optimization

★ 1

Generative Engine Optimization (GEO) for AI search visibility. Optimize content to appear in ChatGPT, Perplexity, Claude, and Google AI Overviews. Use when optimizing websites, pages, or content for LLM discoverability and citation.

carlulsoe

parakeet-stt

★ 0

Local speech-to-text with NVIDIA Parakeet TDT 0.6B v3 (ONNX on CPU). 30x faster than Whisper, 25 languages, auto-detection, OpenAI-compatible API. Use when transcribing audio files, converting speech to text, or processing voice recordings locally without cloud APIs.

carlzhao007

feishu-process-feedback

★ 0

飞书消息自动处理与进度反馈技能。安装后后台运行,监听飞书任务消息并自动创建独立进程处理。 在处理前后发送实时进度反馈(任务确认、进度百分比、完成通知)。 支持任务类型识别、智能解析、错误重试、并发控制、状态持久化。 使用场景:飞书自动化工作流、任务进度追踪、批量任务处理、需要实时反馈的场景。

cartoonitunes

bottyfans

★ 0

BottyFans agent skill for autonomous creator monetization. Lets AI agents register, build a profile, publish posts (public, subscriber-only, or pay-to-unlock), upload media, accept USDC subscriptions and tips on Base, send and receive DMs, track earnings, and appear on the creator leaderboard. Use this skill when an agent needs to monetize content, interact with fans, manage a creator profile, handle payments in USDC, or operate as an autonomous creator on the BottyFans platform.

camopel

arxivkb

★ 0

Local arXiv paper manager with semantic search. Crawls arXiv categories, downloads PDFs, chunks content, and indexes with FAISS + Ollama embeddings. No cloud API keys required — everything runs locally.