CLI
Cloudflare provides a CLI command for creating new Workers and Pages projects — npm create cloudflare, powered by the create-cloudflare package ↗.
Open a terminal window and run:
npm create cloudflare@latestpnpm create cloudflare@latestyarn create cloudflareRunning this command will prompt you to install the create-cloudflare ↗ package, and then ask you questions about the type of application you wish to create.
If you choose the "Framework Starter" option, you will be prompted to choose a framework to use. The following frameworks are currently supported:
When you use a framework, npm create cloudflare directly uses the framework's own command for generating a new projects, which may prompt additional questions. This ensures that the project you create is up-to-date with the latest version of the framework, and you have all the same options when creating you project via npm create cloudflare that you would if you created your project using the framework's tooling directly.
Once your project has been configured, you will be asked if you would like to deploy the project to Cloudflare. This is optional.
If you choose to deploy, you will be asked to sign into your Cloudflare account (if you aren't already), and your project will be deployed.
To create a new project using npm create cloudflare, and then connect it to a Git repository on your Github or Gitlab account, take the following steps:
- Run
npm create cloudflare@latest, and choose your desired options - Select
noto the prompt, "Do you want to deploy your application?". This is important — if you selectyesand deploy your application from your terminal (Direct Upload), then it will not be possible to connect this Pages project to a git repository later on. You will have to create a new Cloudflare Pages project. - Create a new git repository, using the application that
npm create cloudflare@latestjust created for you. - Follow the steps outlined in the Git integration guide
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.
This is the full format of a C3 invocation alongside the possible CLI arguments:
npm create cloudflare@latest [--] [<DIRECTORY>] [OPTIONS] [-- <NESTED ARGS...>]yarn create cloudflare [--] [<DIRECTORY>] [OPTIONS] [-- <NESTED ARGS...>]pnpm create cloudflare@latest [--] [<DIRECTORY>] [OPTIONS] [-- <NESTED ARGS...>]-
DIRECTORYstring optional- The directory where the application should be created. The name of the application is taken from the directory name.
-
NESTED ARGS..string[] optional- CLI arguments to pass to eventual third party CLIs C3 might invoke (in the case of full-stack applications).
-
--categorystring optional-
The kind of templates that should be created.
-
The possible values for this option are:
hello-world: Hello World exampleweb-framework: Framework Starterdemo: Application Starterremote-template: Template from a GitHub repo
-
-
--typestring optional-
The type of application that should be created.
-
The possible values for this option are:
hello-world: A basic "Hello World" Cloudflare Worker.hello-world-durable-object: A Durable Object and a Worker to communicate with it.common: A Cloudflare Worker which implements a common example of routing/proxying functionalities.scheduled: A scheduled Cloudflare Worker (triggered via Cron Triggers).queues: A Cloudflare Worker which is both a consumer and produced of Queues.openapi: A Worker implementing an OpenAPI REST endpoint.pre-existing: Fetch a Worker initialized from the Cloudflare dashboard.
-
-
--frameworkstring optional-
The type of framework to use to create a web application (when using this option,
--typeis ignored). -
The possible values for this option are:
angularastrodocusaurusgatsbyhononextnuxtqwikreactremixsolidsveltevue
-
-
--templatestring optional-
Create a new project via an external template hosted in a git repository
-
The value for this option may be specified as any of the following:
user/repogit@github.com:user/repohttps://github.com/user/repouser/repo/some-template(subdirectories)user/repo#canary(branches)user/repo#1234abcd(commit hash)bitbucket:user/repo(BitBucket)gitlab:user/repo(GitLab)
See the
degitdocs ↗ for more details.At a minimum, templates must contain the following:
package.json- Wrangler configuration file
src/containing a worker script referenced from the Wrangler configuration file
See the templates folder ↗ of this repo for more examples.
-
-
--deployboolean (default: true) optional- Deploy your application after it has been created.
-
--langstring (default: ts) optional-
The programming language of the template.
-
The possible values for this option are:
tsjspython
-
-
--tsboolean (default: true) optional- Use TypeScript in your application. Deprecated. Please use
--lang=tsinstead.
- Use TypeScript in your application. Deprecated. Please use
-
--gitboolean (default: true) optional- Initialize a local git repository for your application.
-
--openboolean (default: true) optional- Open with your browser the deployed application (this option is ignored if the application is not deployed).
-
--existing-scriptstring optional-
The name of an existing Cloudflare Workers script to clone locally. When using this option,
--typeis coerced topre-existing. -
When
--existing-scriptis specified,deploywill be ignored.
-
-
-y,--accept-defaultsboolean optional- Use all the default C3 options each can also be overridden by specifying it.
-
--auto-updateboolean (default: true) optional- Automatically uses the latest version of C3.
-
-v,--versionboolean optional- Show version number.
-
-h,--helpboolean optional- Show a help message.
Cloudflare collects anonymous usage data to improve create-cloudflare over time. Read more about this in our data policy ↗.
You can opt-out if you do not wish to share any information.
npm create cloudflare@latest -- telemetry disablepnpm create cloudflare@latest telemetry disableyarn create cloudflare telemetry disableAlternatively, you can set an environment variable:
export CREATE_CLOUDFLARE_TELEMETRY_DISABLED=1You can check the status of telemetry collection at any time.
npm create cloudflare@latest -- telemetry statuspnpm create cloudflare@latest telemetry statusyarn create cloudflare telemetry statusYou can always re-enable telemetry collection.
npm create cloudflare@latest -- telemetry enablepnpm create cloudflare@latest telemetry enableyarn create cloudflare telemetry enableWas this helpful?
- Resources
- API
- New to Cloudflare?
- Products
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- 2025 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark