Prompt Buddy logoPrompt Buddy

cloudflare · Cloudflare Workers Docs

Workers Environments

Teaches how to configure and manage multiple deployment configurations for a single Worker application using Wrangler environments, including setting up environment-specific keys, managing secrets, and using command l...

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Workers Environments

Teaches how to configure and manage multiple deployment configurations for a single Worker application using Wrangler environments, including setting up environment-specific keys, managing secrets, and using command l...

When To Use

Use when you need to deploy different configurations of the same Worker to separate stages like staging and production using Wrangler commands or environment variables.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-wrangler-environments-workflow-guide.mdA guide explaining how to use Wrangler environments to manage different configurations, service bindings, and secrets for Cloudflare Workers.Questions about a guide explaining how to use Wrangler environments to manage different configurations, service bindings, and secrets...
examples/workers-wrangler-environments-cloudflare-workers-wrangler-environments-c.textA wrangler.toml configuration file demonstrating how to define multiple environment-specific settings for Cloudflare Workers.Exact payloads, commands, or snippets shown in A wrangler.toml configuration file demonstrating how to define multiple environment-specific settings for Cloudflare...
examples/workers-wrangler-environments-cloudflare-workers-wrangler-environments-t.textA TOML configuration example demonstrating how to define multiple environments and environment-specific variables in a wrangler.toml file.Exact payloads, commands, or snippets shown in A TOML configuration example demonstrating how to define multiple environments and environment-specific variables in...
examples/workers-wrangler-environments-cloudflare-workers-wrangler-environments-c-2.textA wrangler.toml configuration file demonstrating how to define multiple environments with different routes.Exact payloads, commands, or snippets shown in A wrangler.toml configuration file demonstrating how to define multiple environments with different routes.
examples/workers-wrangler-environments-cloudflare-workers-wrangler-environments-t-2.textA TOML configuration file demonstrating how to define multiple environments using the [env.name] syntax in Wrangler.Exact payloads, commands, or snippets shown in A TOML configuration file demonstrating how to define multiple environments using the [env.name] syntax in Wrangler.
examples/workers-wrangler-environments-cloudflare-workers-wrangler-environments-c-3.textA wrangler.toml configuration file demonstrating how to define environment-specific variables and KV namespace bindings.Exact payloads, commands, or snippets shown in A wrangler.toml configuration file demonstrating how to define environment-specific variables and KV namespace bindings.
examples/workers-wrangler-environments-cloudflare-workers-wrangler-environments-c-4.textA wrangler.toml configuration file demonstrating how to define environment-specific variables and KV namespace bindings.Exact payloads, commands, or snippets shown in A wrangler.toml configuration file demonstrating how to define environment-specific variables and KV namespace bindings.
examples/workers-wrangler-environments-cloudflare-workers-wrangler-environments-t-3.textA TOML configuration file demonstrating how to define multiple environments and environment-specific variables in wrangler.toml.Exact payloads, commands, or snippets shown in A TOML configuration file demonstrating how to define multiple environments and environment-specific variables in wra...
examples/workers-wrangler-environments-cloudflare-workers-wrangler-environments-c-5.textA wrangler.toml configuration file demonstrating how to define multiple environments and environment-specific variables.Exact payloads, commands, or snippets shown in A wrangler.toml configuration file demonstrating how to define multiple environments and environment-specific variables.
examples/workers-wrangler-environments-cloudflare-workers-wrangler-environments-c-6.textA wrangler.toml configuration example demonstrating how to define service bindings for different environments.Exact payloads, commands, or snippets shown in A wrangler.toml configuration example demonstrating how to define service bindings for different environments.
examples/workers-wrangler-environments-cloudflare-workers-wrangler-environments-c-7.textA wrangler.toml configuration file demonstrating how to define multiple environments and service bindings for Cloudflare Workers.Exact payloads, commands, or snippets shown in A wrangler.toml configuration file demonstrating how to define multiple environments and service bindings for Cloudfl...
examples/workers-wrangler-environments-cloudflare-workers-wrangler-environments-s.textAn example of defining secret environment variables like SECRET_KEY and APITOKEN within a Cloudflare Workers environment configuration.Exact payloads, commands, or snippets shown in An example of defining secret environment variables like SECRETKEY and APITOKEN within a Cloudflare Workers environme...
examples/workers-wrangler-environments-cloudflare-workers-wrangler-environments-c-8.textA wrangler.toml configuration example demonstrating how to define multiple environments with unique variables and routes.Exact payloads, commands, or snippets shown in A wrangler.toml configuration example demonstrating how to define multiple environments with unique variables and rou...
examples/workers-wrangler-environments-cloudflare-workers-wrangler-environments-t-4.textA TOML configuration file demonstrating how to define multiple environments, routes, and environment variables using Wrangler.Exact payloads, commands, or snippets shown in A TOML configuration file demonstrating how to define multiple environments, routes, and environment variables using...
examples/workers-wrangler-environments-cloudflare-workers-wrangler-environments-d.textA text snippet demonstrating the npx wrangler deploy command used for deploying Cloudflare Workers to specific environments.Exact payloads, commands, or snippets shown in A text snippet demonstrating the npx wrangler deploy command used for deploying Cloudflare Workers to specific enviro...
examples/workers-wrangler-environments-cloudflare-workers-wrangler-environments-d-2.textA text example demonstrating the configuration of a development environment for Cloudflare Workers using Wrangler.Exact payloads, commands, or snippets shown in A text example demonstrating the configuration of a development environment for Cloudflare Workers using Wrangler.
examples/workers-wrangler-environments-cloudflare-workers-wrangler-deploy-environ.textA text example demonstrating the command to deploy a Cloudflare Worker to a specific environment using the wrangler CLI.Exact payloads, commands, or snippets shown in A text example demonstrating the command to deploy a Cloudflare Worker to a specific environment using the wrangler CLI.
examples/workers-wrangler-environments-cloudflare-workers-wrangler-environments-s-2.textA text representation of the CLI output showing the process of uploading a worker to a specific staging environment using Wrangler.Exact payloads, commands, or snippets shown in A text representation of the CLI output showing the process of uploading a worker to a specific staging environment u...
examples/workers-wrangler-environments-cloudflare-workers-wrangler-deploy-environ-2.textA text example demonstrating the command to deploy a Cloudflare Worker to a specific environment using Wrangler.Exact payloads, commands, or snippets shown in A text example demonstrating the command to deploy a Cloudflare Worker to a specific environment using Wrangler.
examples/workers-wrangler-environments-cloudflare-workers-wrangler-environments-d-3.textA text example demonstrating the wrangler command used to upload a worker to a specific environment.Exact payloads, commands, or snippets shown in A text example demonstrating the wrangler command used to upload a worker to a specific environment.
examples/workers-wrangler-environments-cloudflare-workers-wrangler-environments-j.textA JavaScript code snippet demonstrating how to use environment variables to execute conditional logic for staging and production environments within a Cloudflare Worker.Exact payloads, commands, or snippets shown in A JavaScript code snippet demonstrating how to use environment variables to execute conditional logic for staging and...
examples/workers-wrangler-environments-cloudflare-workers-wrangler-environments-c-9.textA wrangler.toml configuration file demonstrating how to define multiple environments such as staging and production for a Cloudflare Worker.Exact payloads, commands, or snippets shown in A wrangler.toml configuration file demonstrating how to define multiple environments such as staging and production f...
examples/workers-wrangler-environments-cloudflare-workers-wrangler-environments-t-5.textA TOML configuration file demonstrating how to define multiple environments using the [env.name] syntax in Wrangler.Exact payloads, commands, or snippets shown in A TOML configuration file demonstrating how to define multiple environments using the [env.name] syntax in Wrangler.
examples/workers-wrangler-environments-cloudflare-workers-wrangler-environments.textA text-based example demonstrating the usage of different environments within a Cloudflare Workers Wrangler configuration.Exact payloads, commands, or snippets shown in A text-based example demonstrating the usage of different environments within a Cloudflare Workers Wrangler configura...
examples/workers-wrangler-environments-cloudflare-workers-wrangler-environments-d-4.textA text representation of the wrangler command sequence used to upload and publish a worker to different environments.Exact payloads, commands, or snippets shown in A text representation of the wrangler command sequence used to upload and publish a worker to different environments.

What This Skill Covers

  • Wrangler allows you to use environments to create different configurations for the same Worker application. Environments are configured in the Worker's Wrang...
  • Main sections: Non-inheritable keys and environments, Service bindings, Secrets for production, Secrets in local development, Examples.

Workflow

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. Do not add behavior or configuration that is not present in the attached source files.

Canonical source: https://developers.cloudflare.com/workers/wrangler/environments