@happytokenai/happy-router
v1.0.0
Published
Per-app proxy routing for Clash Verge Rev on macOS
Readme
Happy App Router
Per-app proxy routing for Clash Verge Rev on macOS. Web UI to select apps, assign proxy policies, and apply rules with one click.
🚀 Install with NPM
You can now install Happy App Router as a global command:
npm install -g @happytokenai/happy-routerAfter installation, you can use the command happy-router directly from anywhere in your terminal.
🖥️ Usage
Both CLI and Web UI are included and fully functional:
1. Web UI (Recommended)
Launch the beautiful, modern Web interface to manage all your rules visually:
happy-router --webAlternatively, use npx @happytokenai/happy-router --web without installing.
2. CLI Interface
Step-by-step interactive command line guide:
happy-router🛠️ Prerequisites
- macOS with Clash Verge Rev installed
- TUN mode enabled (required for per-process rules)
- Node.js 22+
📖 Key Features
- Pick an app — Search and select from all installed macOS applications.
- Pick a proxy — Choose a proxy group or individual node with live latency display.
- Modern Design — High-end UI with transparency effects, icon-only controls, and elegant animations.
- One-click Apply — Writes rules to
clash-verge.yamland hot-reloads via API automatically.
🚦 Routing Modes
| Mode | Behavior | |------|----------| | Append (追加规则) | Selected apps → proxy, other traffic follows original Clash rules. | | Exclusive (仅选中直连) | Selected apps → proxy, ALL other traffic goes DIRECT. |
📦 Development & Testing
If you want to contribute or test changes locally:
Clone & Install:
git clone https://github.com/happytokenai/HappyRouter.git cd HappyRouter npm installLocal Linking (Development Mode): Link the package to your system to test the
happy-routercommand globally without publishing:npm linkNow, any changes you make in the code will be immediately reflected when you run
happy-router.Running Interfaces:
- Web UI:
npm run web - CLI:
npm start - Desktop:
npm run electron
- Web UI:
🚢 Publishing to NPM
To publish a new version to the NPM registry:
Login (if not already):
npm login --registry https://registry.npmjs.orgUpdate Version: Increment the version in
package.json(e.g., from1.0.0to1.0.1).Publish:
npm publish --access public
⚠️ Important
- TUN mode must be enabled — PROCESS-NAME rules only work in TUN mode.
- Auto Backup — A backup of your
clash-verge.yamlis created before every change. - Safe Markers — Rules are wrapped in
# BEGIN/END HAPPY_APP_ROUTERmarkers for safe removal.
📄 License
MIT
