Skip to content

Installation

varlock makes your environment variables validated and secure. It is based on the env-spec standard.

There are two ways to install varlock:

  1. Install as a dependency in javascript/typescript projects
  2. Install as a binary in other languages

Requires:

  • OSX or Linux (WSL supported)
  • Node.js version 22 or higher

To install varlock in your project, run:

Terminal window
npx 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. It will optionally:

  • Remove your existing .env.example file
  • Add decorators to your .env.schema file to specify the type of each environment variable
  • Install the varlock CLI binary
  • Install the desktop app
  • Encrypt secrets in your .env file

To install Varlock as a binary, run:

Terminal window
brew install varlock

This will install the varlock CLI binary and the desktop app.

The varlock CLI also includes a desktop app that hooks into system level APIs to encrypt and decrypt environment variables. This means that you never have secrets sitting in plaintext on your system.