Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

cloudflare-tunnel-publish

БесплатноЗапускает вложенные скриптыНе проверен

Publish a local service to a user-owned custom domain via Cloudflare Tunnel. Use when the user wants their own domain instead of community.iamstarchild.com…

Starchild-ai-agentот Starchild-ai-agent★ 34 звезды на GitHub

Об этом скилле

What this skill does

Turns a service running on a local port (default: a Starchild preview, but works for any HTTP service) into something the world can reach at app.userdomain.com, using Cloudflare Tunnel. No public IP required, no inbound ports opened, free SSL.

Two roles in the flow:

  • User does manually (must, can't be automated): create Cloudflare account, buy/transfer domain to Cloudflare, create API Token.
  • Agent does automatically (this skill): verify token, pick zone, create tunnel, configure ingress, create DNS, install + start cloudflared, verify the public URL works.

Audience assumption

Treat the user as a beginner. They may have never used Cloudflare. Walk them through one micro-step at a time, wait for confirmation, then move on. Do NOT dump the whole 10-step plan and disappear.

Workflow

Phase 0 — Set the stage (1 message)

Tell the user in plain language what's about to happen, in 4 phases:

  1. They register a Cloudflare account + add a domain (manual, ~5 min)
  2. They create an API Token and give it to you securely (manual, ~2 min)
  3. You build the tunnel + DNS + start it (automatic, ~1 min)
  4. You test the URL together (automatic)

Ask: "Do you already have a domain on Cloudflare, or do we need to start from scratch?" Branch on the answer.

Phase 1 — Get the user a domain on Cloudflare

If they don't have one yet:

Beginner hint to share: "When the domain shows status Active in your Cloudflare dashboard, we're good to continue."

If they already have one: skip to Phase 2.

Phase 2 — Create the API Token

Send them this exact link (it pre-fills the right permissions when possible, and the user can also build it manually):

https://dash.cloudflare.com/profile/api-tokens → Create Token → Create Custom Token

Required permissions (tell them to add these three):

  • Account → Cloudflare Tunnel → Edit
  • Zone → DNS → Edit
  • Zone → Zone → Read

Account Resources: their account. Zone Resources: Include All zones (or specifically the domain). TTL: leave default.

After they click Continue to summary → Create Token → Cloudflare shows the token once. Tell them: do not paste it in chat.

Phase 3 — Receive the token securely

Call request_env_input with:

env_vars=[{"key": "CLOUDFLARE_API_TOKEN", "label": "Cloudflare API Token", "required": true}]
reason="Used to create the tunnel and DNS record on your domain. Stored locally in workspace/.env, never echoed in chat."

Wait for the user to submit it via the secure popup. Do not retry-loop if they don't submit immediately — just wait.

Phase 4 — Verify token + pick the zone

Run python3 skills/cloudflare-tunnel-publish/scripts/verify.py. It prints:

  • Token validity
  • The user's account_id (saves to workspace/.cf_state.json)
  • All zones (domains) on the account

If multiple zones, ask the user which domain to use. Save zone_id and zone_name to state.

Phase 5 — Decide what to publish

Ask the user two things:

  1. Subdomain (e.g., app, demo, www) → final hostname will be <sub>.<zone_name>. Apex domain (@) is also allowed.
  2. Local port (e.g., 8080, 3000). If they say "my Starchild preview", run cat /data/previews.json 2>/dev/null to look up an existing preview's port; otherwise ask explicitly.

Default service URL: http://localhost:<port>.

Phase 6 — Build the tunnel (automated)

Run python3 skills/cloudflare-tunnel-publish/scripts/setup.py --hostname <full_hostname> --port <port>.

Tunnel reuse is the default. If a healthy tunnel already exists on the account, setup.py adds the new hostname to that tunnel's ingress and points the DNS CNAME at it — instead of creating a separate tunnel. One tunnel = one cloudflared process = one keepalive watchdog. Creating a new tunnel per site is how you end up with N processes to babysit and N ways to silently go dark (the exact bug that prompted this: a second tunnel's cloudflared died and nothing was watching it, because the watchdog only knew about the first).

Pass --new-tunnel only when you have a reason to isolate traffic (e.g. very high volume on one site that would saturate the shared edge connections).

The script does, in order:

  1. Reuse a healthy tunnel if one exists (or create one named starchild-<hostname> if none, or use --new-tunnel to force a new one)
  2. Fetch the tunnel run token (a long base64 string used to start cloudflared)
  3. PUT the ingress configuration: merge <hostname> → http://localhost:<port> into the existing ingress rules (preserving oth
Полный SKILL.md на GitHub

Установить cloudflare-tunnel-publish в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

logo.pngscripts/cf_api.pyscripts/check_status.pyscripts/keepalive.shscripts/run_tunnel.shscripts/setup.pyscripts/teardown.pyscripts/verify.py

FAQ

Что делает скилл cloudflare-tunnel-publish?

Publish a local service to a user-owned custom domain via Cloudflare Tunnel. Use when the user wants their own domain instead of community.iamstarchild.com (e.g. app.mydomain.com, fix SSL 521 on a custom domain).

Как установить скилл cloudflare-tunnel-publish?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл cloudflare-tunnel-publish запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить cloudflare-tunnel-publish с