Installation
There are two ways to install varlock
:
- Install as a 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 - Encrypt secrets in your
.env
file
As a binary
Section titled “As a binary”To install varlock
CLI as a binary, run:
# Install via homebrewbrew install dmno-dev/tap/varlock
# OR Install via cURLcurl -sSfL https://varlock.dev/install.sh | sh -s
After installation, you can run varlock --help
to see the available commands or read the CLI Reference.