# Can I "override" a variable when using Doppler run?

**URL:** <https://community.doppler.com/t/can-i-override-a-variable-when-using-doppler-run/1323>\
**Category:** Need Help\
**Created:** [August 31, 2023, 9:21am UTC](https://community.doppler.com/t/can-i-override-a-variable-when-using-doppler-run/1323 "2023-08-31T09:21:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexbjorlig](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/alexbjorlig/32/441_2.png) [@alexbjorlig](https://community.doppler.com/u/alexbjorlig)\
**Post date:** [August 31, 2023, 9:21am UTC](https://community.doppler.com/t/can-i-override-a-variable-when-using-doppler-run/1323/1 "2023-08-31T09:21:39Z")

</div>

Hi there.

I have a variable called `DEBUG` in my Doppler project (and all configs).

When I start my project like this locally; `doppler run -- npm run dev`, would it be possible to let any locally defined `DEBUG` take precedence?

Extra context:  
You might wonder why I even would like the `DEBUG` variable to be part of Doppler. The reason here is pretty simple. I’m trying to prepare for the near future where our project is moving to the edge (instead of node.js runtime) on the Vercel platform. We are using Sveltekit, and reading env secrets from [‘$env/static/private’](https://kit.svelte.dev/docs/modules#$env-static-private).

---

<div class="post-metadata">

**Author:** ![watsonian](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/watsonian/32/267_2.png) [@watsonian](https://community.doppler.com/u/watsonian)\
**Post date:** [August 31, 2023, 2:03pm UTC](https://community.doppler.com/t/can-i-override-a-variable-when-using-doppler-run/1323/2 "2023-08-31T14:03:31Z")

</div>

Hi @alexbjorlig!

Yep, we do have something like that! What you’re looking for is probably the `--preserve-env` flag:

```shell
doppler run --preserve-env=DEBUG -- npm run dev

```

That will preserve any variable you specify that’s already set in your local environment. You can pass in multiple variable names using a comma-delimited list:

```shell
doppler run --preserve-env=FOO,BAR,BAZ -- YOUR_COMMAND

```

For this particular flag, it does require the format above (i.e., using `--preserve-env FOO,BAR,BAZ` won’t work).

Give that a shot and let me know if it works for what you’re after

Regards,  
-Joel
