Developers
CLI
Install the thq command-line tool to test VPN configs, share links and subscription URLs from your terminal, manage monitors, Uptime checks and API keys, and connect the MCP server to your AI editor.
thq is the TunnelHQ command-line tool. Use it to test any VPN config, share link, or subscription URL from your terminal, manage monitors, Uptime checks, and API keys, and connect the MCP server to your AI editor. It runs on macOS, Linux, WSL, and Windows.
This page describes thq 0.4.0, the current release. Run thq --version to see yours.
Install
Section titled “Install”The macOS / Linux installer needs nothing installed first: it brings its own Node.js (downloaded from nodejs.org and checked against its published checksums) and keeps it, with thq, in ~/.local/share/tunnelhq. It links thq into /usr/local/bin when run as root, otherwise into ~/.local/bin, which it adds to your PATH if needed. On Windows, and with npm install -g, thq needs Node.js 20 or newer.
curl -fsSL https://tunnelhq.com/install.sh | bashIn PowerShell 5.1 or newer:
irm https://tunnelhq.com/install.ps1 | iexOr install the package with npm directly:
npm install -g https://tunnelhq.com/releases/latest/tunnelhq-cli.tgzSign in
Section titled “Sign in”thq login uses the device flow: run the command, approve the request in your browser, and you’re signed in. There’s no token to copy. Your credentials are saved to ~/.thq/credentials.json.
thq login| Option | Description |
|---|---|
--no-browser |
Don’t open the browser; print the approval URL instead. |
--qr |
Print a QR code for the approval URL. On by default when there’s no display, for example over SSH. |
--no-qr |
Don’t print the QR code. |
--host <url> |
Sign in to a different API host. |
The approval is refused if your workspace’s plan doesn’t include API access, with the message “API access isn’t included on this workspace’s plan. Upgrade to use the CLI.”
The key thq login creates is an account-wide key, named “CLI · <computer name> · <date>”, which never expires.
thq logout removes the saved credentials and switches the key off on the server. The key stays on the API Keys page as Disabled; to delete it, choose Revoke there, or run thq keys revoke <id> --hard before you log out.
For CI and scripts, set an API key in the environment instead. When THQ_API_KEY is set, it’s used instead of the saved sign-in.
export THQ_API_KEY="thk_..."The CLI uses the API, so it works on every plan except the old Free plan, from before 23 November 2026. See Getting an API key.
Test a config
Section titled “Test a config”thq test checks a VPN config on the spot and saves nothing. The target can be a config file path, a share link, a raw config string, or an https:// subscription URL.
thq test ./wg0.confthq test 'vless://<uuid>@vpn.example.com:443?security=reality&...'thq test https://provider.example.com/sub --first 5 --json| Option | Description |
|---|---|
--json |
Machine-readable output, for CI. |
--protocol <name> |
Force the protocol: wireguard, openvpn, ikev2, openconnect, vmess, vless, trojan, shadowsocks, amneziawg, hysteria2, or tuic. |
--timeout <seconds> |
How long to wait. Default 30, minimum 5, maximum 120. |
--host <hostname>, --port <number> |
Server host and port for IKEv2, OpenConnect, and OpenVPN (required for IKEv2 and OpenConnect). WireGuard, AmneziaWG, and share links use their own. |
-u, --username; -p, --password |
Override the credentials. |
--remote-id <id> |
Set the IKEv2 remote ID. |
--engine <name> |
Force an engine: singbox, xray, auto, both, or race. By default, the checker picks one per protocol. |
--first <n> |
Subscription URLs only: test the first n entries. Alias: --limit. |
--index <n> |
Subscription URLs only: test one entry, counting from 1. |
A subscription URL tests every entry unless you pass --first or --index.
IKEv2 and OpenConnect don’t need a config: pass the server and the credentials.
thq test --protocol ikev2 --host vpn.example.com -u alice -p secretthq test works out the protocol from, in order:
--protocol.- The URI scheme, such as
vless://orss://. - The content: an
[Interface]section is WireGuard, or AmneziaWG when it hasJc,Jmin,Jmax, orH1–H4keys;clientandremotelines are OpenVPN. So a.conffile that holds an OpenVPN config is tested as OpenVPN. - The file extension:
.confis WireGuard,.ovpnis OpenVPN. - An
http://orhttps://address is a subscription URL.
thq test exits with 0 when the test passes and 1 when it fails, so you can use it in CI.
Tests run on the same checkers as scheduled monitors, through POST /check. They count toward your API rate limit, not your on-demand test quota.
Testing needs a role that can edit monitors: in the key’s workspace, or with the key thq login saves, in at least one workspace you’re in. Any other role gets “Running a check needs a role that can edit monitors.”
Manage monitors
Section titled “Manage monitors”thq servers manages the project’s saved monitors. Every thq servers and thq checks command works in the project in THQ_PROJECT_ID, or the one you pass with --project <id>, and takes --json.
| Command | Description |
|---|---|
thq servers list |
List monitors. --family chooses tunnel (the default), uptime, or all. Filter with --status, --protocol, --search, and --active-only; --limit defaults to 100. --status takes a monitor status, such as down or no_data. With --json, each row also has its status_reason, such as login_missing for a tunnel that isn’t checked. |
thq servers create <input> --name <name> |
Create a VPN monitor from a config file, share link, or raw config. It takes thq test’s connection options (--protocol, --host, --port, -u, -p, --remote-id), plus --proto udp or tcp for OpenVPN, --ip for a WireGuard or AmneziaWG config without an Endpoint line, --interval, --tag (repeat it for more), and --paused. For OpenConnect and IKEv2, leave out the input and pass --host, --username, and --password. |
thq servers delete <id> --yes |
Delete a monitor or an Uptime check by its ID, srv_123 or 123. --yes is always required, with --json too. |
thq servers create wg.conf --name "WG Frankfurt"thq servers create 'vless://<uuid>@host:443' --name "VLESS EU"thq servers create '' --protocol openconnect --name "OC Corp" \ --host vpn.example.com --username alice --password secretThe list’s period, order, and filters
Section titled “The list’s period, order, and filters”These options aren’t in thq 0.4.0. They come with the CLI’s next release.
thq servers list and thq checks list take the same period, order, and filters as the dashboard’s lists, and a few more:
| Option | Takes |
|---|---|
--period <p> |
Each row’s availability, downtime, and incidents for 24h, 7d, 30d, month (this month), last (last month), or a month such as 2026-10, ranked least available first. |
--sort <s> |
name (the default), manual, status (worst first), or latency. With --period: avail, downtime, incidents, slowest, or name. With or without it: created (newest first), interval (shortest first), or last_incident (most recent first). manual is the order set by hand, which thq servers move changes. |
--direction <d> |
asc puts the smallest first (A to Z, oldest, shortest, least available), and desc the largest. Needs --sort or --period. |
--below |
With --period: only rows under the project’s availability target. |
--incidents |
With --period: only rows that had an incident. |
--tag, --country, --provider |
Only rows with that tag, in that country (as their country tag says it), or on that hosting provider. Several separated by commas match any of them. |
--subscription <id> |
Only rows from that subscription, such as sub_7. Several separated by commas match any of them. |
--location <code> |
Only rows checked from that location, such as de, or any. Several separated by commas match any of them. |
--muted, --not-muted |
Only rows whose alerts are muted now, or only the rest. |
--maintenance, --not-maintenance |
Only rows under a running maintenance window now, or only the rest. |
A sort or filter that needs a period is refused without one, and so is a subscription or location the list has no row for. See List monitors for what each one does.
thq servers list --period last --belowthq servers list --period 7d --sort downtime --provider ovhthq servers list --muted --sort last_incidentUptime and muted alerts
Section titled “Uptime and muted alerts”These commands aren’t in thq 0.4.0. They come with the CLI’s next release.
| Command | Description |
|---|---|
thq servers stats <id> |
A tunnel’s or check’s uptime, downtime, incidents, checks, and latency for a period, as its page shows them. --range is 24h (the default), 7d, 30d, or 90d. A period longer than your plan’s history is refused. For a tunnel, 24h also shows its connect time. |
thq servers mute <id> |
Mute its alerts. --for is 15m, 1h (the default), 4h, or until-unmuted. Its checks keep running: this isn’t a pause. |
thq servers unmute <id> |
Turn its alerts back on. |
Muting and unmuting need a role that can pause monitors.
thq servers stats srv_42 --range 30dthq servers mute srv_42 --for 4hNew configs, the list’s order, and syncing
Section titled “New configs, the list’s order, and syncing”These commands aren’t in thq 0.4.0. They come with the CLI’s next release.
| Command | Description |
|---|---|
thq servers update <id> |
Give a tunnel its new config, as its Settings in the dashboard does. --config <file> takes a WireGuard, AmneziaWG, or OpenVPN file, or a file with the new link, and --url <link> takes the link itself. The next check uses it. |
thq servers move <id> |
Move a monitor in the dashboard’s list, with exactly one of --before <id>, --after <id>, --top, or --bottom, within its own list. The order is the same for everyone in the project. If it’s already there, it says so and changes nothing. |
thq servers duplicate <id> |
Copy a tunnel or an Uptime check. The copy is named after it, with “ (copy)” added, and keeps its group, settings, locations, tags, and alert channels. Its saved login is copied on TunnelHQ’s side and never printed. A tunnel’s copy counts toward your plan’s tunnel limit; a check’s doesn’t. A group, or a tunnel from a subscription, can’t be copied. |
thq subscriptions sync <id> |
Read a subscription again now and test every tunnel it has. <id> is sub_3 or 3. A subscription that was switched off is switched back on first. |
Updating, moving, and copying a monitor need a role that can edit monitors, and syncing a role that can edit the project.
Groups
Section titled “Groups”These commands aren’t in thq 0.4.0. They come with the CLI’s next release.
thq groups manages the groups of the Tunnels and Uptime lists. --family is tunnel or uptime: a tunnel joins only a tunnel group, and a check only an Uptime group. Each command takes --project <id> and --json.
| Command | Description |
|---|---|
thq groups list |
List the project’s groups, in the order the dashboard draws them. --family lists one kind. |
thq groups create <name> --family <f> |
Make a group. --members srv_5 srv_6 makes it with those monitors already in it: all of them go in, or none do and no group is made. |
thq groups reorder <ids...> --family <f> |
Put groups in the order you name them. Groups you don’t name keep their places. |
thq groups rename <id> <name> |
Rename a group. |
thq groups delete <id> --yes |
Delete a group. Its monitors are kept, in no group. |
--group <id> on thq servers create and thq checks create puts a new monitor straight into a group.
Making a group needs a role that can create monitors, and with --members, one that can edit them too. Reordering and renaming need a role that can edit monitors, and deleting one that can delete them.
thq groups create Europe --family tunnel --members srv_5 srv_6thq groups reorder srv_42 srv_57 --family tunnelManage Uptime checks
Section titled “Manage Uptime checks”thq checks certificate, thq checks update, and the --basic-auth-user and --basic-auth-pass options aren’t in thq 0.4.0. They come with the CLI’s next release.
thq checks list lists the project’s Uptime checks. Filter with --type, --status, --search, and --active-only; --limit defaults to 100, and --status takes the same monitor status values.
thq checks certificate <id> shows a website or keyword check’s SSL certificate: its state, when it expires, the issuer, the names it covers, how many of its checks pass, the expiry alert, and the domain’s registration when the check watches it. With --json, it prints the API’s answer. A tunnel or any other kind of check exits with an error.
thq checks certificate srv_812thq checks create <target> --name <name> creates a check. Without --type, the target sets the type, the same way the dashboard does:
| Target | Creates |
|---|---|
https://example.com or example.com/health |
A website check, with https:// added if it’s missing. With --keyword, a keyword check. |
db.example.com:5432 or [2001:db8::1]:443 |
A TCP port check. --port overrides the port. |
8.8.8.8 (an IP address) |
A ping check. |
example.com (a bare hostname) |
A website check, with https:// added. Add --type ping to ping it instead. |
1.1.1.1 --domain example.com |
A DNS check. The target is the DNS server; --keyword is text the answer must contain. |
No target, with --period |
A heartbeat. The command prints the address your job calls. |
Targets must be public addresses: private and reserved ones are refused.
| Option | Description |
|---|---|
--type <type> |
http, keyword, ping, port, dns, or push (a heartbeat). |
--keyword <text> |
Keyword check: text the page must contain. DNS check: text the answer must contain. |
--invert-keyword |
Keyword check: alert when the text is found. |
--accept <codes> |
Website and keyword checks: accepted status codes, such as 200-299,301. Default 200-299. |
--port <n> |
TCP port check: the port. |
--domain <name> |
DNS check: the domain to ask about. |
--period <seconds> |
Heartbeat: the longest time between two calls from your job. Default 86400. |
--grace <seconds> |
Heartbeat: how late a call can be before it’s down. Default 3600. |
--interval <seconds> |
Seconds between checks. Left out, the recommended default. |
--tag <name> |
Add a tag. Repeat it for more. |
--paused |
Create the check paused. |
--basic-auth-user <user> |
Website and keyword checks: the user name for a page behind a login. |
--basic-auth-pass [password] |
Its password. Give the flag with no value and you’re asked for it, without it showing or going into your shell history. |
thq checks create https://example.com --name "Homepage"thq checks create https://example.com/login --name "Login" --keyword "Sign in"thq checks create db.example.com:5432 --name "Postgres"thq checks create 1.1.1.1 --name "Resolver" --domain example.comthq checks create --name "Nightly backup" --period 86400 --grace 3600thq checks create https://example.com/admin --name "Admin" --basic-auth-user admin --basic-auth-passPut the login in the flags, not in the URL: a URL with a user name and password in it is refused.
thq checks update <id> changes a saved check. Only what you give changes: --name, --url, --keyword, --interval, --basic-auth-user, and --basic-auth-pass. "" clears the user name or the password.
thq checks update srv_812 --interval 60thq checks update srv_812 --basic-auth-passthq checks update srv_812 --basic-auth-user "" --basic-auth-pass ""To pause a check, or change anything else, use the dashboard, the REST API, or the MCP server. To delete one, use thq servers delete.
Manage status pages
Section titled “Manage status pages”Make a status page, choose what it shows, and post incidents and updates from a terminal or a script.
These commands aren’t in thq 0.4.0. They come with the CLI’s next release. Until then, use the dashboard, the REST API, or the MCP server signed in at mcp.tunnelhq.com.
| Command | Description |
|---|---|
thq status-pages list |
List the project’s status pages. |
thq status-pages create <name> |
Make a page, a draft until you publish it in the dashboard. Without --services, --type, or --tag it shows the suggested set: tunnels and website checks that aren’t paused. --slug <slug> sets its address, <slug>.tunnelhq.net. |
thq status-pages services <page> [--add …] [--remove …] [--hide …] [--show …] |
Add, remove, hide, or show many services at once. Removing takes a service off the page; the tunnel or check stays. |
thq status-pages domain <page> <domain> |
Put the page on your own domain, such as status.example.com, and print the DNS record to add. --check looks the record up and switches on HTTPS once it points to TunnelHQ. --remove takes the domain off. |
thq status-pages brand <page> [--use …] |
Take the logo, dark logo, favicon, and share image from the page’s website. --use saves only those you name: logo, logo_dark, favicon, share_image. |
thq status-pages incidents <page> [--status open|resolved] |
List a page’s incidents, with their updates. |
thq status-pages open <page> --title <text> --impact <impact> --service <service> --message <text> |
Open an incident. --impact is degraded, partial, or full. Repeat --service for each affected service. --status sets the first status: investigating (the default), identified, or monitoring. |
thq status-pages update <page> <incident> --status <status> --message <text> |
Post an update. --status is investigating, identified, monitoring, or resolved; resolved closes the incident. |
Every thq status-pages command works in the project in THQ_PROJECT_ID, or the one you pass with --project <id>, and takes --json.
<page>is the page’s ID (sp_12), its address (larkspur-vpn), or its name.--serviceis a service’s ID (sps_40) or its name on the page, including a group’s members. If no service matches, the command fails and lists the page’s services instead of guessing.- A monitor for
--services,--add,--remove,--hide, or--showis its ID (srv_42) or its name. A group’s name or ID brings its members. create --servicesalso takessuggested(the default) ornone, for an empty page.--typeand--tagadd every monitor of a type, or with a tag, beside any you name. The types aretunnel,website,keyword,ping,port,dns,heartbeat, andgroup.- In
services, an action given without names takes the monitors--typeand--tagpick, as in--remove --type heartbeat.
A page shows up to 400 services, a server’s tunnels counting once. The commands print the count, such as “103 of 400 services”.
thq status-pages create "Larkspur VPN"thq status-pages services larkspur-vpn --remove --type heartbeatthq status-pages services larkspur-vpn --add srv_42 "API health" --hide "Old Frankfurt"thq status-pages domain larkspur-vpn status.larkspur.examplethq status-pages domain larkspur-vpn --checkthq status-pages brand larkspur-vpnthq status-pages open larkspur-vpn --title "OpenVPN failing in Frankfurt" --impact partial --service "OpenVPN Frankfurt" --message "Connections are failing. We are looking into it."thq status-pages update larkspur-vpn spi_7 --status resolved --message "Connections work again."Publishing, the rest of a page’s look, and its password aren’t in the CLI: use the dashboard, the REST API, or the MCP server.
Manage maintenance
Section titled “Manage maintenance”Plan maintenance windows from a terminal or a script. While one runs, checks and alerts pause for what it covers, and your status pages show it.
These commands aren’t in thq 0.4.0. They come with the CLI’s next release.
| Command | Description |
|---|---|
thq maintenance list |
List the project’s windows, with when each runs, what it covers, and where it stands. |
thq maintenance create <title> --start <when> --end <when> |
Plan a window. Name what it covers with --monitor, or use --covers tunnels, uptime, or all. |
thq maintenance update <window> … |
Change a window: only what you give changes. --pause pauses it, --resume resumes it, --title renames it. |
thq maintenance end <window> |
End a running one-time window now. Checks and alerts resume within a minute. |
thq maintenance cancel <window> --yes |
Delete a window, planned or running. Without --yes, it only says what it would delete. |
<window>is the window’s ID (mnt_4) or its title.- A one-time window takes
--startand--endasYYYY-MM-DDTHH:mm. With--days, it repeats every week on those days, such as--days mon,wed,fri, and--startand--endareHH:mm. All seven days means every day. --timezoneis an IANA time zone, such asEurope/Berlin. Left out, it’s your computer’s.--monitoris a monitor or group, by ID or name. Repeat it for more; a group brings its members.--noteadds a note shown with the window.- Every
thq maintenancecommand works in the project inTHQ_PROJECT_ID, or the one you pass with--project <id>, and takes--json.
thq maintenance create "Frankfurt upgrade" --start 2026-11-12T02:00 --end 2026-11-12T04:00 --timezone Europe/Berlin --monitor "OpenVPN Frankfurt"thq maintenance create "Nightly backup" --days mon,wed,fri --start 02:00 --end 02:30 --covers uptime --timezone Asia/Karachithq maintenance update "Nightly backup" --pauseManage alert channels
Section titled “Manage alert channels”Choose where a monitor’s alerts go, and check that they arrive. New channels are made in the dashboard under Integrations, where their secrets are entered.
These commands aren’t in thq 0.4.0. They come with the CLI’s next release.
| Command | Description |
|---|---|
thq channels list |
List the project’s alert channels, with each one’s type and whether it’s on. |
thq channels show <monitor> |
The channels a check’s or tunnel’s alerts go to. |
thq channels set <monitor> <channel>… |
Set the channels its alerts go to. This replaces its list, so name every channel it should keep. |
thq channels set <monitor> --none |
Its alerts go to no channel. |
thq channels test <monitor> |
Send a test alert through each of its channels, and show which took it. |
<monitor>and<channel>are an ID (srv_12,chn_22) or a name. If two share a name, use the ID.- Setting channels and sending a test alert need a role that can edit monitors. A test reaches at most 10 channels, and you can send 10 test messages an hour.
- Every
thq channelscommand works in the project inTHQ_PROJECT_ID, or the one you pass with--project <id>, and takes--json.
thq channels set "Shop website" "Ops Slack" chn_22thq channels test "Shop website"Manage servers
Section titled “Manage servers”Add servers, read them, and set their alerts from a terminal or a script.
These commands aren’t in thq 0.4.0. They come with the CLI’s next release.
| Command | Description |
|---|---|
thq hosts install |
Print the command that installs the agent. --name and --group add a name and a group. --auto-update or --no-auto-update decides automatic updates; without either, the project’s default does. --rotate makes a new install key; servers already installed keep reporting. --no-users counts no online users on the server, for a no-log policy (agent 1.14.0). --host <id> prints the command to run again on a server already added, keeping its --no-users. |
thq hosts list |
List the project’s servers. Filter with --status (online, stale, offline, or connecting for one just installed), --group, --tag, --search, or --monitor, and order with --sort. A server that counts no online users reads “not counted”. |
thq hosts get <id> |
One server in full: readings, system, the cloud it runs on, linked tunnels and checks, alerts, and the uninstall command. A linked tunnel whose test fails while the server’s users stay connected says “test fails, users fine”. A server that counts no online users says so, and whether its agent still counts on the server until it’s updated. |
thq hosts history <id> |
A server’s readings over time. --metric is cpu by default, and --range is 1h, 6h, 24h (the default), or 7d. --country IR shows its users from one country, with “under 11” in place of any count under 11. |
thq hosts blocks <id> |
A VPN server’s blocks by country of the last 90 days. A server with no VPN services says it has none. |
thq hosts update <id> |
Change --name, --group, or --tags. "" clears any of them. --auto-update on or off switches automatic agent updates. --vpn off says it’s not a VPN server, whatever VPN services it runs (no vpn tag, no users); --vpn auto gives the decision back to its VPN services. |
thq hosts update-agent <id> |
Update the server’s agent to the latest release now. |
thq hosts link <id> <monitor> |
Link a tunnel or check to the server by hand. |
thq hosts unlink <id> <monitor> |
Keep a tunnel or check away from the server, even when the address matches. |
thq hosts alerts <id> |
Show the server’s alerts, or change them with the options below. |
thq hosts incidents [<id>] |
Server incidents of the last 30 days, open first. --open shows only open ones. --kind takes offline, service, resource, country, cert, watch, or internet, and --country IR shows only users from that country gone. |
thq hosts remove <id> --yes |
Remove the server from TunnelHQ. Its agent stays installed until you run the uninstall command. |
thq hosts settings |
The project’s Count online users. --count-users off stops every server of the project counting online users; --count-users on --yes turns it back on. |
thq hosts suggestions |
The server suggestions: what looks linked or added twice. Filter with --host, --monitor, --kind, and --search; --limit defaults to 50. |
thq hosts suggestions accept <id>… |
Accept one or several, as its button does: Link, or Remove old copy and Delete copy, which need --yes. For a heartbeat several servers could send, --host-ids hst_5,hst_6 names the servers it runs on. |
thq hosts suggestions dismiss <id> |
Turn one down: Not the same, Keep both, or Neither. It never comes back. |
thq hosts alerts changes only what you name:
| Option | Takes |
|---|---|
--offline-after |
Seconds without a report before it alerts, 90 or more, or off. |
--service-after |
Seconds a watched service is stopped before it alerts, or off. |
--cpu, --memory, --disk |
A percent and seconds, such as 90:600 for above 90% for 10 minutes, or off. |
--country |
on or off. |
--cert |
7, 14, 21, or 30 days before the certificate expires, or off. Needs agent 1.7.0. |
--internet |
Alert when the server’s own internet keeps breaking: once (once in an hour), hourly (3 times in an hour), daily (3 times in a day), or off. Needs agent 1.11.0. |
--watch "<rule>" |
Add a watch, in words: a reading (users, traffic, cpu, memory, or disk), then above, below, or falls-by, then a value. After it, optionally for <seconds>, until <YYYY-MM-DD>, and to <channel IDs>, such as to chn_3,chn_5; without to, it goes where the server’s other alerts go. Repeat it for more. |
--unwatch <id> |
Remove a watch by its ID, such as w1. Repeat it for more. |
<id>is a server’s ID (hst_7, or7), and<monitor>a tunnel’s or check’s (srv_81).- Changing a server needs a role that can edit monitors, and removing one a role that can delete monitors.
thq hosts settings --count-usersneeds a role that can edit the project. - A suggestion’s ID looks like
sug_block-7-41. - Every
thq hostscommand works in the project inTHQ_PROJECT_ID, or the one you pass with--project <id>, and takes--json.
A server incident’s ID starts with hin_. thq incidents show, ack, note, and resolve take it too: see Manage incidents.
thq hosts alerts hst_7 --disk 85:300 --cert 21thq hosts list --status offlinethq hosts alerts hst_7 --watch "users above 500 for 600 until 2026-11-16 to chn_3"thq hosts alerts hst_7 --watch "users falls-by 50 for 300" --internet dailythq hosts alerts hst_7 --unwatch w1thq hosts incidents --country IRthq hosts blocks hst_7thq hosts history hst_7 --country IR --range 7dthq incidents show hin_12Read the availability report
Section titled “Read the availability report”These commands aren’t in thq 0.4.0. They come with the CLI’s next release.
thq report availability prints one month’s availability against the project’s target, worst first, as the dashboard’s Reports page shows it.
| Option | Description |
|---|---|
--month <yyyy-mm> |
The month, such as 2026-10. The default is last month. Reports go back 13 months. |
--by <cut> |
tunnel (the default), group, or provider: one row per tunnel, per group, or per hosting provider. |
--family <f> |
tunnel (the default), uptime, or all. |
--sort <column> |
The column to sort by: availability (the default), downtime_minutes, incidents, or name. |
--desc |
Highest first. |
--csv |
Print CSV, the same file as Export CSV on the Reports page. |
It works in the project in THQ_PROJECT_ID, or the one you pass with --project <id>, and takes --json. A tunnel’s hosting provider is set in its Settings in the dashboard, under Hosting provider, or with hosting_provider through the REST API or the MCP server’s update_monitor.
thq report availabilitythq report availability --month 2026-10 --by providerthq report availability --by group --csv > october.csvManage incidents
Section titled “Manage incidents”These commands aren’t in thq 0.4.0. They come with the CLI’s next release.
| Command | Description |
|---|---|
thq incidents list |
List incidents, newest first. --status is active or recovered. An open incident reads down, degraded, or expiring, and a closed one resolved. --kind test_failing lists only the incidents whose reason is Test fails: they read degraded. --limit is 30 by default, and at most 500. |
thq incidents show <incident> |
One incident: what failed in each location, when the check last passed, the other tunnels and checks on the same server, and its activity. When its reason is Test fails, What we see gives the server’s users and the fix: thq servers update <id> --config <file>, or thq subscriptions sync <id> for a tunnel from a subscription. --markdown prints it as Markdown, to paste into an AI tool. |
thq incidents ack <incident> |
Acknowledge it, so the team sees you have it. --note adds a note. |
thq incidents note <incident> [text] |
Add a note for the team. --file <path> reads the note from a file. |
thq incidents retest <incident> |
Run the incident’s check again now. |
thq incidents resolve <incident> --yes |
Resolve an open incident by hand. Without --yes, it says what resolving does and stops. |
thq incidents status-pages <incident> |
The status pages that show the incident’s tunnel or check, and what customers read on each: Investigating, Identified, Monitoring, Resolved, Not posted yet, or Automatic posting off, with each page’s ID. |
thq incidents post <incident> --status <s> --message <text> |
Post a public update on the status pages that show it. --status is investigating, identified, monitoring, or resolved. --file <path> reads the message from a file instead. --page <id...> names the pages, such as --page sp_3 sp_5. Without it, it posts on the pages that already show the incident, or, when none do yet, on the pages with automatic incidents on. |
thq incidents mute <incident> |
Mute the incident’s alerts until it’s resolved. Its checks keep running. |
thq incidents unmute <incident> |
Turn the incident’s alerts back on now. |
<incident>is an incident’s ID,inc_12or12, or a server incident’s,hin_12. A server incident can be shown, acknowledged, noted, and resolved. It has no check to retest, and only one about a country’s users can be resolved: the rest close by themselves once the server is back. It never goes on a status page and has no alerts of its own to mute, sostatus-pages,post,mute, andunmuterefuse it.- A note can be up to 2,000 characters. Only your team reads notes: they never reach a status page.
- A public update can be up to 5,000 characters, and customers read it at once. The page’s incident still resolves by itself when the tunnel or check recovers. Once the incident is resolved, only
--status resolvedcan be posted, on the pages that showed it. - A mute from
thq incidents muteends by itself when the incident closes. When someone else muted the tunnel or check, it changes nothing and says who. - Resolving closes the incident and changes nothing on the tunnel or check. While the check is still down,
resolvesays so, and a new incident opens at its next failed check. A certificate or domain expiry can’t be resolved: it closes by itself once renewed. - Acknowledging, adding a note, retesting, resolving, and posting need a role that can edit monitors. Muting and unmuting need a role that can pause monitors. Retesting a tunnel uses one of your plan’s on-demand tests.
- Every
thq incidentscommand works in the project inTHQ_PROJECT_ID, or the one you pass with--project <id>, and takes--json.
thq incidents list --status activethq incidents show inc_12thq incidents note inc_12 "Rolled the kernel back"thq incidents mute inc_12thq incidents post inc_12 --status identified --message "We found the cause and are fixing it"thq incidents resolve inc_12 --yesAsk AI SRE
Section titled “Ask AI SRE”These commands aren’t in thq 0.4.0. They come with the CLI’s next release.
thq ask "<question>" asks AI SRE, which is in alpha, about your tunnels, checks, incidents, and servers, waits for the answer, and prints it. Its help reads “Ask AI SRE (alpha)”.
| Option | Description |
|---|---|
--monitor <id> |
The tunnel or check the question is about, such as srv_81. |
--incident <id> |
The incident the question is about, such as inc_418. Asking about it again reads the same answer. |
--in <conversation> |
Ask a follow-up in this conversation. Its ID comes from thq answers list. |
--no-wait |
Return at once, and read the answer later with thq answers show. Without it, thq ask waits up to 10 minutes. |
--attach <file> |
Send a file with the question: a picture, a PDF, or a text file, up to 10 MB each. Repeat it for up to 5. Pictures and PDFs go to the AI provider as they are; keys in a text file are hidden first, and a VPN config inside one stays in TunnelHQ. See Adding files. |
| Command | Description |
|---|---|
thq answers list |
The project’s AI SRE conversations, with this month’s answers used and the limit. |
thq answers show <conversation> |
Read a conversation’s latest answer. |
thq answers stop <conversation> |
Stop the answer being written. It still counts toward the month once AI SRE had begun work on it. |
- Each answer counts toward the project’s monthly limit.
- AI SRE changes nothing from the CLI. A change it suggests is printed with the link where you approve it in the dashboard.
- Asking, a follow-up, and stopping need a role that can mute and pause monitors. Any role can list and read answers.
<conversation>is the conversation’s number, such as54.thq askand everythq answerscommand work in the project inTHQ_PROJECT_ID, or the one you pass with--project <id>, and take--json.
thq ask "Is anything down right now?"thq ask "Why is it down?" --monitor srv_81thq ask "Was it slow before that?" --in 54thq ask "Why is fra1 down?" --attach shot.png --attach fra1-syslog.logManage API keys
Section titled “Manage API keys”| Command | Description |
|---|---|
thq keys list |
List your API keys. |
thq keys create <name> [--expires <ISO date>] |
Create a workspace key. Keys created this way start with uk. Needs a workspace key in THQ_API_KEY: the account-wide key from thq login is refused. Needs a role that can edit monitors in that workspace, too. An --expires value that isn’t a date, such as 31/12/2026, is refused. |
thq keys revoke <id> [--hard] |
Disable a key. With --hard, delete it permanently. The ID is the number, or the uk… form. |
Set up the MCP server
Section titled “Set up the MCP server”thq mcp prints the configuration for the MCP server, or applies it for you.
| Option | Description |
|---|---|
--client <name> |
claude, cursor, windsurf, or cline. |
--apply |
Apply the configuration: runs claude mcp add for Claude Code, or writes the JSON config for the other clients. |
--update |
With --client, clear TunnelHQ’s cached MCP server and add it to that client again, so your editor gets the current release on its next start. Without --client, it changes nothing. |
--json |
Print the configuration snippet and exit. |
--api-key <value> |
Use this key in the configuration. |
Other commands
Section titled “Other commands”| Command | Description |
|---|---|
thq whoami |
Show the account you’re signed in as. |
thq doctor |
Diagnose connection and authentication problems. |
thq upgrade |
Update the CLI. It detects whether you installed it with npm, Homebrew, or the install script. Alias: thq update. |
thq install |
Reinstall the CLI to a stable location and add it to your PATH. |
Run thq --help for every command and option.
Interactive REPL
Section titled “Interactive REPL”Run thq with no arguments in an interactive terminal to open the slash-command interface. It doesn’t open when input or output is redirected, or when NO_COLOR is set.
| Command | Description |
|---|---|
/test |
Test a VPN config, share link, or subscription URL. |
/whoami |
Show your account, plan, and quota. |
/keys |
list, create <name>, or revoke <id>. |
/mcp |
Set up the MCP server. |
/doctor |
Diagnose connection and authentication problems. |
/upgrade |
Update the CLI. |
/login, /logout |
Sign in or out. |
/help |
List every command. |
/exit |
Quit. |
Environment variables
Section titled “Environment variables”| Variable | Description |
|---|---|
THQ_API_KEY |
API key to use instead of the saved sign-in. |
THQ_HOST |
API host. Defaults to https://app.tunnelhq.com. |
THQ_PROJECT_ID |
Default project. |
THQ_ORG_ID |
Default workspace. |
THQ_HEADLESS |
1 or 0 to force headless mode on or off. |
THQ_SKIP_UPDATE_CHECK |
1 to skip the background check for a newer version. |
THQ_INSTALL_DIR |
Where thq install puts the CLI. Defaults to ~/.local/bin, or %LOCALAPPDATA%\TunnelHQ\bin on Windows. |