create-envguard
v0.1.0
Published
Scaffold envguard into any Node.js project
Maintainers
Readme
create-envguard
Scaffold envguard into any Node.js project in one command.
Quick Start
npx create-envguardThat's it. The interactive wizard will:
- Detect your framework (Next.js, NestJS, Vite, Express, or plain Node)
- Ask about Docker/Kubernetes usage
- Install the right
@stacklance/envguard-*packages - Create
env.schema.tswith framework-appropriate defaults - Create
.env.examplefrom your existing.env - Add
env-guard checkto yourpredevandprebuildscripts - Add
.envto.gitignore
Framework-Specific Setup
Next.js
npx create-envguard --framework nextCreates a schema with NEXT_PUBLIC_* pattern support.
NestJS
npx create-envguard --framework nestjsInstalls @stacklance/envguard-nestjs and creates a schema with PORT and DATABASE_URL.
Vite
npx create-envguard --framework viteCreates a schema with VITE_* prefix support.
Express
npx create-envguard --framework expressPlain Node.js
npx create-envguard --framework nodeNon-Interactive Mode
Use the add subcommand to skip prompts:
npx create-envguard add
npx create-envguard add --framework next
npx create-envguard add --framework nestjs --docker --k8sFlags
| Flag | Description |
| --- | --- |
| --framework <name> | next, nestjs, vite, express, node |
| --docker | Include @stacklance/envguard-docker |
| --k8s | Include @stacklance/envguard-k8s |
| --skip-install | Skip package installation |
| --dry-run | Show what would be done without writing files |
What It Creates
your-project/
├── env.schema.ts ← Zod schema for your env vars
├── .env.example ← .env with values stripped
├── .gitignore ← .env added if missing
└── package.json ← predev/prebuild scripts addedPackage Manager Support
Automatically detects and uses your project's package manager:
- npm
- pnpm
- yarn
- bun
License
MIT
