CLI Commands Reference
Complete reference for all InTunnel CLI commands and options.
Basic Usage
bash
intunnel [flags]Required Flags
| Flag | Description |
|---|---|
-token | Your tunnel authentication token (required) |
Optional Flags
| Flag | Default | Description |
|---|---|---|
-port | 3000 | Local port to expose |
-subdomain | (from token) | Custom subdomain to use |
-domain | intunnel.cloud | Domain to use (.cloud, .online, .tech) |
-version | - | Show version information |
-help | - | Show help message |
Examples
Basic Tunnel
Expose local port 3000:
bash
intunnel -token YOUR_TOKENCustom Port
Expose a different port:
bash
intunnel -token YOUR_TOKEN -port 8080Custom Subdomain
Use a specific subdomain (if different from token default):
bash
intunnel -token YOUR_TOKEN -subdomain myapp -port 3000Different Domain
Use intunnel.online instead of .cloud:
bash
intunnel -token YOUR_TOKEN -domain intunnel.online -port 3000Full Example
bash
intunnel -token abc123xyz -subdomain mywebsite -domain intunnel.tech -port 5000This exposes localhost:5000 at https://mywebsite.intunnel.tech
Environment Variables
You can also use environment variables:
| Variable | Equivalent 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"
intunnelVersion Information
Check the installed version:
bash
intunnel -versionOutput:
InTunnel CLI v2.0.0Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success / Clean exit |
| 1 | Error (connection failed, invalid token, etc.) |
Connection Lifecycle
- Starting: Client validates token and connects to server
- Connected: Tunnel is active and accepting traffic
- Reconnecting: Automatic reconnection on network issues
- Stopped: Clean shutdown (Ctrl+C or SIGTERM)
Signals
| Signal | Action |
|---|---|
SIGINT (Ctrl+C) | Graceful shutdown |
SIGTERM | Graceful 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.targetEnable and start:
bash
sudo systemctl enable intunnel
sudo systemctl start intunnelmacOS (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