cf init creates and sets up Worker projects
Introduced 2026-09-27 · score 0.93
HOW TO USE IT
When creating a Worker in a new or empty directory, run `cf init <directory>`; after setup, enter the project and run `cf dev`.
cf init my-worker
cd my-worker
cf devcf init my-worker --no-install
cd my-worker
npm install
cf devWHY THIS HELPS
Create and set up a hello-world Worker in a new or empty project directory.
REQUIREMENTS AND LIMITATIONS
- Version: 1.0.0-beta.2
- Availability: Uses `@cloudflare/vite-plugin` v2 beta.
- Requires The command installs dependencies with the package manager you pick unless `--no-install` is used.
- directory: Target directory; if omitted, cf prompts for one. For hello-world creation it must be new or empty (only `.git` may exist).
- --no-install: Skips dependency installation; run a package manager's install command in the project before `cf dev`.
- Prerequisite: Install `cf`; the official CLI README requires Node.js 22 or newer.
- Prerequisite: You do not need to sign in until deployment.
- A new or empty directory is required for hello-world Worker creation; a `.git` directory is allowed.
- Directories that already contain files are configured with autoconfig instead.
- Without `--no-install`, dependencies are installed with the selected package manager.
- With `--no-install`, `cf dev` or the project's `typecheck` script generates `.cloudflare/types/index.d.ts` later.
- The default initializer `cf init workers [directory]` currently behaves the same way.
FIRST-PARTY EVIDENCE
- https://github.com/cloudflare/cf/blob/main/packages/cli/CHANGELOG.md#100-beta2
- https://developers.cloudflare.com/cf/get-started/first-worker/
- https://github.com/cloudflare/cf/blob/main/packages/cli/README.md
Check the installed version and the source before using it. Entry JSON