Skip to content

CLI Commands Reference

Complete reference for all InTunnel CLI commands and options.

Basic Usage

bash
intunnel [flags]

Required Flags

FlagDescription
-tokenYour tunnel authentication token (required)

Optional Flags

FlagDefaultDescription
-port3000Local port to expose
-subdomain(from token)Custom subdomain to use
-domainintunnel.cloudDomain to use (.cloud, .online, .tech)
-version-Show version information
-help-Show help message

Examples

Basic Tunnel

Expose local port 3000:

bash
intunnel -token YOUR_TOKEN

Custom Port

Expose a different port:

bash
intunnel -token YOUR_TOKEN -port 8080

Custom Subdomain

Use a specific subdomain (if different from token default):

bash
intunnel -token YOUR_TOKEN -subdomain myapp -port 3000

Different Domain

Use intunnel.online instead of .cloud:

bash
intunnel -token YOUR_TOKEN -domain intunnel.online -port 3000

Full Example

bash
intunnel -token abc123xyz -subdomain mywebsite -domain intunnel.tech -port 5000

This exposes localhost:5000 at https://mywebsite.intunnel.tech

Environment Variables

You can also use environment variables:

VariableEquivalent Flag
INTUNNEL_TOKEN-token
INTUNNEL_PORT-port
INTUNNEL_SUBDOMAIN-subdomain
INTUNNEL_DOMAIN-domain

Example with Environment Variables

bash
export INTUNNEL_TOKEN="your-token-here"
export INTUNNEL_PORT="3000"
intunnel

Version Information

Check the installed version:

bash
intunnel -version

Output:

InTunnel CLI v2.0.0

Exit Codes

CodeMeaning
0Success / Clean exit
1Error (connection failed, invalid token, etc.)

Connection Lifecycle

  1. Starting: Client validates token and connects to server
  2. Connected: Tunnel is active and accepting traffic
  3. Reconnecting: Automatic reconnection on network issues
  4. Stopped: Clean shutdown (Ctrl+C or SIGTERM)

Signals

SignalAction
SIGINT (Ctrl+C)Graceful shutdown
SIGTERMGraceful shutdown

Running as a Service

Linux (systemd)

Create /etc/systemd/system/intunnel.service:

ini
[Unit]
Description=InTunnel Client
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/bin/intunnel -token YOUR_TOKEN -port 3000
Restart=always
RestartSec=10
User=youruser

[Install]
WantedBy=multi-user.target

Enable and start:

bash
sudo systemctl enable intunnel
sudo systemctl start intunnel

macOS (launchd)

Create ~/Library/LaunchAgents/com.intunnel.client.plist:

xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.intunnel.client</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/local/bin/intunnel</string>
        <string>-token</string>
        <string>YOUR_TOKEN</string>
        <string>-port</string>
        <string>3000</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>KeepAlive</key>
    <true/>
</dict>
</plist>

Load the service:

bash
launchctl load ~/Library/LaunchAgents/com.intunnel.client.plist

Released under the MIT License.