Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Comprehensive Cloudflare platform skill covering Workers, D1, R2, KV, AI, Durable Objects, and security.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/c3/README.md
1# C3 (create-cloudflare)23Official CLI for scaffolding Cloudflare Workers and Pages projects with templates, TypeScript, and instant deployment.45## Quick Start67```bash8# Interactive (recommended for first-time)9npm create cloudflare@latest my-app1011# Worker (API/WebSocket/Cron)12npm create cloudflare@latest my-api -- --type=hello-world --ts1314# Pages (static/SSG/full-stack)15npm create cloudflare@latest my-site -- --type=web-app --framework=astro --platform=pages16```1718## Platform Decision Tree1920```21What are you building?2223├─ API / WebSocket / Cron / Email handler24│ └─ Workers (default) - no --platform flag needed25│ npm create cloudflare@latest my-api -- --type=hello-world2627├─ Static site / SSG / Documentation28│ └─ Pages - requires --platform=pages29│ npm create cloudflare@latest my-site -- --type=web-app --framework=astro --platform=pages3031├─ Full-stack app (Next.js/Remix/SvelteKit)32│ ├─ Need Durable Objects, Queues, or Workers-only features?33│ │ └─ Workers (default)34│ └─ Otherwise use Pages for git integration and branch previews35│ └─ Add --platform=pages3637└─ Convert existing project38└─ npm create cloudflare@latest . -- --type=pre-existing --existing-script=./src/worker.ts39```4041**Critical:** Pages projects require `--platform=pages` flag. Without it, C3 defaults to Workers.4243## Interactive Flow4445When run without flags, C3 prompts in this order:46471. **Project name** - Directory to create (defaults to current dir with `.`)482. **Application type** - `hello-world`, `web-app`, `demo`, `pre-existing`, `remote-template`493. **Platform** - `workers` (default) or `pages` (for web apps only)504. **Framework** - If web-app: `next`, `remix`, `astro`, `react-router`, `solid`, `svelte`, etc.515. **TypeScript** - `yes` (recommended) or `no`526. **Git** - Initialize repository? `yes` or `no`537. **Deploy** - Deploy now? `yes` or `no` (requires `wrangler login`)5455## Installation Methods5657```bash58# NPM59npm create cloudflare@latest6061# Yarn62yarn create cloudflare6364# PNPM65pnpm create cloudflare@latest66```6768## In This Reference6970| File | Purpose | Use When |71|------|---------|----------|72| **api.md** | Complete CLI flag reference | Scripting, CI/CD, advanced usage |73| **configuration.md** | Generated files, bindings, types | Understanding output, customization |74| **patterns.md** | Workflows, CI/CD, monorepos | Real-world integration |75| **gotchas.md** | Troubleshooting failures | Deployment blocked, errors |7677## Reading Order7879| Task | Read |80|------|------|81| Create first project | README only |82| Set up CI/CD | README → api → patterns |83| Debug failed deploy | gotchas |84| Understand generated files | configuration |85| Full CLI reference | api |86| Create custom template | patterns → configuration |87| Convert existing project | README → patterns |8889## Post-Creation9091```bash92cd my-app9394# Local dev with hot reload95npm run dev9697# Generate TypeScript types for bindings98npm run cf-typegen99100# Deploy to Cloudflare101npm run deploy102```103104## See Also105106- **workers/README.md** - Workers runtime, bindings, APIs107- **workers-ai/README.md** - AI/ML models108- **pages/README.md** - Pages-specific features109- **wrangler/README.md** - Wrangler CLI beyond initial setup110- **d1/README.md** - SQLite database111- **r2/README.md** - Object storage112