wrangler
Scale workloads on Kubernetes clusters
TLDR
Initialize a project with a skeleton configuration
Authenticate with Cloudflare
Start a local development server
Publish the worker script
Aggregate logs from the production worker
SYNOPSIS
wrangler
Examples:
wrangler init <project-name>
wrangler dev
wrangler deploy
wrangler login
PARAMETERS
init <name>
Creates a new Worker project with a specified name and basic boilerplate.
dev
Starts a local development server for a Worker, including live reloading and environment simulation.
deploy / publish
Deploys or publishes the Worker project to Cloudflare's global network, making it live.
login
Authenticates Wrangler with your Cloudflare account, typically via a browser-based flow.
secret
Manages secrets for your Worker, which are securely injected as environment variables at runtime.
kv
Manages Cloudflare KV namespaces and data, allowing interaction with key-value stores.
--help, -h
Displays help information for Wrangler or a specific subcommand.
--version, -v
Prints the current Wrangler CLI version.
DESCRIPTION
Wrangler is the official command-line interface (CLI) for Cloudflare Workers, enabling developers to build, test, and deploy serverless applications and APIs directly from their terminal. It provides comprehensive tools for local development, project scaffolding, environment management, and interaction with Cloudflare services like KV, D1, R2, and Pages.
This powerful tool streamlines the deployment pipeline, allowing users to write JavaScript, TypeScript, or WebAssembly code that runs on Cloudflare's global edge network. It simplifies authentication, secret management, and provides real-time logs and debugging capabilities, making it an essential utility for anyone developing on the Cloudflare Workers platform.
CAVEATS
Wrangler is not a standard Linux command or a core utility included with most Linux distributions. It is a specific application developed by Cloudflare, primarily used for managing Cloudflare Workers. It typically requires Node.js and npm (or Yarn) to be installed on the system, as it is distributed as an npm package. Its functionality is entirely tied to the Cloudflare ecosystem and its serverless platform.
CONFIGURATION FILE
Wrangler projects are configured using a wrangler.toml file, which specifies project settings, bindings to Cloudflare services, environment-specific configurations, and entry points for your Worker code.
ECOSYSTEM INTEGRATION
Wrangler seamlessly integrates with Cloudflare's broader suite of products, including Cloudflare KV (key-value store), D1 (serverless database), R2 (object storage), and Pages (static site hosting and SSR), allowing developers to build full-stack applications at the edge.
HISTORY
Wrangler was developed by Cloudflare to provide a robust command-line tool for their rapidly growing Cloudflare Workers serverless platform. Its initial versions focused on basic deployment, evolving significantly to include a local development server, support for various Cloudflare services (like KV, D1, R2, Pages), and advanced features for complex serverless application development, becoming the de facto tool for interacting with the Workers ecosystem. Its development closely mirrors the expansion and capabilities of the Cloudflare Workers platform itself.