# How reference env within dopper run -- \[command\]

**URL:** <https://community.doppler.com/t/how-reference-env-within-dopper-run-command/290>\
**Category:** Need Help\
**Created:** [August 11, 2021, 8:12pm UTC](https://community.doppler.com/t/how-reference-env-within-dopper-run-command/290 "2021-08-11T20:12:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mario\_Fantastic](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/mario_fantastic/32/203_2.png) [@Mario\_Fantastic](https://community.doppler.com/u/Mario_Fantastic)\
**Post date:** [August 11, 2021, 8:12pm UTC](https://community.doppler.com/t/how-reference-env-within-dopper-run-command/290/1 "2021-08-11T20:12:00Z")

</div>

I’m currently trying to integrate it with netlify.

doppler run – netlify deploy --auth $NETLIFY\_AUTH\_TOKEN  
› Error: Flag --auth expects a value

The $NETLIFY\_AUTH\_TOKEN is already set up

doppler run – printenv NETLIFY\_AUTH\_TOKEN (this shows)  
doppler run – echo $NETLIFY\_AUTH\_TOKEN (doesn’t show anything) how to reference it?

---

<div class="post-metadata">

**Author:** ![brian-vallelunga](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/brian-vallelunga/32/3_2.png) [@brian-vallelunga](https://community.doppler.com/u/brian-vallelunga)\
**Post date:** [August 11, 2021, 8:23pm UTC](https://community.doppler.com/t/how-reference-env-within-dopper-run-command/290/2 "2021-08-11T20:23:23Z")

</div>

Hey Mario, it looks like bash is executing on the variable before `doppler run` executes. Try this instead:

```auto
doppler run – netlify deploy --auth \$NETLIFY_AUTH_TOKEN

```

---

<div class="post-metadata">

**Author:** ![Mario\_Fantastic](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/mario_fantastic/32/203_2.png) [@Mario\_Fantastic](https://community.doppler.com/u/Mario_Fantastic)\
**Post date:** [August 12, 2021, 4:53am UTC](https://community.doppler.com/t/how-reference-env-within-dopper-run-command/290/3 "2021-08-12T04:53:28Z")

</div>

I have tried it but it doesn’t seem to work.

Apparently, I can’t `doppler run -- echo $anything` it doesn’t return anything back.

---

<div class="post-metadata">

**Author:** ![ryan-blunden](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/ryan-blunden/32/9_2.png) [@ryan-blunden](https://community.doppler.com/u/ryan-blunden)\
**Post date:** [August 12, 2021, 7:03am UTC](https://community.doppler.com/t/how-reference-env-within-dopper-run-command/290/4 "2021-08-12T07:03:39Z")

</div>

Hi @Mario_Fantastic,

Can you try using the `--command` flag instead:

```auto
doppler run --command='netlify deploy --auth $NETLIFY_AUTH_TOKEN'

```

---

<div class="post-metadata">

**Author:** ![Mario\_Fantastic](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/mario_fantastic/32/203_2.png) [@Mario\_Fantastic](https://community.doppler.com/u/Mario_Fantastic)\
**Post date:** [August 12, 2021, 7:28am UTC](https://community.doppler.com/t/how-reference-env-within-dopper-run-command/290/6 "2021-08-12T07:28:16Z")

</div>

Ah thank you very much! That works!

Any plans for Doppler team to integrate it in the normal `dopper run --`

In case anyone attempts to access the $ENV from the shell command like mine.

I couldn’t find a proper reference. For that --command flag, I only saw in doc for using multiple commands.

Best regards

---

<div class="post-metadata">

**Author:** ![ryan-blunden](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/ryan-blunden/32/9_2.png) [@ryan-blunden](https://community.doppler.com/u/ryan-blunden)\
**Post date:** [August 12, 2021, 12:28pm UTC](https://community.doppler.com/t/how-reference-env-within-dopper-run-command/290/7 "2021-08-12T12:28:51Z")

</div>

Great idea @Mario_Fantastic and I’ve added a new example in our [CLI Accessing Secrets Guide](https://docs.doppler.com/docs/accessing-secrets#accessing) that uses the `--command` flag.
