← ClaudeAtlas

ai-native-mihomolisted

Use when setting up, migrating, or troubleshooting a mihomo (Clash Meta) proxy stack in an AI-native way on Linux: headless core + REST API as the agent control surface, rootless systemd + TUN via setcap, agent self-heal of network failures, or deciding GUI-wrapper vs headless. Also covers the CN-network download doctrine (mirrors, human-phone relay) and API-driven proxy control (switch nodes, health checks, reload, subscriptions). Not for picking airports/subscriptions (human business) or WireGuard-lane VPNs.
lizliz404/agent-skills · ★ 0 · AI & Automation · score 78
Install: claude install-skill lizliz404/agent-skills
# AI-native mihomo proxy stack ## The pattern Every GUI clash client (FlClash, Clash Verge Rev, ...) is a thin shell over the **mihomo core**. The AI-native move is to drop the shell and keep the core, because the core already exposes everything a GUI does as a **REST API** (`external-controller`). The GUI is a disposable human convenience; the API is the contract agents build on. ``` airport profile (yaml) ──security patch──▶ config.yaml ◀── mihomo binary (headless) │ │ (setcap: TUN without root) systemd --user service REST API 127.0.0.1:9090 │ │ TUN gvisor + auto-route agent: curl / jq / MCP ``` Properties that matter: - **Rootless**: `systemd --user` + file capabilities. No root-owned configs, so agents can manage everything without sudo. - **Declarative**: one yaml = whole state. Reproduce = copy 3 files. - **Observable**: every dial, rule match, and delay is one GET away. ## Security doctrine Assume every airport-exported config ships the same landmines until proven otherwise. Patch on ingestion, before first start: 1. `external-controller: 0.0.0.0:9090` → `127.0.0.1:9090`. With the default empty secret this is a LAN-open control API — anyone on the Wi-Fi owns your proxy. 2. `secret: ''` → `openssl rand -hex 12`. The secret is not a secret from the loca