Glossary/Keys & secrets

dotenv

dotenv refers both to the .env file convention itself and to the small libraries, such as python-dotenv or the Node.js dotenv package, that read a .env file and load its contents into a program's environment variables at startup.

Why it matters

A dotenv library does nothing to protect the file's contents, it simply parses key-value pairs from text and sets them as environment variables, so all the usual risks of a .env file, being committed by accident or read by anything else on the machine, still apply.

Do I need a dotenv library if I use Claude Keychain?

Not for the keys Claude Code uses. You may still use one for other, non-secret configuration.

Is dotenv a security tool?

No, it is a convenience for local development, not a way to protect a secret's value.

Related

Looking for a different way to manage your keys? See the best Claude Code API key manager alternatives, or browse every term in the glossary.