This guide focuses on the CLI commands you need to Create, Read (List), Update, and Delete your Cloudflare resources directly from your terminal using wrangler.
Cloudflare D1 (SQL Database)
# Create a new databasewrangler d1 create <db-name>
# List all databaseswrangler d1 list
# Execute a direct SQL querywrangler d1 execute <db-name> --command "SELECT * FROM users;"
# Apply migrations to productionwrangler d1 migrations apply <db-name> --remote
# Delete a databasewrangler d1 delete <db-name>Cloudflare Workers (Serverless Functions)
# Initialize a new projectwrangler init <project-name>
# List all deployed workerswrangler list
# Deploy your worker to the edgewrangler deploy
# Tail live logs for debuggingwrangler tail <worker-name>
# Delete a worker (run inside project directory)wrangler deleteCloudflare Pages (Hosting)
# Create a new Pages projectwrangler pages project create <project-name>
# List all Pages projectswrangler pages project list
# Deploy a static directory to Pageswrangler pages deploy <directory-name>
# View live deployment logswrangler pages deployment tail
# Delete a Pages projectwrangler pages project delete <project-name>Cloudflare Queues (Message Broker)
# Create a new queuewrangler queues create <queue-name>
# List all active queueswrangler queues list
# Attach a worker as a consumerwrangler queues consumer add <queue-name> <worker-name>
# Remove a consumer from a queuewrangler queues consumer remove <queue-name> <worker-name>
# Delete a queuewrangler queues delete <queue-name>Cloudflare KV (Key-Value Store)
# Create a new KV namespacewrangler kv:namespace create <namespace-name>
# List all KV namespaceswrangler kv:namespace list
# Put a value into KVwrangler kv:key put --binding=<BINDING> "my-key" "my-value"
# Delete a KV namespacewrangler kv:namespace delete --binding=<BINDING>