Cloudflare Tunnel logo

Cloudflare Tunnel

Community
xiaoyuboi
cloudflare-tunnel

Use when a user wants to expose a local HTTP/HTTPS service to the public internet with Cloudflare Tunnel. Supports temporary Quick Tunnel URLs for previews and named tunnels with fixed custom domains for stable public mapping.

Overview

Publisherxiaoyuboi
Repositorycloudflare-tunnel-skill
Skill namecloudflare-tunnel
Stars
276
Forks
50
Bundled files
8
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 8 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by xiaoyuboi on GitHub. Read the source before you install it.

Installation

Install the Cloudflare Tunnel AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/xiaoyuboi/cloudflare-tunnel-skill/tree/main
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/xiaoyuboi/cloudflare-tunnel-skill.git \
  .claude/skills/cloudflare-tunnel
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Cloudflare Tunnel in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Cloudflare Tunnel on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Cloudflare Tunnel is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Cloudflare Tunnel Agent Workflow

Help the user expose a local service through Cloudflare Tunnel. Choose the safest working mode:

  • Quick mode: temporary https://*.trycloudflare.com URL. Use for demos, previews, classroom sharing, and short-lived testing.
  • Named mode: fixed hostname such as app.example.com. Use when the user owns a Cloudflare-managed domain and needs a stable public URL.

Before running commands, identify:

  1. Local service URL, usually http://localhost:<port> or https://localhost:<port>.
  2. Exposure mode: quick or named.
  3. Whether the service contains admin panels, tokens, private data, internal systems, or unauthenticated write APIs.

If the service is sensitive, pause and warn the user before exposing it. See references/security.md.

Paths and State

All scripts/... and references/... paths in this document are relative to this skill's install directory, not the user's project. When the working directory is the user's project, call the helper with its full installed path, for example:

bash
python3 ~/.claude/skills/cloudflare-tunnel/scripts/tunnel_helper.py quick --url http://localhost:3000

The helper writes runtime state to .cloudflare-tunnel/ inside the current working directory, so run status and stop from the same directory where quick was started. If that directory is a git repository, make sure .cloudflare-tunnel/ is in its .gitignore before committing.

Mode Selection

Use quick mode when:

  • The user says temporary, demo, preview, share localhost, quick public link, or no domain.
  • The URL may change after restart.
  • The user does not need Cloudflare login.

Use named mode when:

  • The user asks for a fixed domain, stable public URL, webhook endpoint, or long-lived mapping.
  • The user has a Cloudflare account and a domain whose DNS is managed by Cloudflare.
  • The hostname should survive process restarts.

If unclear, default to quick mode for non-sensitive demos and ask only when exposing a sensitive service or creating a fixed hostname.

Required Checks

Check cloudflared:

bash
cloudflared --version

Verify the local service before creating a tunnel:

bash
curl -I http://localhost:<PORT>

Treat 200, 301, 302, 304, 401, and 403 as evidence that the service is reachable. Investigate connection failures before starting a tunnel.

Quick Mode

Read references/quick-tunnel.md when the user wants a temporary public URL.

Preferred helper:

bash
python3 scripts/tunnel_helper.py quick --url http://localhost:<PORT>

The helper starts cloudflared in the background, waits for a trycloudflare.com URL, writes state under .cloudflare-tunnel/, and prints JSON with the public URL.

Helper behavior worth knowing:

  • If a quick tunnel for the same local URL is already running, it is reused ("reused": true). A running tunnel for a different local URL is stopped and replaced.
  • Transient api.trycloudflare.com failures are retried up to 3 times automatically.
  • verify falls back to DNS-over-HTTPS when the system resolver cannot resolve a fresh trycloudflare.com hostname (common behind fake-IP proxy DNS). DNS propagation can take one or two minutes; retry verify before treating the tunnel as broken.

Manual fallback:

bash
printf '' > /tmp/cloudflared-empty.yml
cloudflared --config /tmp/cloudflared-empty.yml tunnel --no-autoupdate --protocol http2 --url http://localhost:<PORT>

Wait for both:

  • https://*.trycloudflare.com in the output
  • at least one Registered tunnel connection log line

Then verify:

bash
python3 scripts/tunnel_helper.py verify --url https://xxxx.trycloudflare.com

Stop a helper-started tunnel:

bash
python3 scripts/tunnel_helper.py stop

Named Mode

Read references/named-tunnel.md when the user wants a fixed domain.

Typical locally-managed CLI flow:

bash
cloudflared tunnel login
cloudflared tunnel create <TUNNEL_NAME>
cloudflared tunnel route dns <TUNNEL_NAME> <HOSTNAME>

Create a config:

bash
python3 scripts/tunnel_helper.py named-config \
  --name <TUNNEL_NAME> \
  --hostname <HOSTNAME> \
  --url http://localhost:<PORT>

Run:

bash
cloudflared tunnel --config .cloudflare-tunnel/<TUNNEL_NAME>.yml run <TUNNEL_NAME>

Named mode may require an interactive browser login. Do not paste, print, commit, or store Cloudflare tokens outside the user's local Cloudflare config.

Output

After success, return:

  • Public URL
  • Local URL
  • Mode used
  • How to stop the tunnel
  • A short temporary/stability warning for quick mode

Example:

text
Public URL: https://xxxx.trycloudflare.com
Local URL: http://localhost:3000
Mode: quick
Stop: python3 scripts/tunnel_helper.py stop

This is a temporary Quick Tunnel URL. It stops working if cloudflared exits, the computer sleeps, or the network disconnects.

Troubleshooting

Use references/troubleshooting.md for:

  • no public URL in logs
  • 404 from the tunnel
  • 502 / Bad Gateway
  • self-signed local HTTPS
  • phone cannot open the link
  • named tunnel DNS or login failures

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Cloudflare Tunnel AI skill do?

Use when a user wants to expose a local HTTP/HTTPS service to the public internet with Cloudflare Tunnel. Supports temporary Quick Tunnel URLs for previews and named tunnels with fixed custom domains for stable public mapping.

Why use Cloudflare Tunnel on TypingMind?

Because you install it once and use it with any model. Cloudflare Tunnel is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Cloudflare Tunnel in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/xiaoyuboi/cloudflare-tunnel-skill/tree/main. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Cloudflare Tunnel?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Cloudflare Tunnel?

As many as you like. As long as a model supports skills, you can use Cloudflare Tunnel with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Cloudflare Tunnel AI skill free?

Yes. It is published on GitHub by xiaoyuboi under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇