Expose worktrees externally via Cloudflare Tunnel or ngrok.
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.
| Action | Description |
|---|---|
start | Start a tunnel for the current worktree's primary HTTP service |
stop | Stop the running tunnel for the current worktree |
status | Show status and URL of the tunnel for the current worktree |
list | Show all active tunnels across all worktrees in the repository |
| Flag | Description |
|---|---|
--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) |
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