Loading...
Loading...
Use dotenvx to run commands with environment variables, manage multiple .env files, expand variables, and encrypt env files for safe commits and CI/CD.
npx skill4agent add motdotla/dotenv dotenvxnpm install @dotenvx/dotenvxyarn add @dotenvx/dotenvx
pnpm add @dotenvx/dotenvx
bun add @dotenvx/dotenvx.env# .env
HELLO="Dotenv"
OPENAI_API_KEY="your-api-key-goes-here"dotenvx encrypt// index.js
require('@dotenvx/dotenvx').config()
// or import '@dotenvx/dotenvx/config' // for esm
console.log(`Hello ${process.env.HELLO}`)$ node index.js
◇ injected env (2) from .env
Hello Dotenvprocess.env.env.env.keys.env.env.envrequire('@dotenvx/dotenvx').config()
// or: import '@dotenvx/dotenvx/config'