wrangler
4.164.0 · 17 Nov 2026MIT OR Apache-2.049.3M / weekRepositoryHomepagenpmAtom feed
4.167.0 is the newest release of 4.x.
In short
6 new8 fixed2 internal
Release note
Minor Changes
Add CF_PAGES environment variables to
wrangler pages devwrangler pages devnow automatically injects Pages-specific environment variables (CF_PAGES,CF_PAGES_BRANCH,CF_PAGES_COMMIT_SHA,CF_PAGES_URL) for improved dev/prod parity. This enables frameworks like SvelteKit to auto-detect the Pages environment during local development.CF_PAGESis set to"1"to indicate the Pages environmentCF_PAGES_BRANCHdefaults to the current git branch (or"local"if not in a git repo)CF_PAGES_COMMIT_SHAdefaults to the current git commit SHA (or a placeholder if not in a git repo)CF_PAGES_URLis set to a simulated commit preview URL (e.g.,https://<sha>.<project-name>.pages.dev)
These variables are displayed with their actual values in the bindings table during startup, making it easy to verify what branch and commit SHA were detected.
These variables can be overridden by user-defined vars in the Wrangler configuration,
.env,.dev.vars, or via CLI flags.Allow deleting KV namespaces by name
You can now delete a KV namespace by providing its name as a positional argument:
wrangler kv namespace delete my-namespace
This aligns the delete command with the create command, which also accepts a namespace name.
The existing--namespace-idand--bindingflags continue to work as before.Add Pages detection to autoconfig flows
When running the autoconfig logic (via
wrangler setup,wrangler deploy --x-autoconfig, or the programmatic autoconfig API), Wrangler now detects when a project appears to be a Pages project and handles it appropriately:For
wrangler deploy, it warns the user but still allows them to proceedFor
wrangler setupand the programmatic autoconfig API, it throws a fatal error
Support
type: inheritbindings when using startWorker()This is an internal binding type that should not be used by external users of the API
Add
--jsonflag towrangler whoamifor machine-readable outputwrangler whoami --jsonnow outputs structured JSON containing authentication status, auth type, email, accounts, and token permissions. When the user is not authenticated, the command exits with a non-zero status code and outputs{"loggedIn":false}, making it easy to check auth status in shell scripts without parsing text output.# Parse the JSON output wrangler whoami --json | jq '.accounts' # Check if authenticated in a script. Returns 0 if authenticated, non-zero if not. if wrangler whoami --json > /dev/null 2>&1; then echo "Authenticated" else echo "Not authenticated" fi
Patch Changes
Use project's package manager in wranger autoconfig
wrangler setupnow correctly detects and uses the project's package manager based on lockfiles (pnpm-lock.yaml,yarn.lock,bun.lockb,package-lock.json) and thepackageManagerfield inpackage.json. Previously, it would fall back to the package manager used to execute the command when run directly from the terminal, causing failures in pnpm and yarn workspace projects if the wrong manager was used in this step due to theworkspace:protocol not being supported by npm.This change leverages the package manager detection already performed by
@netlify/build-infoduring framework detection, ensuring consistent behaviour across the autoconfig process.Make sure that remote proxy sessions's logs can be silenced when the wrangler log level is set to "none"
Fix spurious config diffs when bindings from local and remote config are shown in different order
When comparing local and remote Worker configurations, binding arrays like
kv_namespaceswould incorrectly show additions and removals if the elements were in a different order. The diff now correctly recognizes these as equivalent by reordering remote arrays to match the local config's order before comparison.Use unscoped binary name for OpenNext autoconfig command overrides
The build, deploy, and version command overrides in the Next.js (OpenNext) autoconfig handler used the scoped package name
@opennextjs/cloudflare, which pnpm interprets as a workspace filter rather than a binary name. This causedwrangler deploy --x-autoconfigto fail for pnpm-based Next.js projects withERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL. Changed to use the unscoped binary nameopennextjs-cloudflare, which resolves correctly across all package managers.Stop proxying localhost requests when proxy environment variables are set
When
HTTP_PROXYorHTTPS_PROXYis configured, all fetch requests including ones tolocalhostwere routed through the proxy. This causedwrangler devand the Vite plugin to fail with "TypeError: fetch failed" because the proxy can't reach local addresses.This switches from
ProxyAgentto undici'sEnvHttpProxyAgent, which supports theNO_PROXYenvironment variable. WhenNO_PROXYis not set, it defaults tolocalhost,127.0.0.1,::1so local requests are never proxied.The
NO_PROXYconfig only applies to the request destination, not the proxy server address. So a proxy running on localhost (e.g. HTTP_PROXY=127.0.0.1) still works for outbound API calls.Fix
wrangler r2 sql querydisplaying[object Object]for nested valuesSQL functions that return complex types such as arrays of objects (e.g.
approx_top_k) were rendered as[object Object]in the table output becauseString()was called directly on non-primitive values. These values are now serialized withJSON.stringifyso they display as readable JSON strings.Fix incorrect logic during autoconfiguration (when running
wrangler setuporwrangler deploy --x-autoconfig) that caused parts of the project'spackage.jsonfile, removed during the process, to incorrectly be added backRemove default values for delivery delay and message retention and update messaging on limits
Fixes the issue of the default maximum message retention (365400 seconds) being longer than the maximum allowed retention period for free tier users (86400 seconds).
Previous:
Wrangler set a default value of 365400 seconds max message retention if the setting was not explicitly provided in the Wrangler configuration.
The maximum retention period was documented as 1209600 seconds for all queues users because it was required to be on paid tier.
Wrangler also set a default value of 0 seconds for delivery delay if the setting was not explicitly provided in the Wrangler configuration.
Updated:
Wrangler no longer sets a default value for max message retention so that the default can be applied at the API.
The maximum retention period is now documented as 86400 seconds for free tier queues and 1209600 seconds for paid tier queues
Wrangler also no longer sets a default value for delivery delay so that the default can be applied at the API.
Add confirmation prompt when deploying workflows with names that belong to different workers.
When deploying a workflow with a name that already exists and is currently associated with a different worker script, Wrangler will now display a warning and prompt for confirmation before proceeding. This helps prevent accidentally overriding workflows.
In non-interactive environments this check is skipped by default. Use the
--strictflag to enable the check in non-interactive environments, which will cause the deployment to fail if workflow conflicts are detected.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.