Skip to content
AnswerWell geo Documentation

Research · 8 min read · Answerwell

Worker Project Creation: C3 CLI, Templates, Frameworks, and Pages Platform

How to scaffold Cloudflare Workers and Pages apps with create-cloudflare (C3): commands, CLI flags, templates, frameworks, and what gets generated.

This page summarizes Cloudflare developer documentation on C3 (create-cloudflare, also called create-cloudflare-cli): the usual first step before tutorials for Workers, Pages, AI Search, Durable Objects, and framework guides. C3 scaffolds a directory, installs dependencies (including Wrangler), and optionally deploys.

C3 is the command-line entry point most Cloudflare guides use to create a new Worker or Pages project instead of hand-writing wrangler.jsonc and an entry script from scratch.

C3 (create-cloudflare CLI) is a command-line tool designed to help you set up and deploy new applications to Cloudflare. In addition to speed, it leverages officially developed templates for Workers and framework-specific setup guides to ensure each new application that you set up follows Cloudflare and any third-party best practices for deployment on the Cloudflare network.

— Cloudflare, C3 & Wrangler

Cloudflare provides a CLI command for creating new Workers and Pages projects — npm create cloudflare, powered by the create-cloudflare package ↗︎.

— Cloudflare, C3 CLI

Use C3 when you are starting a tutorial (Hello World Worker, AI agent, RAG sample, framework on Pages/Workers), when you want a remote GitHub template (--template), or when you need non-interactive flags for CI. After scaffolding, day-to-day work is typically npx wrangler dev and npx wrangler deploy, as in guides such as Bring your own generation model and Deploy Astro on Workers.

npm create cloudflare: basic command and interactive wizard

Section titled “npm create cloudflare: basic command and interactive wizard”

Open a terminal and run C3 with a project directory name after -- (npm requires the extra -- before arguments).

npm create cloudflare@latest -- my-first-worker

Equivalent package managers:

yarn create cloudflare my-first-worker
pnpm create cloudflare@latest my-first-worker

The wizard asks what to build. A pattern repeated across dozens of tutorials (for example Workers get started, First Worker, and Agents SDK) is:

Prompt Typical choice for a minimal Worker tutorial
What would you like to start with? Hello World example
Which template would you like to use? Worker only (or Worker + Durable Objects, Static site, SSR / full-stack app when the guide says so)
Which language do you want to use? TypeScript or JavaScript
Do you want to use git? Yes
Do you want to add an AGENTS.md file? Yes (optional; helps AI coding tools with Cloudflare APIs)
Do you want to deploy your application? No if the guide says you will edit code first; Yes when you want an immediate *.workers.dev URL

Then change into the project folder (cd my-first-worker).

What files C3 creates for a Hello World Worker

Section titled “What files C3 creates for a Hello World Worker”

After a standard Hello World flow, Workers get started and Build a RAG AI describe output along these lines:

  • wrangler.jsonc — Wrangler configuration (bindings, compatibility date, triggers).
  • src/index.js or src/index.ts — Worker entry with a fetch handler (ES modules).
  • package.json, lockfile, and node_modules after install.

The default handler illustrates the request/response model:

export default {
async fetch(request, env, ctx) {
return new Response("Hello World!");
},
};

From Build a todo list Jamstack application: incoming HTTP requests hit the fetch() handler; the Worker returns a response from Cloudflare’s edge rather than forwarding to a traditional origin for that logic.

Workers vs Cloudflare Pages: --platform=pages

Section titled “Workers vs Cloudflare Pages: --platform=pages”

By default, C3 targets Workers. For Pages, you must pass --platform=pages or C3 always creates a Workers project:

To create a Pages project you must now specify the –platform=pages arg, otherwise C3 will always create a Workers project.

— Cloudflare, C3 CLI

Example for a Pages app without a named framework yet:

npm create cloudflare@latest -- --platform=pages

Framework + Pages examples from the cluster:

npm create cloudflare@latest -- my-react-app --framework=react --platform=pages
npm create cloudflare@latest -- my-astro-app --framework=astro --platform=pages

For the same framework on Workers (often with static assets and npm run deploy), guides use --framework= without --platform=pages, for example Astro on Workers:

npm create cloudflare@latest -- my-astro-app --framework=astro

C3 then runs the framework’s official setup tool, adds adapters (for example @astrojs/cloudflare), and may offer instant deploy—see Deploy an Astro site on Pages.

C3 CLI arguments: skip prompts for CI and automation

Section titled “C3 CLI arguments: skip prompts for CI and automation”

C3 can take choices on the command line so prompts are skipped—required for non-interactive CI:

C3 collects any required input through a series of interactive prompts. You may also specify your choices via command line arguments, which will skip these prompts. To use C3 in a non-interactive context such as CI, you must specify all required arguments via the command line.

— Cloudflare, C3 CLI

General invocation shape:

npm create cloudflare@latest -- --platform=pages [<DIRECTORY>] [OPTIONS] [-- <NESTED ARGS...>]

Important options (from C3 CLI):

Flag Role
DIRECTORY Folder name; also becomes the app name
--category hello-world, web-framework, demo, remote-template
--type Worker archetype: hello-world, hello-world-durable-object, scheduled, queues, openapi, etc.
--framework Web framework (astro, next, nuxt, react, hono, vue, …); when set, --type is ignored
--template Remote git template (user/repo, branch #canary, subdirectory paths)
--lang ts, js, or python
--deploy Deploy after create (default true; use false in tutorials)
--git / --no-git Initialize git
--no-deploy Same as negated deploy
-y, --accept-defaults Accept defaults (overridable per flag)

Examples from tutorials:

Hello World without deploy (Postmark / Resend email Workers):

npm create cloudflare@latest email-with-postmark -- --type=hello-world --ts=false --git=true --deploy=false

Gradual deployments (type shorthand):

npm create cloudflare@latest my-worker -- --type=hello-world

Sandbox SDK minimal template:

npm create cloudflare@latest -- analyze-data --template=cloudflare/sandbox-sdk/examples/minimal#v0

Workflows starter from Cloudflare docs-examples:

npm create cloudflare@latest workflows-starter -- --template "cloudflare/workflows-starter"

Pre-set flags (code interpreter):

npm create cloudflare@latest sandbox-code-interpreter --category=hello-world --type=hello-world --lang=ts --no-deploy --no-git --no-agents

Non-interactive CI (Vectorize intro):

CI=true npm create cloudflare@latest vectorize-tutorial --type=simple --git --ts --deploy=false

Boolean flags accept --open, --open true, or --no-open for negation (C3 CLI).

-- NESTED ARGS pass through to third-party CLIs when C3 invokes framework tools (C3 CLI).

--framework and --template: two ways to start

Section titled “--framework and --template: two ways to start”

With --framework=<name>, C3 creates the directory, runs the framework’s installer, and wires Cloudflare adapters. Supported frameworks listed in C3 CLI include angular, astro, next, nuxt, react, svelte, vue, hono, remix, qwik, and others.

Next.js on Workers documents that C3 configures vinext, installs dependencies, and offers deploy; local dev uses npm run dev, and production deployment uses npm run deploy.

Hono on Workers can use a Cloudflare Vite + React template:

npm create cloudflare@latest my-hono-app --template=cloudflare/templates/vite-react-template

Some guides use Framework Starter in the wizard instead of --framework, for example Build a Slackbot (Hono) and Localize a website with HTMLRewriter (React).

From an existing repo (Workers get started):

npm create cloudflare@latest -- --template <SOURCE>

<SOURCE> can be user/repo, a branch user/repo#canary, a commit hash, or GitLab/Bitbucket forms. Templates must include at minimum package.json, a Wrangler config file, and src/ with the Worker script referenced from Wrangler (C3 CLI).

MCP client quick start:

npm create cloudflare@latest -- my-mcp-client --template=cloudflare/ai/demos/hello-world

Template and type choices beyond Hello World

Section titled “Template and type choices beyond Hello World”

Guides pick different C3 templates or types depending on the product:

Goal C3 choice Example doc
Durable Objects + SQLite seat booking Worker + Durable Objects Seat booking app
Durable Object starter Same template Durable Objects get started
Static front-end only Static site Static assets get started
Full-stack on Workers SSR / full-stack app Static assets (dynamic site), D1 e-commerce
Scheduled cron Worker Worker only + configure triggers.crons in Wrangler BGP anomalies
Sandbox / Agents tutorials --template=cloudflare/sandbox-sdk/... Analyze data with AI

After creation, product-specific steps add bindings in wrangler.jsonc (AI, R2, D1, KV, Queues, etc.)—C3 only provides the skeleton.

If you answered No to deploy during setup, deploy later with Wrangler (Bring your own generation model):

npx wrangler login
npx wrangler dev
npx wrangler deploy

Framework projects scaffolded by C3 often expose npm run dev and npm run deploy (Astro on Workers, React Router).

Initial C3 deploy to Pages is a Direct Upload; Git-based Pages flows are documented separately in framework guides such as Nuxt on Pages.

  • Expecting a Pages project without --platform=pages — you get a Worker instead (C3 CLI).
  • Running CI without all required flags — the wizard hangs or fails; set CI=true and pass --type, --lang, --deploy, etc. (Vectorize intro).
  • Assuming wrangler init --from-dash stays in sync with dashboard edits — CLI and dashboard can diverge (Wrangler init).
  • Wrong template for the tutorial — e.g. choosing Worker only when the guide requires Worker + Durable Objects (Durable Objects get started).
  • Deploying before bindings — many AI and Sandbox guides say No to initial deploy until wrangler.jsonc includes AI, Loader, or Sandbox bindings (Build an AI code interpreter).
  1. Run npm create cloudflare@latest -- test-c3-check (or your package manager equivalent) and complete or flag the same options as your target tutorial from Workers get started.

  2. Confirm the new directory contains wrangler.jsonc and src/index.ts or src/index.js as described in First Worker.

  3. From that directory, run npx wrangler dev and open the local URL (commonly port 8787) to see the Hello World response, matching Using BigQuery with Workers AI.

  4. If you used --platform=pages or a framework flag, run npm run dev when the scaffolded package.json provides it, per React on Pages.

  5. You can check automatically in Answerwell (our tool): https://answerwell.org/workspace

If something on this page does not match your C3 output or a linked Cloudflare doc, email yimasynthetic@gmail.com with the page URL and the exact sentence you think is wrong so it can be corrected.