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/wrangler/README.md
1# Cloudflare Wrangler23Official CLI for Cloudflare Workers - develop, manage, and deploy Workers from the command line.45## What is Wrangler?67Wrangler is the Cloudflare Developer Platform CLI that allows you to:8- Create, develop, and deploy Workers9- Manage bindings (KV, D1, R2, Durable Objects, etc.)10- Configure routing and environments11- Run local development servers12- Execute migrations and manage resources13- Perform integration testing1415## Installation1617```bash18npm install wrangler --save-dev19# or globally20npm install -g wrangler21```2223Run commands: `npx wrangler <command>` (or `pnpm`/`yarn wrangler`)2425## Reading Order2627| If you want to... | Start here |28|-------------------|------------|29| Create/deploy Worker quickly | Essential Commands below → [patterns.md](./patterns.md) §New Worker |30| Configure bindings (KV, D1, R2) | [configuration.md](./configuration.md) §Bindings |31| Write integration tests | [api.md](./api.md) §startWorker |32| Debug production issues | [gotchas.md](./gotchas.md) + Essential Commands §Monitoring |33| Set up multi-environment workflow | [configuration.md](./configuration.md) §Environments |3435## Essential Commands3637### Project & Development38```bash39wrangler init [name] # Create new project40wrangler dev # Local dev server (fast, simulated)41wrangler dev --remote # Dev with remote resources (production-like)42wrangler deploy # Deploy to production43wrangler deploy --env staging # Deploy to environment44wrangler versions list # List versions45wrangler rollback [id] # Rollback deployment46wrangler login # OAuth login47wrangler whoami # Check auth status48```4950## Resource Management5152### KV53```bash54wrangler kv namespace create NAME55wrangler kv key put "key" "value" --namespace-id=<id>56wrangler kv key get "key" --namespace-id=<id>57```5859### D160```bash61wrangler d1 create NAME62wrangler d1 execute NAME --command "SQL"63wrangler d1 migrations create NAME "description"64wrangler d1 migrations apply NAME65```6667### R268```bash69wrangler r2 bucket create NAME70wrangler r2 object put BUCKET/key --file path71wrangler r2 object get BUCKET/key72```7374### Other Resources75```bash76wrangler queues create NAME77wrangler vectorize create NAME --dimensions N --metric cosine78wrangler hyperdrive create NAME --connection-string "..."79wrangler workflows create NAME80wrangler constellation create NAME81wrangler pages project create NAME82wrangler pages deployment create --project NAME --branch main83```8485### Secrets86```bash87wrangler secret put NAME # Set Worker secret88wrangler secret list # List Worker secrets89wrangler secret delete NAME # Delete Worker secret90wrangler secret bulk FILE.json # Bulk upload from JSON9192# Secrets Store (centralized, reusable across Workers)93wrangler secrets-store secret create <store-id> --name SECRET_NAME --scopes workers --remote94wrangler secrets-store secret list <store-id> --remote95```9697### Monitoring98```bash99wrangler tail # Real-time logs100wrangler tail --env production # Tail specific env101wrangler tail --status error # Filter by status102```103104## In This Reference105106- [configuration.md](./configuration.md) - wrangler.jsonc setup, environments, bindings107- [api.md](./api.md) - Programmatic API (`startWorker`, `getPlatformProxy`, events)108- [patterns.md](./patterns.md) - Common workflows and development patterns109- [gotchas.md](./gotchas.md) - Common pitfalls, limits, and troubleshooting110111## Quick Decision Tree112113```114Need to test your Worker?115├─ Testing full Worker with bindings → api.md §startWorker116├─ Testing individual functions → api.md §getPlatformProxy117└─ Testing with Vitest → patterns.md §Testing with Vitest118119Need to configure something?120├─ Bindings (KV, D1, R2, etc.) → configuration.md §Bindings121├─ Multiple environments → configuration.md §Environments122├─ Static files → configuration.md §Workers Assets123└─ Routing → configuration.md §Routing124125Development not working?126├─ Local differs from production → Use `wrangler dev --remote`127├─ Bindings not available → gotchas.md §Binding Not Available128└─ Auth issues → wrangler login129```130131## See Also132133- [workers](../workers/) - Workers runtime API reference134- [miniflare](../miniflare/) - Local testing with Miniflare135- [workerd](../workerd/) - Runtime that powers `wrangler dev`136