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 inityarn dlx varlock initpnpm dlx 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 - Install the desktop app
- Encrypt secrets in your
.envfile
As a binary
Section titled “As a binary”To install Varlock as a binary, run:
curl -sSfL https://varlock.dev/install.sh | sh -sThis will install the varlock CLI binary and (optionally) the desktop app.
Desktop app
Section titled “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.