Clash 控制器 logo

Clash 控制器

Organization
OpenMinis
Clash 控制器

通过 Clash / mihomo RESTful API 实时监控和控制 Clash(含 Clash.Meta / mihomo 内核)。支持状态/连接/流量/规则查询、节点与策略组切换、节点测速、DNS 查询、配置重载。当用户提到 Clash、mihomo、切换节点、查看连接、实时流量、规则匹配、节点测速、Clash 控制器时使用。

Overview

PublisherOpenMinis
RepositoryMinisSkills
Skill nameClash 控制器
Stars
543
Forks
86
Bundled files
3
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 3 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by OpenMinis on GitHub. Read the source before you install it.

Installation

Install the Clash 控制器 AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/OpenMinis/MinisSkills/tree/main/clash-controller
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/OpenMinis/MinisSkills.git /tmp/MinisSkills
mkdir -p .claude/skills
cp -r /tmp/MinisSkills/clash-controller .claude/skills/openminis-clash
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Clash 控制器 in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Clash 控制器 on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Clash 控制器 is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Clash 控制器(Clash / mihomo RESTful API)

通过 clash-cli(封装 Clash RESTful API)在 Minis 内实时监控和控制 Clash / Mihomo。Clash 配置语法请参考官方文档,本文档只管运行态操作。

1. 入口授权(前提检查)

  • Clash 必须正在运行(VPN / 代理开启),external-controller 才会监听端口。未启动时 clash-cli 报「连接失败」。
  • 默认 API 地址 http://127.0.0.1:9090(本机 localhost)。
  • secret 从环境变量 CLASH_SECRET 读取;未设置则免认证直接访问。
  • 入口检查:clash-cli status 能返回版本、模式、内存、策略组即通过。
bash
clash-cli status
# mihomo 1.19.32  meta=True
# mode=rule  mixed-port=7890  tun=True stack=gVisor
# 内存 31MB  inuse=0KB
# 策略组 13 个:
#   PROXY → AUTO

2. 状态检查

命令说明
clash-cli status版本/模式/内存 + 所有策略组当前选择
clash-cli proxies列全部代理条目(含叶子节点与策略组)
clash-cli proxies <组>查看某策略组当前选择、类型、成员列表
clash-cli traffic [秒]实时流量 SSE(默认 3 秒,显示瞬时速率+累计)
clash-cli connections [N]活跃连接列表(host→策略组→命中规则→上下行),默认前 20
clash-cli configs当前运行配置(端口/tun/dns 等)
clash-cli rules [N]规则列表(默认前 10)

3. 常用任务

  • 查当前选中节点:clash-cli proxy get <组>(如 PROXY)
  • 切换节点/策略:clash-cli proxy set <组> <节点>(组内任意成员名,含 DIRECT)
    bash
    clash-cli proxy set PROXY DIRECT    # 直连
    clash-cli proxy set PROXY AUTO      # 切回自动测速组
  • 节点测速:clash-cli test <节点名> [url] [timeout_ms];对组内全部节点测速 clash-cli grouptest <组名> [url] [timeout_ms]
  • DNS 查询:clash-cli dns query <域名> [type](走 mihomo 内部 DNS,返回 Answer 数组)
  • 日志:clash-cli logs [秒数] [level](SSE,默认 3 秒)
  • 规则命中分析:mihomo 无 rule match 端点,看每连接命中规则用 clash-cli connections(最后一列显示匹配的规则名)

4. 影响边界(写操作)

  • 写操作:proxy set、conn close <id|all>、reload、PATCH /configs 会改变运行状态,执行前先确认目标名存在(proxy get)。
  • conn close all 会断开全部连接(SSH/下载会被打断)。
  • reload 重载配置可能导致短暂断线,配置改动应先备份再 reload。
  • 若配置文件含节点订阅密码等敏感信息,务必只备份到私有仓库,绝不推公共仓库。

5. 环境与安全注意事项

  • external-controller 默认绑定 127.0.0.1 即可本地访问。
  • 勿改 0.0.0.0 绑定(allow-lan: true 且无 secret 时,局域网内可被访问,有风险)。如确需远程访问,务必设置 secret。
  • 环境变量:CLASH_API(默认 http://127.0.0.1:9090)、CLASH_SECRET、CLASH_TIMEOUT(默认 8 秒)。
  • 切换节点时节点名必须与策略组成员精确匹配(含空格/emoji/特殊字符,如「🇭🇰香港trojan1」)。
  • 实测确认:mihomo 的 /traffic、/memory 是裸 JSON 流(无 data: 前缀),/logs 为标准 SSE,解析需兼容两种格式。

6. 社区 CLI 备选:mihomosh(可选)

mihomosh 是社区为 Mihomo 写的命令行工具包(Rust,MIT),可覆盖几乎全部外部控制 API,作为本技能自带 clash-cli 脚本的补充/对照实现。

  • 安装:GitHub Release 下载对应平台预编译二进制,解压后放 PATH(如 /usr/local/bin/mihomosh)。
  • 配置:~/.local/share/mihomosh/config.yaml
    • mihomo-api: http://127.0.0.1:9090(Clash 控制端口)
    • mihomo-path: <你的 clash 配置路径>(Clash 配置副本)
  • 常用命令:
    bash
    mihomosh proxy view        # 查看全部节点/策略组
    mihomosh proxy update     # 切换代理
    mihomosh proxy test        # 批量测速
    mihomosh rule view          # 查看规则
    mihomosh connection list    # 实时连接
    mihomosh inspect version    # 内核版本
  • 注意事项:
    • Clash 未运行时控制端口无监听,mihomosh 报 Connection refused,属正常(开着才能用)。
    • 社区 CLI 本质仍是 HTTP API 客户端包装,能力边界 = API 边界(如内核禁止的端点,mihomosh 同样做不到)。

7. 安装方式

clash-cli 是独立 Python3 脚本(仅标准库),但作为 Minis 技能使用时需放进技能目录才能被自动发现。按环境选一种:

① Minis 内自动安装(推荐) 把本技能的 SKILL.md 的 GitHub URL 粘贴到 Minis 对话,智能体会自动拉取安装:

https://github.com/openminis/MinisSkills/blob/main/clash-controller/SKILL.md

② git 克隆 + 软链(Minis 技能目录)

sh
git clone https://github.com/openminis/MinisSkills ~/.minis-skills
ln -s ~/.minis-skills/clash-controller ~/.minis/skills/clash-controller

iOS 上 Minis 技能目录实际为 /var/minis/skills;macOS/其他环境可能是 ~/.minis/skills 或对应配置路径,以 Minis 设置中显示的技能目录为准。

③ 手动解压 下载本技能目录(zip)后解压到技能目录:

sh
unzip clash-controller.zip -d ~/.minis/skills/

④ 仅用脚本(不装技能,任何有 Python3 的机器) scripts/clash-cli 可单独使用,只需本机运行着 Clash 且 external-controller 在监听:

sh
chmod +x clash-cli
./clash-cli status
# 远程/带 secret:
# export CLASH_API=http://<IP>:9090 CLASH_SECRET=<你的secret>
# ./clash-cli status

验证安装

sh
clash-cli status   # 返回版本/模式/策略组即成功;报「连接失败」说明 Clash 未运行或端口未开

参考资料(来源)

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Clash 控制器 AI skill do?

通过 Clash / mihomo RESTful API 实时监控和控制 Clash(含 Clash.Meta / mihomo 内核)。支持状态/连接/流量/规则查询、节点与策略组切换、节点测速、DNS 查询、配置重载。当用户提到 Clash、mihomo、切换节点、查看连接、实时流量、规则匹配、节点测速、Clash 控制器时使用。

Why use Clash 控制器 on TypingMind?

Because you install it once and use it with any model. Clash 控制器 is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Clash 控制器 in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/OpenMinis/MinisSkills/tree/main/clash-controller. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Clash 控制器?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Clash 控制器?

As many as you like. As long as a model supports skills, you can use Clash 控制器 with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Clash 控制器 AI skill free?

Yes. It is published on GitHub by OpenMinis under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇