---
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-11-14T18:12:06.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_1J61Ub.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_1eTvTQ.webp)
    
    Divya Tagtachian
    

## Recent posts

News & Announcements November 10, 2026

[

### Netlify goes full stack: introducing Netlify Server

](/blog/introducing-netlify-server/)

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

News & Announcements September 29, 2026

[

### 5x faster Edge Functions: v8 isolates to Unikraft MicroVMs

](/blog/edge-functions-firecracker-microvms/)

-   Jake Champion
    
-   ![Profile picture of Aarthy Chandrasekhar](/images/people/aarthy-chandrasekhar.jpg)
    
    Aarthy Chandrasekhar
    
-   ![Profile picture of Ivan Zarea](/_astro/451968a8e873f95cf69c7edd78eb29a9035541eb-1024x1024_2wyTXf.webp)
    
    Ivan Zarea
    

Opinions & Insights September 22, 2026

[

### How we built Git storage for millions of Netlify projects

](/blog/how-we-built-git-storage-for-millions/)

-   ![Profile picture of Philippe Serhal](/_astro/795792fe4d14648b1b96285e46426ed964b802d7-512x512_Z23ebKb.webp)
    
    Philippe Serhal
    

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

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

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