tunnel

Expose worktrees externally via Cloudflare Tunnel or ngrok.

Usage

docktree tunnel <action> [flags]

The tunnel command allows you to share your local worktree instances externally with team members or clients. It leverages secure tunnel providers (like Cloudflare Tunnel or ngrok) to expose ports dynamically without requiring router port-forwarding or public IP addresses.

Actions

ActionDescription
startStart a tunnel for the current worktree's primary HTTP service
stopStop the running tunnel for the current worktree
statusShow status and URL of the tunnel for the current worktree
listShow all active tunnels across all worktrees in the repository

Flags

FlagDescription
--provider <name>Tunnel provider to use: cloudflare (default) or ngrok
--port, -p <port>Specific local port to expose (default: first allocated HTTP port)
--service, -s <name>Tunnel a specific Compose service (automatically maps its HTTP port)

Examples

Start a Cloudflare tunnel for the current worktree (auto-detects HTTP port):

docktree tunnel start

Start a tunnel using ngrok for a specific service:

docktree tunnel start --provider ngrok --service web

Start a tunnel for a specific port:

docktree tunnel start --port 41006

Show tunnel status:

docktree tunnel status

List all tunnels currently active across worktrees:

docktree tunnel list

Stop the tunnel for the current worktree:

docktree tunnel stop