Vectrune Cloudflare
Bundle, deploy, and manage Cloudflare Workers from native Rune REST apps — supporting both pure .rune edge APIs and custom ES module Workers.
Install and approve
Use Vectrune v0.3.14 or newer with native package support. Replace LIBRARY with the matching shared library from the release archive.
vectrune deps add cloudflarevectrune native approve cloudflare LIBRARY
Native approval is available on macOS and Linux. Pass --sha256 DIGEST in scripts and CI.
Rune import
import "pkg:cloudflare"This import enables @CloudflareWorker sections and cloudflare.* actions in native REST apps.
Section
@CloudflareWorker/<instance>- Declares a Cloudflare Worker deployment. Set script_name and either source (a .rune REST app bundled with an embedded 70 KB V8 runtime) or script_path (an ES module Worker file). Credentials are read from environment variables (CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN by default).
@CloudflareWorker/helloscript_name = "vectrune-hello-edge"source = "hello_edge.rune"compatibility_date = "2025-03-01"custom_domain = "api.example.com"account_id_env = "CLOUDFLARE_ACCOUNT_ID"api_token_env = "CLOUDFLARE_API_TOKEN"
Package commands
report = cloudflare.bundle hello options- Builds the self-contained Cloudflare Worker ES module locally without calling Cloudflare. Pass an options object with optional output_path.
result = cloudflare.deploy hello options- Uploads the Worker module, binds plain-text vars, and attaches custom_domain if configured. Set dry_run = true in options to validate locally.
status = cloudflare.status hello options- Returns whether the script exists, its etag, last modified time, and bound custom domains.
deleted = cloudflare.delete hello options- Deletes the Worker script from your Cloudflare account.
@Apptype = RESThost = 127.0.0.1port = 3000@Route/POST /deployrun:# Protect local deploy routes with an auth header and never forward raw request bodies.result = cloudflare.deploy hello \"dry_run\": falserespond 200 result