Skip to main content

Cloudflare Pages Wrangler

@svendowideit/cloudflare-pages-wranglerv2026.10.24.2· MIT· 1d agoBEHAVIORS
01README

Direct-upload Cloudflare Pages deployment and custom-domain binding for sites that do not use a Git repository. WHAT IT DOES

Create and deploy a Cloudflare Pages project from a local directory, then bind a custom domain, without requiring Git integration or a GitHub repository. It wraps the Wrangler direct-upload workflow behind normal typed swamp methods so deployments are repeatable, auditable, and secret safe. Prefer it over manual drag-and-drop uploads or a shell script: the account, token, project name, directory, and domain all come from model arguments, and every method writes swamp data.

INSTALL

swamp extension pull @svendowideit/cloudflare-pages-wrangler

DEPENDENCIES

@swamp/cloudflare/pages supplies the Cloudflare Pages project type; direct upload uses Wrangler through npx on the host. Cloudflare account ID and a Pages-editing API token are required at run time.

RUN

# Create a direct-upload Pages project.
swamp model method run pages createProject \
  --input name=figy-blog

# Deploy a rendered directory to that project.
swamp model method run pages deployDirect \
  --input projectName=figy-blog --input directory=/home/me/site

# Bind the custom domain to the project.
swamp model method run pages bindDomain \
  --input projectName=figy-blog --input domain=blog.example.com

CONFIGURE

Set the global arguments on the model: accountId Cloudflare account ID apiToken Pages-capable Cloudflare API token productionBranch Production branch label (default main)

Method arguments: createProject.name Pages project name deployDirect.projectName Project to deploy deployDirect.directory Local directory to upload deployDirect.branch Optional deployment branch bindDomain.projectName Project receiving the domain bindDomain.domain Domain to bind

WHAT IT INSTALLS

Nothing persistent on the host. The model calls Cloudflare Pages APIs and runs Wrangler as a subprocess. Upgrade is just swamp extension update because nothing is installed locally.

02Behaviors1
@svendowideit/cloudflare-pages-wranglerv2026.10.24.2cf_pages_wrangler.ts

Global Arguments

ArgumentTypeDescription
accountIdstringCloudflare account ID
apiTokenstringCloudflare API token with Pages Edit and Zone DNS Edit
productionBranch?stringProduction branch name for the Pages project
fn createProject(name: string, productionBranch?: string)
Create a direct-upload Pages project without a Git source
ArgumentTypeDescription
namestringPages project name
productionBranch?stringProduction branch for the project
fn deployDirect(projectName: string, directory: string, branch?: string)
Deploy a local directory with Wrangler's supported direct-upload path
ArgumentTypeDescription
projectNamestringPages project name
directorystringLocal directory to upload
branch?stringDeployment branch
fn bindDomain(projectName: string, domain: string)
Bind a custom domain to a Pages project
ArgumentTypeDescription
projectNamestringPages project name
domainstringCustom domain name

Resources

project(infinite)— Cloudflare Pages direct-upload project or deployment state
03Previous Versions1
2026.10.24.1MIT
04Stats
A
100 / 100
Downloads
0
Archive size
5.3 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Docs keep secrets in a vault1/1earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License2/2earned
  • Verified public repository2/2earned
05Platforms
06Labels