Installation
There are two ways to install varlock:
- Install as a
package.jsondependency 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 inityarn dlx varlock initpnpm dlx varlock initvlx varlock initThis 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.examplefile - Add decorators to your
.env.schemafile 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 -sThen run the setup wizard to help you get started:
varlock initYou can then run varlock --help to see the available commands or read the CLI Reference.
Docs MCP
Section titled “Docs MCP”If you prefer to let AI tools do the heavy lifting, you can use the Docs MCP server. See more details here.