Packages

wrangler

4.164.0 · 17 Nov 2026MIT OR Apache-2.049.3M / weekRepositoryHomepagenpmAtom feed

Your version

4.60.0

22 Jan 2026Where it was published

4.167.0 is the newest release of 4.x.

In short

2 new3 fixed4 internal

Release note

Minor Changes

  • Add wrangler complete command for shell completion scripts (bash, zsh, powershell)

    Usage:

    # Bash
    wrangler complete bash >> ~/.bashrc
    
    # Zsh
    wrangler complete zsh >> ~/.zshrc
    
    # Fish
    wrangler complete fish >> ~/.config/fish/completions/wrangler.fish
    
    # PowerShell
    wrangler complete powershell > $PROFILE
    • Uses @bomb.sh/tab library for cross-shell compatibility

    • Completions are dynamically generated from experimental_getWranglerCommands() API

  • wrangler types now generates per-environment TypeScript interfaces when named environments exist in your configuration.

    When your configuration has named environments (an env object), wrangler types now generates both:

    • Per-environment interfaces (e.g., StagingEnv, ProductionEnv) containing only the bindings explicitly declared in each environment, plus inherited secrets

    • An aggregated Env interface with all bindings from all environments (top-level + named environments), where:

      • Bindings present in all environments are required

      • Bindings not present in all environments are optional

      • Secrets are always required (since they're inherited everywhere)

      • Conflicting binding types across environments produce union types (e.g., KVNamespace | R2Bucket)

    However, if your config does not contain any environments, or you manually specify an environment via --env, wrangler types will continue to generate a single interface as before.

    Example:

    Given the following wrangler.jsonc:

    {
        "name": "my-worker",
        "kv_namespaces": [
            {
                "binding": "SHARED_KV",
                "id": "abc123",
            },
        ],
        "env": {
            "staging": {
                "kv_namespaces": [
                    { "binding": "SHARED_KV", "id": "staging-kv" },
                    { "binding": "STAGING_CACHE", "id": "staging-cache" },
                ],
            },
        },
    }

    Running wrangler types will generate:

    declare namespace Cloudflare {
        interface StagingEnv {
            SHARED_KV: KVNamespace;
            STAGING_CACHE: KVNamespace;
        }
        interface Env {
            SHARED_KV: KVNamespace; // Required: in all environments
            STAGING_CACHE?: KVNamespace; // Optional: only in staging
        }
    }
    interface Env extends Cloudflare.Env {}

Patch Changes

  • Fix wrangler pages project validate to respect file count limits from CF_PAGES_UPLOAD_JWT

  • Fixed the flag casing for the time period flag for the d1 insights command.

  • Fix wrangler setup not automatically selecting workers as the target for new SvelteKit apps

    The Sveltekit adapter:cloudflare adapter now accepts two different targets workers or pages. Since the wrangler auto configuration only targets workers, wrangler should instruct the adapter to use the workers variant. (The auto configuration process would in any case not work if the user were to target pages.)

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.