百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
D

dotenvx

> 安全
开源

一个安全的 dotenv——来自 `dotenv` 的创造者

5.7K stars0 点赞4 次浏览
访问官网GitHub

工具介绍

一个安全的 dotenv——来自 `dotenv` 的创造者

安全的 dotenv——由 dotenv 的创建者打造。

  • 随处运行(跨平台)
  • 多环境
  • 加密的环境变量

 

快速开始

像 dotenv 一样安装并在代码中使用。

bash
npm install @dotenvx/dotenvx --save
javascript
// index.js
require('@dotenvx/dotenvx').config()
// or import '@dotenvx/dotenvx/config' // for esm

console.log(`Hello ${process.env.HELLO}`)

 

或者全局安装——为任何语言、框架或平台解锁 dotenv!

使用 npm
bash
npm i -g @dotenvx/dotenvx
dotenvx encrypt

 

使用 curl
bash
curl -sfS https://dotenvx.sh | sh
dotenvx encrypt

 

使用 brew
bash
brew tap dotenvx/brew
brew trust dotenvx/brew
brew install dotenvx
dotenvx encrypt

 

使用 Docker
bash
docker run -it --rm -v $(pwd):/app dotenv/dotenvx encrypt

 

使用 GitHub 发布版
bash
curl -L -o dotenvx.tar.gz "https://github.com/dotenvx/dotenvx/releases/latest/download/dotenvx-$(uname -s)-$(uname -m).tar.gz"
tar -xzf dotenvx.tar.gz
./dotenvx encrypt

 

或 Windows
bash
winget install dotenvx
dotenvx encrypt

 

随处运行

bash
$ echo "HELLO=World" > .env
$ echo "console.log('Hello ' + process.env.HELLO)" > index.js

$ node index.js
Hello undefined # without dotenvx

$ dotenvx run -- node index.js
Hello World # with dotenvx
> :-D

请参阅快速入门指南

更多示例

Claude

在运行 Claude 时使用你的真实密钥,同时将其从输出中脱敏。

前提条件:安装 Claude Code 以获取 Claude 命令。

bash
$ curl -fsSL https://claude.ai/install.sh | bash
$ claude --version
bash
$

[Read the whitepaper](https://dotenvx.com/dotenvx.pdf?v=README)

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

JavaScriptcliconfiguration-filecurldotenv

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类安全
定价开源

> 相关工具

O
OWASP ZAP
开源 Web 应用安全扫描器
O
owasp-wstg-tracker
Simple web app to track OWASP WSTG security testing progress
H
homebridge-mi-gateway-security
XiaoMi Gateway Security plugin for HomeBridge.