Local Development

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:

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).
  • 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 allows, and every read is recorded in the 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.

One-Time Setup

Create a workspace and a secret

In Ennote, create a workspace 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 and sign in once. The session is stored in your OS keyring, not in a file.

ennote auth login

Start your app through Ennote

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

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

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:

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 and drop the flags.

Guides by Language

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?

If you encounter any issues or have questions, don't hesitate to contact support. Our team is here to assist you with any challenges you might face.