Menu

CLI reference

Every tnnl command and flag, grouped by what it does.

Tunnel commands

CommandFlagsWhat it does
tnnl http <port>--subdomain/-s NAME, --hostname DOMAINExpose a local HTTP port on a public HTTPS URL.
tnnl tcp <port>--remote-port NExpose a local TCP port on a dedicated public port.
tnnl logs [id]Stream request logs for a tunnel.
tnnl tunnelsList your active tunnels.
tnnl tunnels close <id>Close a tunnel.

Account commands

CommandFlagsWhat it does
tnnl login--api URL, --web URL, --no-browserAuthenticate and store a session.
tnnl logoutEnd the session on this device.
tnnl whoamialias tnnl accountShow who you are.
tnnl change-passwordChange your password.
tnnl sessionsList active sessions.
tnnl sessions revoke <id>Revoke one session.
tnnl sessions revoke-othersSign out every session except this device.
tnnl delete-accountPermanently delete your account.

CLI commands

CommandWhat it does
tnnl upgradeUpdate the CLI to the latest version.
tnnl --versionPrint the installed version.
tnnl --helpShow help.

Shared flags for http and tcp

FlagWhat it does
--server host:portControl address of the tunnel server.
--tokenOverride the saved session token.
--no-tlsUse plaintext; matches a --no-tls server.
--insecureSkip TLS certificate verification — dev only.

Environment variables

VariableWhat it does
TUNNEL_SERVERDefault control address.
TUNNEL_API_URLDefault API URL.
TUNNEL_WEB_URLDefault web URL.
TUNNEL_TOKENOverride the saved session token.
TUNNEL_NO_TLSUse plaintext.
TUNNEL_INSECURESkip TLS certificate verification.
TNNL_NO_UPDATE_CHECKSkip the update check.
TNNL_NO_KEYRINGStore the token in a file instead of the OS keychain.

Credential storage

After login, the session token is stored in your OS keychain (macOS Keychain, Windows Credential Manager, Linux Secret Service). On headless Linux, or with TNNL_NO_KEYRING=1, it falls back to a chmod-600 file. Non-secret settings (API URL, email) live in a config file. tnnl logout clears both.

Colored output
Colored output auto-disables when not a TTY or when NO_COLOR is set.

Defaults and self-hosting

Defaults point at the hosted tnnl.uz. Self-hosters override them with --server/--api/--web or the TUNNEL_* environment variables — see Self-hosting.