Skip to content

feat(wrangler): add wrangler tunnel#12492

Merged
petebacondarwin merged 41 commits intocloudflare:mainfrom
thomasgauvin:tgauvin/wrangler-tunnel-commands
Mar 17, 2026
Merged

feat(wrangler): add wrangler tunnel#12492
petebacondarwin merged 41 commits intocloudflare:mainfrom
thomasgauvin:tgauvin/wrangler-tunnel-commands

Conversation

@thomasgauvin
Copy link
Contributor

@thomasgauvin thomasgauvin commented Feb 9, 2026

Manage Cloudflare Tunnels

COMMANDS
wrangler tunnel create Create a new Cloudflare Tunnel
wrangler tunnel delete Delete a Cloudflare Tunnel
wrangler tunnel info Display details about a Cloudflare Tunnel
wrangler tunnel list List all Cloudflare Tunnels in your account
wrangler tunnel update Update a Cloudflare Tunnel
wrangler tunnel run [tunnel] Run a Cloudflare Tunnel using cloudflared
wrangler tunnel quick-start Start a free, temporary tunnel without an account (https://try.cloudflare.com)
wrangler tunnel route Configure routing for a Cloudflare Tunnel (DNS hostnames or private IP networks)
wrangler tunnel service Manage cloudflared as a system service
wrangler tunnel cleanup <tunnels..> Remove stale tunnel connections
wrangler tunnel token Fetch the credentials token for an existing tunnel (by name or UUID) that allows to run it

GLOBAL FLAGS
-c, --config Path to Wrangler configuration file [string]
--cwd Run as if Wrangler was started in the specified directory instead of the current working directory [string]
-e, --env Environment to use for operations, and for selecting .env and .dev.vars files [string]
--env-file Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files [array]
-h, --help Show help [boolean]
-v, --version Show version number [boolean] commands for managing Cloudflare Tunnels
Adds tunnel management commands that align with the cloudflared CLI:

  • CRUD: create, list, info, update, delete
  • Runtime: run (with token/token-file support), quick-start (Try Cloudflare)
  • Routing: route dns, route ip (add/list/delete/get)
  • Operations: cleanup, token (with --cred-file), service install/uninstall
    Includes automatic cloudflared binary download and caching in
    ~/.wrangler/cloudflared/ with SHA256 verification, platform detection,
    and WRANGLER_CLOUDFLARED_PATH override support.

A picture of a cute animal (not mandatory, but encouraged)


Open with Devin

@thomasgauvin thomasgauvin requested a review from a team as a code owner February 9, 2026 17:18
@changeset-bot
Copy link

changeset-bot bot commented Feb 9, 2026

🦋 Changeset detected

Latest commit: d1462e5

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR Thomas.

I only took a quick look (description + delete) and added a few comments.

@petebacondarwin petebacondarwin marked this pull request as draft February 10, 2026 15:23
@petebacondarwin
Copy link
Contributor

Converting to draft since this PR is to act as a spec for the final commands that are to be landed as part of this feature.

@ascorbic
Copy link
Contributor

Love it. It would be great if we could support something like wrangler dev --tunnel, to expose your local wrangler dev server via a tunnel.

@petebacondarwin
Copy link
Contributor

Love it. It would be great if we could support something like wrangler dev --tunnel, to expose your local wrangler dev server via a tunnel.

I think that is a nice feature that is sort of orthogonal to this - except that they would both potentially download and run cloudflared.

devin-ai-integration[bot]

This comment was marked as resolved.

nikitacano and others added 2 commits March 6, 2026 19:00
…ional fields

- Re-throw UserError from withTunnelErrorHandling in run.ts catch block
  so detailed permission guidance isn't replaced by a generic message
- Add ?? fallbacks for optional id/name fields in list.ts logger.table()
  to satisfy TableRow type constraint from CloudflareTunnel SDK type
devin-ai-integration[bot]

This comment was marked as resolved.

nikitacano and others added 2 commits March 11, 2026 16:17
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@workers-devprod
Copy link
Contributor

workers-devprod commented Mar 11, 2026

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

devin-ai-integration[bot]

This comment was marked as resolved.

nikitacano and others added 5 commits March 11, 2026 16:24
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

Copy link
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good!
Marking as approved but please address the current outstanding comments.
I'll download and have another play with it on Monday morning.

@github-project-automation github-project-automation bot moved this from In Review to Approved in workers-sdk Mar 13, 2026
nikitacano and others added 3 commits March 16, 2026 11:25
…n-JSON response

- Add category: 'Networking & security' to tunnel namespace so it groups
  with cert and mtls-certificate in CLI help output
- Add logger.debug in queryUpdateService JSON parse catch block
- Update index.test.ts snapshots
Copy link
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried out locally seems to be working. There is still a lot of messages output, some of which look like scary errors but I can't tell whether this is expected or not.
Happy to land this (since it is experimental) and then let the team iterate on improvements.

@petebacondarwin petebacondarwin merged commit 3b81fc6 into cloudflare:main Mar 17, 2026
40 of 41 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Mar 17, 2026
@nikitacano nikitacano deleted the tgauvin/wrangler-tunnel-commands branch March 17, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.