跳到正文
WC.

env-from-example

工具
GitHub在线应用

.env

.env.example .env URL CLI

schema.json CLI .env.example REQUIREDTYPECONSTRAINTS--polish

env-from-example npm CLI .env.example .env schema

.env.example CLI 使 SESSION_SECRET schema.json

# No install required
npx @wchen.ai/env-from-example

# Non-interactive (CI, or accept defaults)
npx env-from-example -y

# Create .env.example if you don't have one
npx env-from-example --init
npx env-from-example --init .env   # from existing .env

.env.example

# Database connection [REQUIRED] [TYPE: network/uri] Default: postgres://localhost:5432/myapp
DATABASE_URL=postgres://localhost:5432/myapp

# Application port [TYPE: integer] [CONSTRAINTS: min=3000,max=10000] Default: 3000
PORT=3000

--polish .env.example polish

.env URL .env CI env-from-example --validate .env schema线

-e staging .env.staging--dry-run --version patch schema package.jsonpre-commit --validateGitHub Actions env-from-example -y -e test

@wchen.ai

scope 便 example env西

npm @wchen.ai/env-from-example dev npx env-from-example npx schema npm GitHub