CLI
The thq command-line tool puts TunnelHQ in your terminal — test any VPN config or subscription URL instantly, manage monitors, and check your keys, all without leaving the shell. It works on macOS, Linux, WSL, and native Windows.
On this page
Install
One command, no prerequisites:
macOS / Linux / WSL
curl -fsSL https://tunnelhq.com/install.sh | bashWindows (PowerShell)
irm https://tunnelhq.com/install.ps1 | iexSign in
Authenticate with the device flow — no copy-pasting tokens. Run the command, approve in the browser, and you're connected:
terminal
thq loginScripting in CI? Set an API key in the environment instead and skip the interactive login:
terminal
export THQ_API_KEY="uk42_..."Needs a paid plan
The CLI talks to the API, so it requires an API key — available on Starter and up. See REST API for how keys work.
Commands
thq test <config|uri|url>— test any VPN config, share link, or subscription URL on the spot.thq servers list/create/delete— manage monitors.thq keys list/create/revoke— manage API keys.thq whoami— show who you're signed in as.thq mcp— set up the MCP server for your AI editor.thq doctor— diagnose connectivity and auth problems.thq upgrade— update the CLI in place.
Interactive REPL
Run thq with no arguments to drop into the slash-command UI. The essentials:
/test— test any VPN config, URI, or subscription URL on the spot./whoami— show who you're signed in as./keys list— list your API keys./login//logout— manage the session./help— everything else./exit— quit.
Instant /test is the highlight
Paste a
vless:// link or a config and /test tells you in seconds whether it connects — the same engine your scheduled monitors use, with nothing to save first.Full command list
The CLI evolves faster than this page. Run thq --help any time for the complete, current list of commands and flags.