dotenvx
Use dotenvx to run commands with environment variables, manage multiple .env files, expand variables, and encrypt env files for safe commits and CI/CD.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use dotenvx to run commands with environment variables, manage multiple .env files, expand variables, and encrypt env files for safe commits and CI/CD.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | dotenvx |
| description | Use dotenvx to run commands with environment variables, manage multiple .env files, expand variables, and encrypt env files for safe commits and CI/CD. |
dotenvx is a secure dotenv workflow for any language.
Use this skill when you need to:
.env files.env, .env.production, etc.).env files and keep keys out of gitInstall:
npm install @dotenvx/dotenvx --save
# or globally:
# curl -sfS https://dotenvx.sh | sh
# brew install dotenvx/brew/dotenvx
Node usage:
require('@dotenvx/dotenvx').config()
// or: import '@dotenvx/dotenvx/config'
CLI usage (any language):
dotenvx run -- node index.js
Run with default .env:
dotenvx run -- <command>
Load a specific file:
dotenvx run -f .env.production -- <command>
Load multiple files (first wins):
dotenvx run -f .env.local -f .env -- <command>
Make later files win:
dotenvx run -f .env.local -f .env --overload -- <command>
Encrypt:
dotenvx encrypt
# or
dotenvx encrypt -f .env.production
Run encrypted envs by supplying private key(s):
DOTENV_PRIVATE_KEY_PRODUCTION="<key>" dotenvx run -f .env.production -- <command>
Git rule:
.env.keys
Commit encrypted .env* files if needed, but never commit .env.keys.
Example:
USERNAME="alice"
DATABASE_URL="postgres://${USERNAME}@localhost/mydb"
dotenvx run resolves ${...} expressions at runtime.
Set private keys as CI secrets, then run through dotenvx:
env:
DOTENV_PRIVATE_KEY_PRODUCTION: ${{ secrets.DOTENV_PRIVATE_KEY_PRODUCTION }}
run: dotenvx run -f .env.production -- node index.js
Install this repo as an agent skill package:
npx skills add motdotla/dotenv
Typical requests: