---
title: "More tips for environment variables and Netlify CLI | Netlify"
description: "Realize the speed, agility and performance of a scalable, composable web architecture with Netlify. Explore the composable web platform now!"
source: "https://www.netlify.com/blog/2021/12/10/more-tips-for-environment-variables-and-netlify-cli/"
last_updated: "2026-07-10T23:59:55.000Z"
---
> Throughout December we’ll be [highlighting a different Netlify feature each day](https://www.netlify.com/blog/2021/12/01/highlighting-a-different-netlify-feature-each-day-in-december/?utm_campaign=featdaily21&utm_source=netlify&utm_medium=blog&utm_content=cli-env-vars). It might just be the thing you need to unlock those creative juices, and [dust off that domain](https://www.netlify.com/blog/2021/12/01/dusty-domains-your-forgotten-domains-raise-money-for-charity/?utm_campaign=featdaily21&utm_source=netlify&utm_medium=blog&utm_content=cli-env-vars) you registered but never deployed! Keep an eye [on the blog](https://www.netlify.com/blog/2021/12/01/highlighting-a-different-netlify-feature-each-day-in-december/?utm_campaign=featdaily21&utm_source=netlify&utm_medium=blog&utm_content=cli-env-vars) and on [Twitter](https://twitter.com/netlify) for each feature!

As you’ll see [in this post](https://www.netlify.com/blog/2021/12/09/use-access-and-share-environment-variables-on-netlify/?utm_campaign=featdaily21&utm_source=netlify&utm_medium=blog&utm_content=cli-env-vars), Netlify supports environment variables in your projects (including centrally managed team environment variables for use across all of your team’s projects). A great feature of the [Netlify CLI](https://www.netlify.com/platform/core/cli/?utm_campaign=featdaily21&utm_source=netlify&utm_medium=blog&utm_content=cli-env-vars) is that it lets you manage your project’s environment variables without leaving your terminal, and can even make them available to your local development environment without the need for libraries or `.env` files.

Here are a few tips.

You’ll first need to make sure that you have the [Netlify CLI](https://www.netlify.com/platform/core/cli/?utm_campaign=featdaily21&utm_source=netlify&utm_medium=blog&utm_content=cli-env-vars) installed, and that you’ve linked your local project to a Netlify site.

```
# Install the Netlify CLI for use anywhere on your systemnpm install -g netlify-cli
```

```
# Link your the current folder to an existing Netlify projectnetlify link
# ...or create and link a new project in Netlifynetlify init
```

Now you can start managing the environment variables for the project.

#### Create or update an environment variable

```
# Set the value of an environment variable, creating it if needednetlify env:set MY_ENV_VAR "some value"
```

#### Check the value of an environment variable

```
# Get the value of an environment variablenetlify env:get MY_ENV_VAR
```

#### Delete an environment variable

```
# Delete an environment variablesnetlify env:unset MY_ENV_VAR
```

#### Listing all environment variables

```
# List all the environment variables available to this projectnetlify env:list
```

#### Import environment variables from a file

```
# Import many environment variables from a local filenetlify env:import .env
```

#### Accessing environment variables during local development

Here’s another place where [Netlify Dev](https://www.netlify.com/platform/core/cli/?utm_campaign=featdaily21&utm_source=netlify&utm_medium=blog&utm_content=cli-env-vars) (bundled as part of the Netlify CLI) really shines. When you use Netlify Dev to run your project, it will automatically make your environment variable available to your code with `process.env.VARIABLE_NAME`. Just the same as when the code runs in [Netlify Build](https://www.netlify.com/platform/core/build/?utm_campaign=featdaily21&utm_source=netlify&utm_medium=blog&utm_content=cli-env-vars) or your serverless [Netlify Functions](https://www.netlify.com/platform/core/functions/?utm_campaign=featdaily21&utm_source=netlify&utm_medium=blog&utm_content=cli-env-vars).

```
# Detect, run, and your build,# with all of your environment variablesnetlify dev
```

## More information

-   [Docs: Environment variables](https://docs.netlify.com/configure-builds/environment-variables/?utm_campaign=featdaily21&utm_source=netlify&utm_medium=blog&utm_content=cli-env-vars#declare-variables)
-   [Netlify CLI](https://www.netlify.com/platform/core/cli/?utm_campaign=featdaily21&utm_source=netlify&utm_medium=blog&utm_content=cli-env-vars)
-   [Netlify Dev — our entire platform, right on your laptop](https://www.netlify.com/blog/2019/04/09/netlify-dev-our-entire-platform-right-on-your-laptop/?utm_campaign=featdaily21&utm_source=netlify&utm_medium=blog&utm_content=cli-env-vars)

### Share

-   [X (fka Twitter)](https://twitter.com/intent/tweet?text=More tips for environment variables and Netlify CLI&url=https://www.netlify.com/blog/2021/12/10/more-tips-for-environment-variables-and-netlify-cli/)
-   [LinkedIn](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fwww.netlify.com%2Fblog%2F2021%2F12%2F10%2Fmore-tips-for-environment-variables-and-netlify-cli%2F)
-   [Facebook](https://www.facebook.com/sharer.php?u=https://www.netlify.com/blog/2021/12/10/more-tips-for-environment-variables-and-netlify-cli/)
-   [Bluesky](https://bsky.app/intent/compose?text=More tips for environment variables and Netlify CLI+https://www.netlify.com/blog/2021/12/10/more-tips-for-environment-variables-and-netlify-cli/)

* * *

### Tags

-   [Tips](/blog/tags/tips/)
-   [CLI](/blog/tags/cli/)
-   [Netlify Dev](/blog/tags/Netlify-Dev/)

## Keep reading

![](/images/blog-fallback-thumbnail.svg)

Guides & Tutorials December 10, 2020

[

### Environment variables in Next.js and Netlify

](/blog/2020/12/10/environment-variables-in-next.js-and-netlify/)

-   ![Profile picture of Cassidy Williams](/_astro/a62099fab0f946e063c4b84ff4b4d9c94f9aa7a5-400x400_ZdakPa.webp)
    
    Cassidy Williams
    

![](/images/blog-fallback-thumbnail.svg)

Guides & Tutorials May 21, 2020

[

### Localize your environment variables by context with build plugins

](/blog/2020/05/21/localize-your-environment-variables-by-context-with-build-plugins/)

-   ![Profile picture of Divya Tagtachian](/_astro/b9b198e6e1c100a667f1b9b97d1b39327587073f-80x80_Z2ehpic.webp)
    
    Divya Tagtachian
    

## Recent posts

News & Announcements June 25, 2026

[

### Netlify Functions, designed for Agent Experience

](/blog/netlify-functions-designed-for-agent-experience)

-   ![Profile picture of Eduardo Bouças](/_astro/52958f21e8450baf6d8e60302341a984e220c0cd-512x512_13VDlu.webp)
    
    Eduardo Bouças
    

News & Announcements June 24, 2026

[

### How we measure Netlify’s Agent Experience

](/blog/how-we-measure-netlify-agent-experience)

-   ![Profile picture of Sean Roberts](/_astro/bbf2243f8171dbddd80ab2103622106cef84d125-512x512_Z1d2LKE.webp)
    
    Sean Roberts
    

Guides & Tutorials May 15, 2026

[

### How to build a real-time AI chatbot in minutes with Netlify Agent Runners (no backend)

](/blog/how-to-build-a-real-time-ai-chatbot-in-minutes-with-netlify-agent-runners-no-backend)

-   ![Profile picture of Nahrin Jalal](/_astro/f0e7c8f227a03fe58340c99ef5439d5a896c0733-272x272_Z23kDpD.webp)
    
    Nahrin Jalal
    

![](/_astro/3f255b372fa958df35802666ee33b4609b2d71bd-1200x1586_1VtE2D.webp)

### How do the best dev and marketing teams work together?

[Access the report](https://www.netlify.com/reports/2024-leadership-trend-report/access/)