Cloudflare Tunnelのロゴ

Cloudflare Tunnel

コミュニティ
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.

概要

公開者xiaoyuboi
リポジトリcloudflare-tunnel-skill
スキル名cloudflare-tunnel
スター
276
フォーク
50
同梱ファイル
8
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 8個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    xiaoyuboiがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Cloudflare Tunnel」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/xiaoyuboi/cloudflare-tunnel-skill/tree/main
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/xiaoyuboi/cloudflare-tunnel-skill.git \
  .claude/skills/cloudflare-tunnel
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでCloudflare Tunnelを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にCloudflare Tunnelを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Cloudflare Tunnelは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

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

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「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.

TypingMindでCloudflare Tunnelを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Cloudflare Tunnelはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにCloudflare Tunnelをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/xiaoyuboi/cloudflare-tunnel-skill/tree/mainを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Cloudflare Tunnelを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Cloudflare Tunnelで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもCloudflare Tunnelを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Cloudflare Tunnel」は無料ですか?

はい。xiaoyuboiがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇