# Common Services

## mihomo (Clash proxy)
```bash
SVC_DESC="Clash/Mihomo 代理引擎"
SVC_PORT="7890 (代理) / 9090 (API)"
SVC_PID_PATTERN="mihomo -d"
SVC_START="cd ~/clash && exec ./mihomo -d config"
SVC_HEALTH="curl -s http://127.0.0.1:9090/version"
```

## yacd (Clash Web UI)
```bash
SVC_DESC="Clash Web 管理面板"
SVC_PORT="9091"
SVC_PID_PATTERN="http.server 9091"
SVC_START="cd ~/clash/yacd && exec python3 -m http.server 9091 --bind 0.0.0.0"
SVC_HEALTH="curl -s http://127.0.0.1:9091/ -o /dev/null -w '%{http_code}'"
```

## Hermes Gateway
```bash
SVC_DESC="Hermes 网关 (Telegram/QQ/Webhook)"
SVC_PORT="8644"
SVC_PID_PATTERN="hermes_cli.main gateway run"
SVC_START="cd ~ && exec hermes gateway run 2>&1"
SVC_HEALTH="ss -tlnp | grep -q 8644"
```

## Hermes Dashboard
```bash
SVC_DESC="Hermes 仪表盘 (Web UI)"
SVC_PORT="9119"
SVC_PID_PATTERN="hermes dashboard"
SVC_START="cd ~ && exec hermes dashboard --host 192.168.199.241 --insecure 2>&1"
SVC_HEALTH="curl -s http://192.168.199.241:9119/ -o /dev/null -w '%{http_code}'"
```

## OpenClaw Gateway
```bash
SVC_DESC="OpenClaw 旧网关"
SVC_PORT="18789"
SVC_PID_PATTERN="openclaw/dist/index.js gateway"
SVC_START="/www/server/nodejs/v22.20.0/bin/node /home/openclaw/.npm-global/lib/node_modules/openclaw/dist/index.js gateway --port 18789 2>&1"
SVC_HEALTH="curl -s http://127.0.0.1:18789/ -o /dev/null -w '%{http_code}'"
```

## Node.js app
```bash
SVC_DESC="My Node App"
SVC_PORT="3000"
SVC_PID_PATTERN="node.*server.js"
SVC_START="cd ~/myapp && exec node server.js"
SVC_HEALTH="curl -s http://127.0.0.1:3000/health"
```

## Python Flask/FastAPI
```bash
SVC_DESC="Python Web App"
SVC_PORT="5000"
SVC_PID_PATTERN="uvicorn main:app"
SVC_START="cd ~/myapp && exec uvicorn main:app --host 0.0.0.0 --port 5000"
SVC_HEALTH="curl -s http://127.0.0.1:5000/docs"
```
