Can't access KV namespace in local dev [VITE]

I'm pretty sure I'm entering the build command wrong. This will build the project just fine:
npx wrangler pages dev -- npm run dev

But I can't figure out where to put kv=KV_NAMESPACE

npx wrangler pages dev -- kv=KV_NAMESPACE npm run dev is wrong
npx wrangler pages dev -- npm run dev kv=KV_NAMESPACE is also wrong
npx wrangler pages dev -- npm run dev -- kv=KV_NAMESPACE also seems to be wrong


I tried to follow what was suggested in these two pages.
https://developers.cloudflare.com/pages/platform/functions/local-development/#run-your-pages-project-locally
https://developers.cloudflare.com/pages/platform/functions/bindings/#interact-with-your-kv-namespaces-locally
A binding enables your Pages Functions to interact with resources on the Cloudflare developer platform. Use bindings to integrate your Pages Functions
Run your Pages application locally with our Wrangler Command Line Interface (CLI).
Was this page helpful?