varsvars

Setup & Auth

Initialize a project, manage your encryption key, run health checks, and install the pre-commit hook.

init

vars init

Sets up a new vars project:

  1. Creates config.vars, the encrypted secrets file (safe to commit)
  2. Creates .varskey, the master encryption key (gitignored)
  3. Updates .gitignore to exclude key and swap files
  4. Adds #vars import to package.json scripts

If a .env file exists, vars offers to import it. It reads the key-value pairs, guesses Zod schemas from the values, and encrypts everything before writing.

If config.vars already exists but .varskey is missing (e.g., a fresh clone), running init again detects the incomplete setup and creates the missing key file.

Flags

FlagShortDescription
--file <path>-fPath to the .env file to import (default: .env)
--env <name>Environment name for imported values (default: dev)
# Import from a non-default path, label values as "staging"
vars init --file .env.staging --env staging

Key Management

Subcommands for managing your encryption key.


Multi-PIN

Owner-scoped PINs for team access control. See Multi-PIN for the full explanation.


Diagnostics