Overview
What is Clash Verge CLI?
A tiny command-line launcher for Clash Verge on macOS. It does one thing: starts Clash Verge with elevated (root) privileges so the proxy can create a TUN interface.
On macOS, creating a virtual network interface (TUN/TAP) requires sudo. Clash Verge GUI normally asks for your password via a macOS dialog — but if you want to run it headlessly, from a script, or bypass the GUI prompt, you use this CLI wrapper.
Source files (4 total)
| File | Lines | Purpose |
|---|---|---|
index.js | 40 | Entry point — parses args, spawns the sudo process |
constants.js | 5 | Hardcoded app path and admin-helper path |
bin/clash-verge.js | 33 | Shebang wrapper for npx / global install |
package.json | 24 | npm metadata — bin entry, name, version |
How it works
- You run
clash-verge-cli(ornpx clash-verge-cli) - It reads the Clash Verge path from
constants.js - It spawns
sudo /path/to/clash-vergewith the required env vars for TUN - Your terminal prompts for your macOS password (this is sudo, not the app)
- Clash Verge starts with TUN capability