Pages Dev functions: seeding local KV for local dev

I start my local pages development thus:

npx wrangler pages dev --kv=TEST -- npm start

But I want to seed kv TEST local namespace with a few values before my functions are called. Is there a way to do this with a local file (e.g. like .dev.vars) or with command line options on wrangler?

Local kv uses regular files in .wrangler/state/kv/<namespace>. The name of the file is the key, and the content is the value.

So make a file in .wrangler/state/kv/TEST/foo with content bar, and Bob’s your uncle.