Scaffold a Worker application
The create-cloudflare generator wraps Cloudflare’s create-cloudflare (C3) CLI to scaffold a Worker project, then makes it Nx-ready with Wrangler target inference and workspace-managed dependencies.
Aliases: c3, application, app
bunx nx g @naxodev/nx-cloudflare:application my-worker
Options
Section titled “Options”| Option | Type | Default | Description |
|---|---|---|---|
directory | string | (required) | The directory of the new application. Accepted as the first positional argument. |
name | string | - | The name of the application. |
type | string | - | Worker template, forwarded to C3 --type (e.g. hello-world, hello-world-durable-object, scheduled, queues, openapi). Provide exactly one of type, framework, or template. |
framework | string | - | Web framework, forwarded to C3 --framework (e.g. react, hono, next, astro, svelte, vue). Provide exactly one of type, framework, or template. |
template | string | - | Remote git template, forwarded to C3 --template. Provide exactly one of type, framework, or template. |
lang | ts | js | python | ts | Language of the generated scaffold, forwarded to C3 --lang. |
c3Version | string | - | Override the pinned create-cloudflare version to invoke. |
c3Args | string[] | - | Additional raw flags forwarded to create-cloudflare. Generator-controlled flags (git, deploy, open, auto-update) cannot be overridden. |
tags | string | - | Add tags to the application (used for linting). |
useProjectJson | boolean | false | Write an explicit project.json. Off by default — the worker is registered from its package.json and Wrangler config via target inference. |
observability | boolean | false | Enable Workers observability (observability.enabled = true) in the generated wrangler.jsonc so logs are retained. Opt-in. |
smartPlacement | boolean | false | Enable Smart Placement (placement.mode = "smart") in the generated wrangler.jsonc so Cloudflare runs the Worker closest to your backend. Opt-in. |
skipFormat | boolean | false | Skip formatting files. |
c3Version has no fixed default in the schema — when omitted, the generator invokes the version of create-cloudflare bundled with the plugin.
Provide exactly one of type, framework, or template to control the C3 scaffold non-interactively. If none are provided, C3’s interactive prompts guide selection.
See Enable observability and Smart Placement for details on the observability and smartPlacement flags.
Verify
Section titled “Verify”bunx nx show project my-worker
The project appears in the graph with inferred serve, deploy, and typegen targets — no project.json required.
Next steps
Section titled “Next steps”- binding generator — add KV, R2, D1, Durable Object, Queue, Workflow, or Service bindings
- Inferred targets —
serve,deploy,typegen,version-upload,version-deploy,tail - Plugin options — customizing inferred target names
- Wrangler config — config formats and inference
- library generator — scaffold a Worker library