Environment Variables
Quick start
Section titled “Quick start”tinkerise add envWhat it detects
Section titled “What it detects”The env module checks for existing env-related files:
.env.env.examplesrc/env.tsorsrc/env.jsenv.tsorenv.js
If any are found, the enhancement is considered installed.
What it installs
Section titled “What it installs”env installs two packages:
@t3-oss/env-corezod
Then it generates:
- Env validation module at
src/env.ts(orenv.tsifsrc/does not exist) .env.example.env(initialized from the same template)
It also ensures .env is added to .gitignore.
Generated env module behavior
Section titled “Generated env module behavior”The generated module uses createEnv() and validates:
DATABASE_URLas an optional URL stringNODE_ENVasdevelopment | production | testwith defaultdevelopment
It enables emptyStringAsUndefined for cleaner optional handling.
File and config changes
Section titled “File and config changes”- Creates or updates env module source file
- Creates
.env.exampleand.env - Appends
.envto.gitignorewhen missing - Adds env validation dependencies
Conflict handling
Section titled “Conflict handling”If env files already exist, detection reports the enhancement as installed. For write conflicts during enhancement runs, tinkerise shows a diff and lets you accept or skip changes.