Rechercher

PythonReactSEOPDF
OpenClaw

Clash Auto Switch

clash auto switch

adminlove5200 installations selon la source☆ 0 Étoiles du dépôt

Installation

Suivez les instructions du dépôt pour votre agent. Consultez les fichiers et dépendances avant l’installation.

SkillHub CLI

skillhub install adminlove520/clash-auto-switch

Examinez la source et la compatibilité, puis suivez les étapes d’installation.

Donnez le lien à votre agent et demandez-lui d’examiner instructions et dépendances avant d’expliquer les étapes.

Voir la source ↗Guides

Instructions

clash-auto-switch

Clash 代理自动切换 Skill for OpenClaw

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

配置

首次使用需要配置 Clash API:

# 设置 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 实现定时健康检查:

{
  "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. 如果不健康,测...

Informations sur la source

Source
github
Repository
openclaw/skills
Path
skills/adminlove520/clash-auto-switch
Version
—
Commit
5b487eac006d865a07426100718094acee2a586e
Source de classification
rules
Statut
active
Visibilité
public

Ces informations proviennent de l’analyse indexée et peuvent être anciennes. Vérifiez les fichiers actuels.

README

Clash Auto Switch

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

English | 中文

功能

  • ✅ 健康检查:测试当前代理连通性
  • ✅ 自动切换:检测到故障时自动切换到最佳节点
  • ✅ 区域优先:优先选择新加坡/日本/香港/美国节点
  • ✅ 手动切换:支持切换到指定节点或区域
  • ✅ 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 (推荐,跨平台)
# 安装依赖
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
/clash health    # 健康检查
/clash list     # 列出节点
/clash auto     # 自动切换
/clash status   # 查看状态
/clash sg       # 切换到新加坡

安装

OpenClaw Skill
npx clawdhub install clash-auto-switch
手动安装
# 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 并修改:

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

使用方法

Python 版本
# 列出所有代理组
python clash-switch.py --list

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

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

Contenu extrait

SKILL.md
# 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
# 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-...

Skills associés

OpenClaw

bambu-studio-ai

heyixuan2

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 pi...

OpenClaw

geo-optimization

capt-marbles

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 discove...

OpenClaw

0protocol

0isone

Agents can sign plugins, rotate credentials without losing identity, and publicly attest to behavior.

OpenClaw

0x0-messenger

eijiac24

Send and receive P2P messages using disposable numbers and PINs. No servers, no accounts. Use for human notifications, approval flows, and agent-to-agent communication.