---
title: "Local Development Without .env Files"
description: "Stop keeping .env files on developer machines: store local development secrets in an Ennote workspace and start your app with ennote secret get, which injects them as environment variables of that process only."
canonical_url: "https://docs.ennote.io/guides/local-development/overview"
---
# Local Development Without .env Files

> Stop keeping .env files on developer machines: store local development secrets in an Ennote workspace and start your app with ennote secret get, which injects them as environment variables of that process only.

A `.env` file is a plain-text copy of your secrets on every developer's laptop. It gets committed by mistake, shared in chat, left in backups and goes stale when someone rotates a key. With Ennote, the secrets stay in an Ennote workspace and the CLI hands them to your app when it starts:

```bash
ennote secret get "site-env" -- npm run dev
```

The CLI fetches the latest version of the secret `site-env`, starts `npm run dev`, and passes every key of the secret to it as an environment variable. Nothing is written to disk, and the variables exist only in that process and the processes it starts. Your app reads them the same way it reads any environment variable, so the code does not change.

## How It Works

- **One secret, many keys.** Create one secret, for example `site-env`, and add each variable of your `.env` file as a key: `DATABASE_URL`, `STRIPE_SECRET_KEY`, `VITE_API_URL`. Each key becomes an environment variable with the same name. To move an existing file in one step, pipe it into a new secret: `cat .env | ennote secret create "site-env" --type KEYS_VALUES` (see [ennote secret create](https://docs.ennote.io/cli/commands/secret/create)).
- **Injected at start-up.** Values are read once, when the command starts. After you change the secret in Ennote, restart the dev server to pick up the new version.
- **Your sign-in, your access.** The CLI uses your own Ennote session, so a developer gets only the secrets their [workspace role](https://docs.ennote.io/docs/workspaces/permissions) allows, and every read is recorded in the [audit logs](https://docs.ennote.io/docs/organization/audit/logs).
- **Nested values become JSON strings.** Arrays and objects are passed as JSON strings; strings, numbers and booleans are passed as plain strings. See [JSON type handling](https://docs.ennote.io/cli/commands/secret/get#json-type-handling-serialization).

## One-Time Setup

<steps level="3">

### Create a workspace and a secret

In Ennote, create a [workspace](https://docs.ennote.io/docs/workspaces/create) for local development, for example `local-development`, and add a secret such as `site-env` with your development values.

Use development credentials here, never production ones. Give your team access by adding them to the workspace.

### Install the CLI and sign in

[Install the Ennote CLI](https://docs.ennote.io/cli/overview) and sign in once. The session is stored in your OS keyring, not in a file.

```bash
ennote auth login
```

### Start your app through Ennote

Put `ennote secret get "<secret>" --` in front of the command you already use:

```bash
ennote secret get "site-env" -- npm run dev
```

</steps>

## Sharing the Command With Your Team

Pass the organization and workspace IDs as flags and save the command in your project, for example in `package.json`. Everyone who clones the repository then runs the same command against the same workspace, without running `ennote config set` first:

```json [package.json]
{
  "scripts": {
    "dev": "ennote secret get \"site-env\" --organization-id \"my-org-id\" --workspace-id \"local-development\" -- vite"
  }
}
```

The IDs are not secret, so they are safe to commit. Access is still checked against each developer's own sign-in. If you prefer to keep the IDs out of the repository, have each developer set them once with [`ennote config set`](https://docs.ennote.io/cli/commands/config) and drop the flags.

## Guides by Language

- [JavaScript & TypeScript](https://docs.ennote.io/guides/local-development/javascript): Vite (Vue, React, Svelte), Next.js, Nuxt, Node.js
- [Python](https://docs.ennote.io/guides/local-development/python): Django, FastAPI, Flask
- [Go](https://docs.ennote.io/guides/local-development/go): `go run`, Air
- [Java & Kotlin](https://docs.ennote.io/guides/local-development/java): Spring Boot with Maven or Gradle, IntelliJ IDEA
- [PHP](https://docs.ennote.io/guides/local-development/php): Laravel, Symfony, Composer scripts
- [Ruby, .NET and Rust](https://docs.ennote.io/guides/local-development/more-languages): Rails, ASP.NET Core, Cargo

## Clean Up Old .env Files

Once your app runs through Ennote:

1. Delete the local `.env` files that hold secrets, on every machine.
2. Keep `.env` in `.gitignore` so it can't be committed by mistake.
3. If a `.env` file was ever committed or shared, rotate those credentials. Removing the file does not remove it from Git history.

## FAQ

### Does Ennote write a .env file to disk?

No. `ennote secret get "<secret>" -- <command>` passes the values to the command as environment variables in memory. No file is created.

### Do I need to change my application code?

No. Your app reads environment variables as before, with `process.env`, `os.environ`, `os.Getenv` or `System.getenv`. Only the command that starts it changes.

### Can I keep using dotenv libraries?

Yes. Libraries such as `dotenv` and `python-dotenv` do not override variables that are already set by default, so the values from Ennote win, and the app still starts when no `.env` file exists.

### What happens when a secret changes?

Running processes keep the values they started with. Restart the dev server to load the latest version.

<need-help>



</need-help>


## Sitemap

See the full [sitemap](https://docs.ennote.io/sitemap.md) for all pages.
