Overview
Theclose command will gracefully terminate active tunnels. This feature is planned for a future release.
Usage
Current Behavior
In v0, running this command displays:Current Method: Using Ctrl+C
To close a tunnel in v0, use
Ctrl+C in the terminal where the tunnel is running:Ctrl+C signal triggers a graceful shutdown:
- Closes the WebSocket connection to the edge server
- Stops accepting new requests
- Terminates the CLI process
- Invalidates the public URL
Planned Functionality
In future versions, theclose command will:
- Close specific tunnels - Terminate by tunnel ID or URL
- Close all tunnels - Shut down all active wormholes
- Graceful shutdown - Complete in-flight requests before closing
- Confirmation prompts - Prevent accidental closures
- Remote closure - Close tunnels from a different terminal or machine
Expected Usage Examples
Expected Output
Planned Options
The ID or public URL of the tunnel to close. If omitted, closes all active tunnels (with confirmation).
Close all active tunnels without specifying individual IDs
Skip confirmation prompts and force close immediately
Wait for in-flight requests to complete before closing (graceful shutdown)
Alternative: Kill Process
If the tunnel process is unresponsive toCtrl+C, you can force kill it:
Step 1: Find the Process
Step 2: Kill the Process
Managing Background Tunnels
If you run tunnels in the background, you’ll need to track and close them manually:Running in Background
Closing Background Tunnel
Use Cases for Future Implementation
Whenclose is implemented, it will be useful for:
Remote Management
Close tunnels from any terminal
Automation
Script tunnel lifecycle management
Cleanup
Close all tunnels with one command
Graceful Shutdown
Complete requests before closing
Graceful vs Force Shutdown
Graceful Shutdown (Ctrl+C)
- Completes current requests
- Closes WebSocket connection properly
- Cleans up resources
- Returns exit code 0
Force Shutdown (kill -9)
- Immediate termination
- May leave connections open
- In-flight requests fail
- Use only when graceful shutdown fails
When Tunnels Auto-Close
Tunnels automatically close when:- Session expires - Based on
--expiresduration (default 24h) - Process exits - CLI process terminates for any reason
- Connection lost - Network interruption between CLI and edge
- Local server down - Target port becomes unreachable
Related Commands
wormkey http- Create a new tunnelwormkey status- Check active tunnels before closingwormkey login- Authenticate for remote management
See Also
- Quick Start - Learn tunnel basics
- Self-Hosting Setup - Run your own control plane