Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

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-com

What It Does

  1. Identifies the tunnel (from config or argument)
  2. Authenticates with Cloudflare
  3. Asks for confirmation
  4. Stops the service if running
  5. Deletes the tunnel from Cloudflare
  6. Removes DNS records
  7. Removes local credential files
  8. Removes config files
  9. 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 uninstalled

Skip Confirmation

Use --yes or -y to skip confirmation:

tuna --delete --yes
tuna --delete tuna-old-tunnel --yes

Finding 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-com

What Gets Deleted

ResourceLocationDeleted?
TunnelCloudflare
DNS CNAME recordCloudflare
Access ApplicationCloudflare
Tunnel credentials~/.tuna/tunnels/
Ingress config~/.tuna/config-*.yml
API credentialsKeychain❌ (kept)

What's NOT Deleted

  • Your Cloudflare account credentials (in Keychain)
  • Other tunnels
  • The tuna config 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-com

Start Fresh

Delete and recreate a tunnel:

tuna --delete
tuna npm run dev  # Creates new tunnel

Team Member Leaving

Clean up a team member's tunnel:

tuna --delete tuna-bob-api-example-com

Error Handling

Tunnel Not Found

$ tuna --delete tuna-nonexistent
Error: Tunnel 'tuna-nonexistent' not found

No package.json

When running without a tunnel name:

$ tuna --delete
Error: No package.json found. Specify tunnel name:
  tuna --delete <tunnel-name>

See Also