Setup & Auth
Initialize a project, manage your encryption key, run health checks, and install the pre-commit hook.
init
vars initSets up a new vars project:
- Creates
config.vars, the encrypted secrets file (safe to commit) - Creates
.varskey, the master encryption key (gitignored) - Updates
.gitignoreto exclude key and swap files - Adds
#varsimport topackage.jsonscripts
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
| Flag | Short | Description |
|---|---|---|
--file <path> | -f | Path 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 stagingKey Management
Subcommands for managing your encryption key.
Multi-PIN
Owner-scoped PINs for team access control. See Multi-PIN for the full explanation.