Happ CLI (happ-windows-cli) is a high-performance, headless VPN client and interactive terminal application (TUI) for the Happ and Xray-core proxy ecosystem on Windows, Linux, and macOS.
Equipped with an interactive console TUI dashboard, native Windows Layer-3 Wintun TUN virtual adapter (happ-cli-tun), WinINet System Proxy switching, zero-leak DoH DNS subsystem, and persistent background daemon execution.
ΩΨ§Ψ±Ψ³Ϋ (Persian Guide) β’ Π ΡΡΡΠΊΠ°Ρ Π΄ΠΎΠΊΡΠΌΠ΅Π½ΡΠ°ΡΠΈΡ β’ Report Bug β’ Releases
- Overview
- Key Features
- 5-Second Windows Installation
- Interactive Terminal App (TUI Dashboard)
- Connection Modes: TUN vs System Proxy
- One-Line CLI Commands
- Architecture & Network Internals
- Linux & macOS Installation
- Building from Source
- Frequently Asked Questions (FAQ)
- Contributing & License
Developers, sysadmins, and power users often need a dependable, zero-lag VPN connection on headless servers, developer workstations, and development environments without dealing with bloated graphical interfaces.
Happ CLI bridges the gap by wrapping embedded Xray-core and sing-box engines into a lightweight, scriptable command-line interface:
- Persistent Background Daemon: Running
happ connectspawns an independent background daemon. Closing the terminal or shell never drops the VPN connection. - Layer-3 Wintun TUN Routing: Creates a virtual network adapter (
happ-cli-tun) that transparently tunnels 100% of Windows network traffic (browsers, Telegram, Discord, terminal commands, games) without requiring per-app proxy configuration. - Anti-DNS Poisoning & Sniffing: Completely eliminates local ISP DNS manipulation by intercepting UDP 53 (
hijack-dns), sniffing TLS/HTTP/QUIC headers, and resolving through encrypted Cloudflare and Google DoH endpoints.
- β‘ Ultra-Fast 1-Line Setup: Complete Windows installation in 5 seconds via automated PowerShell script.
- ποΈ Interactive Console Dashboard (TUI): Sleek, keyboard-driven terminal dashboard for server browsing, mode toggling, and ping benchmarks.
- π‘οΈ Layer-3 TUN & Proxy Modes: Instant switching between Wintun virtual adapter mode (full system) and WinINet System Proxy mode (browsers only).
- π Zero DNS Leaks: Built-in DNS hijacking on port 53 and encrypted remote DNS resolvers (
https+local://1.1.1.1/dns-query,8.8.8.8). - π Detached Daemon Supervisor: VPN stays running across multiple terminal sessions until explicitly disconnected.
- π Modern Protocol Support: Full support for VLESS (Reality, WebSocket, gRPC), VMess, Trojan, and Shadowsocks links.
- π Subscription Telemetry: Displays data quota consumed, remaining bandwidth, and account expiration dates.
- πΆ Live Latency Benchmarking: Fast TCPing latency measurements for individual servers or entire clusters.
Open PowerShell (preferably Run as Administrator to allow virtual adapter creation) and run:
powershell -c "irm https://raw.githubusercontent.com/Abeh995/happ-cli/main/windows/install.ps1 | iex"The installer verifies prerequisites, installs the happ binary globally into your system PATH, and synchronizes the Wintun driver.
Launch the interactive dashboard anywhere in your terminal:
happββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β HAPP VPN TERMINAL DASHBOARD β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Status: β CONNECTED (Background Daemon Running) β
β Connection: TUN Mode (Virtual Adapter: happ-cli-tun) β
β Active Server:#2 π©πͺ Frankfurt β
β Daemon PIDs: Xray: 14220 | TUN: 15304 β
β System Proxy: Disabled (Direct - Not needed in TUN) β
β Admin Privs: Yes (Elevated) β
β Total Nodes: 118 β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β [1] β‘ Connect (Start Background VPN) β
β [2] π Disconnect (Stop VPN & Revert Direct) β
β [3] π Select Server (Browse 118 servers) β
β [4] π Update Subscription (Refresh Servers) β
β [5] β Add New Subscription Link β
β [6] πΆ Ping Servers (Latency Test) β
β [7] π Switch Mode (Current: TUN) β
β [8] π View Detailed Status & Public IP β
β [0] πͺ Exit Terminal App (VPN stays connected!) β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Choose option [0-8]:
Happ CLI supports two distinct routing architectures:
| Dimension | TUN Mode (Recommended) | System Proxy Mode |
|---|---|---|
| Traffic Scope | 100% of all applications (Browsers, Telegram, Discord, CLI, Games) | Browsers and apps respecting Windows WinINet proxy |
| Network Layer | Layer 3 IP Packet Tunnel (happ-cli-tun via Wintun driver) |
Layer 7 Application Proxy (WinINet Internet Settings) |
| DNS Resolution | Intercepts UDP 53 (hijack-dns) β zero DNS leaks |
Encrypted DoH through local Xray core |
| Privileges | Requires Administrator terminal | Standard User (No admin required) |
# View current active mode:
happ mode
# Set default mode to TUN (Full system):
happ mode tun
# Set default mode to System Proxy (Browsers only):
happ mode proxyFor automated scripts, CI/CD, or users who prefer direct command-line execution:
| Command | Action Description |
|---|---|
happ |
Open interactive terminal dashboard (TUI) |
happ connect |
Connect to preferred node as a detached background daemon |
happ connect --tun |
Connect explicitly using Layer-3 TUN Mode |
happ connect --proxy |
Connect explicitly using System Proxy Mode |
happ connect <ID> |
Connect directly to node by index (e.g., happ connect 3) |
happ disconnect |
Terminate VPN background daemons and restore direct traffic |
happ status |
Display connection status, daemon PIDs, and public egress IP |
happ mode [tun/proxy] |
View or set default connection mode |
happ list [page] |
Browse proxy nodes with paginated view |
happ select <ID/query> |
Select active server by numeric ID or country/city name |
happ sub add <URL> |
Import new subscription link (VLESS/VMess/Trojan) |
happ sub update |
Refresh all subscription nodes from provider |
happ sub list |
View saved subscriptions and quota telemetry |
happ ping all |
Benchmark live TCP latency across all nodes |
happ help |
Print command-line usage reference |
+-----------------------------------------------------------------------+
| Terminal (PowerShell / CMD / Bash) |
| Commands: happ, happ connect, happ mode, happ list |
+-----------------------------------+-----------------------------------+
|
+-------------------------+-------------------------+
| |
[Mode 1: TUN Mode (Default)] [Mode 2: System Proxy Mode]
Layer-3 Virtual Network Adapter Windows Internet Settings (WinINet)
Wintun Driver (`happ-cli-tun`) Configures HTTP/HTTPS/SOCKS registry
Hijacks 100% of System Traffic & DNS Routes browsers & proxy-aware apps
Requires Administrator terminal Standard User (No Admin required)
| |
+-------------------------+-------------------------+
|
+-----------------------------------+-----------------------------------+
| Local Core Engine (127.0.0.1:10808 / 10809) |
| - Embedded Xray-core 26.9.9 (VLESS Reality / VMess / Trojan) |
| - Active Sniffing for TLS, HTTP, and QUIC (IPIfNonMatch strategy) |
| - Encrypted Remote DoH Resolvers (Cloudflare 1.1.1.1 / Google 8.8.8.8)|
+-----------------------------------------------------------------------+
Pre-compiled standalone Go binaries for Linux and macOS are available on the Releases page:
# Download latest Linux amd64 binary:
curl -Lo happ.tar.gz https://github.com/Abeh995/happ-cli/releases/latest/download/happ-linux-amd64.tar.gz
tar -xzf happ.tar.gz
sudo mv happ /usr/local/bin/
# Verify installation:
happ --helpHapp CLI exports a full Nix flake module with systemd service integration (nix/module.nix).
# flake.nix inputs
inputs.happ-cli.url = "github:Abeh995/happ-cli";
# Configuration
services.happ-cli.enable = true;
services.happ-cli.mode = "tun";
services.happ-cli.autoUpdate = true;git clone https://github.com/Abeh995/happ-cli.git
cd happ-cli
# Run unit tests
go test ./...
# Build binary
CGO_ENABLED=0 go build -trimpath -o bin/happ ./cmd/happThe Windows headless suite is located in windows/ and runs on Python 3.8+:
python -m py_compile windows/happ_core.pyHapp Windows CLI is the lightweight command-line and headless terminal edition of the Happ proxy client. While Happ Desktop provides a standard GUI, Happ CLI allows power users, developers, and sysadmins to run, automate, and monitor Xray-based VPN connections directly from PowerShell, Windows Terminal, CMD, or scripts without any graphical overhead.
Run this single line in PowerShell (Run as Administrator):
powershell -c "irm https://raw.githubusercontent.com/Abeh995/happ-cli/main/windows/install.ps1 | iex"This globally registers the happ command in your system PATH and synchronizes the Wintun Layer-3 driver automatically.
- Zero GUI Overhead: Minimal RAM and CPU consumption, ideal for developer workstations and remote servers.
- Interactive Console Dashboard (TUI): Sleek, keyboard-driven menu (
happ) with real-time status and live TCP ping tests. - Persistent Daemon: The VPN connection survives closing your terminal or logging out.
- Instant TUN / Proxy Toggle: Switch between 100% full-system routing (
happ mode tun) and browser-only proxy (happ mode proxy) in 1 second. - Zero DNS Leaks: Integrated DoH remote resolvers and UDP port 53 hijacking eliminate ISP DNS spoofing and manipulation.
Happ CLI parses and connects to VLESS (Reality, WebSocket, gRPC), VMess, Trojan, and Shadowsocks links and subscription feeds.
Contributions, issues, and feature requests are very welcome! Please read the Contributing Guidelines before submitting pull requests.
This project is licensed under the GNU General Public License v3.0 (GPL-3.0).