Installation
There are two ways to install varlock
:
- Install as a
package.json
dependency in JavaScript/TypeScript projects - Install as a standalone binary
As a JavaScript/TypeScript dependency
Section titled “As a JavaScript/TypeScript dependency”Requires:
- Node.js version 22 or higher
Installation
Section titled “Installation”To install varlock
in your project, run:
npx varlock init
yarn dlx varlock init
pnpm dlx varlock init
This will install varlock
as a dependency and scan your project for .env
files and create a .env.schema
file in the root of your project. Depending on your project configuration, it will optionally:
- Remove your existing
.env.example
file - Add decorators to your
.env.schema
file to specify the type of each environment variable
As a standalone binary
Section titled “As a standalone binary”To install varlock
CLI as a binary, run:
# Install via homebrewbrew install dmno-dev/tap/varlock
# OR via cURLcurl -sSfL https://varlock.dev/install.sh | sh -s
Then run the setup wizard to help you get started:
varlock init
You can then run varlock --help
to see the available commands or read the CLI Reference.