Reuse local storage state across commands

local dev

// what it does

Pins local KV/D1/R2/DO state to a chosen directory so it survives between runs and is shared across commands. Use it when you want d1 execute seeds to actually show up inside wrangler dev.

// shell

$ wrangler dev --persist-to ./.wrangler-state
$ wrangler d1 execute <name> --local --persist-to ./.wrangler-state --command "SELECT 1"

// gotcha

dev and d1 execute only see each other's data when they use the SAME --persist-to (default is .wrangler/state). A mismatched path silently gives you an empty, separate store.