Agent Skill

Cloudflare Wrangler CLI
Command-line tool for deploying, developing, and managing Cloudflare Workers, KV, R2, D1, Vectorize, AI, Queues, Workflows, and platform services
What is Cloudflare Wrangler CLI?
This skill provides agents with comprehensive knowledge of Wrangler, the official command-line interface for Cloudflare Workers and related platform services. It covers initializing new projects with appropriate templates, developing locally with hot reload and debugging, deploying Workers to production environments, managing KV namespaces for key-value storage, interacting with R2 object storage buckets, administering D1 SQLite databases with schema migrations, configuring Vectorize indexes for vector search, leveraging Workers AI for inference, managing Queues for asynchronous message processing, orchestrating Workflows for durable execution, handling secrets securely, and interpreting wrangler configuration files. The agent learns the proper syntax for commands and flags, understanding when to use interactive mode versus scripted automation, and how to troubleshoot common deployment issues. The skill establishes boundaries between local development workflows and production deployment considerations, emphasizing testing strategies and environment management. Trade-offs include choosing between different binding types for service integration, balancing between local simulation and remote testing for accuracy, and understanding the limitations of the local development server compared to production Workers runtime. The skill emphasizes consulting current Cloudflare documentation since command syntax evolves.
Key capabilities
Multi-service project scaffolding
Initializes new projects with templates for Workers, Pages, Durable Objects, or full-stack applications, generating appropriate wrangler.toml configuration and project structure
Local development with service bindings
Runs Workers locally with hot reload, simulates service bindings to KV, R2, D1, Durable Objects, and other Cloudflare services, enabling rapid iteration without deploying
Database migration and seeding
Manages D1 database schemas through migration files, applies migrations across environments, executes SQL commands, and seeds databases with initial data
Multi-environment deployment orchestration
Deploys Workers to production, staging, or custom environments with environment-specific configuration, manages versioning, and handles rollbacks when needed
Use cases
Full-stack application deployment pipeline
Use wrangler to scaffold a new full-stack application, configure bindings to D1 for database, R2 for file storage, and KV for caching, develop locally with all services mocked, then deploy to production with a single command
Database schema evolution management
Create D1 database migration files for schema changes, test migrations locally, apply them to staging environment for validation, then promote to production with rollback capability
Multi-region Worker deployment
Deploy identical Workers to multiple Cloudflare accounts or environments, manage environment-specific secrets and configuration, and coordinate deployments across geographic regions
AI model integration and testing
Configure Workers AI bindings in wrangler.toml, test AI inference locally during development, monitor usage and performance, and deploy production-ready AI-powered Workers
Compatibility
- wrangler
