tuna --delete
Delete a tunnel and clean up all associated resources.
Usage
# Delete tunnel for current project
tuna --delete
# Delete specific tunnel by name
tuna --delete <tunnel-name>Examples
# Delete based on package.json config
tuna --delete
# Delete specific tunnel
tuna --delete tuna-alice-api-example-comWhat It Does
- Identifies the tunnel (from config or argument)
- Authenticates with Cloudflare
- Asks for confirmation
- Stops the service if running
- Deletes the tunnel from Cloudflare
- Removes DNS records
- Removes local credential files
- Removes config files
- Uninstalls service if no other tunnels
Output
$ tuna --delete
🔐 Touch ID required
Found tunnel: tuna-alice-api-example-com
Domain: alice-api.example.com
Created: 2024-01-23
⚠ This will:
- Delete the tunnel from Cloudflare
- Remove DNS records
- Delete local configuration
? Continue? Yes
✓ Tunnel deleted
✓ DNS records removed
✓ Local files removed
✓ Service uninstalledSkip Confirmation
Use --yes or -y to skip confirmation:
tuna --delete --yes
tuna --delete tuna-old-tunnel --yesFinding Tunnel Names
List tunnels to find the name:
$ tuna --list
NAME STATUS DOMAIN
tuna-alice-api-example-com ● active alice-api.example.com
tuna-old-project-example-com ○ down old-project.example.com
$ tuna --delete tuna-old-project-example-comWhat Gets Deleted
| Resource | Location | Deleted? |
|---|---|---|
| Tunnel | Cloudflare | ✅ |
| DNS CNAME record | Cloudflare | ✅ |
| Access Application | Cloudflare | ✅ |
| Tunnel credentials | ~/.tuna/tunnels/ | ✅ |
| Ingress config | ~/.tuna/config-*.yml | ✅ |
| API credentials | Keychain | ❌ (kept) |
What's NOT Deleted
- Your Cloudflare account credentials (in Keychain)
- Other tunnels
- The
tunaconfig in package.json
Use Cases
Clean Up Old Projects
Remove tunnels for projects you're no longer working on:
tuna --list
tuna --delete tuna-old-project-example-comStart Fresh
Delete and recreate a tunnel:
tuna --delete
tuna npm run dev # Creates new tunnelTeam Member Leaving
Clean up a team member's tunnel:
tuna --delete tuna-bob-api-example-comError Handling
Tunnel Not Found
$ tuna --delete tuna-nonexistent
Error: Tunnel 'tuna-nonexistent' not foundNo package.json
When running without a tunnel name:
$ tuna --delete
Error: No package.json found. Specify tunnel name:
tuna --delete <tunnel-name>See Also
- tuna --list - Find tunnel names
- tuna --stop - Stop without deleting