Configuration File

Typenv delivers the .envx standard — a typed, validated, and expressive replacement for legacy .env files.

Configuration File · envx.config.json

Typenv supports a project-level configuration file named envx.config.json.
This file helps you centralize CLI options such as input/output paths and overwrite behavior.

Example

{
  "input": "./.envx",
  "outputs": {
    "env": "./.env",
    "types": "./types/envx.ts",
    "metaFilePath": "."
  },
  "overwrite": true
}

Fields

KeyTypeDescription
inputstringPath to your .envx file
outputs.envstringOutput path for the generated .env file
outputs.typesstringOutput path for generated TypeScript definitions
outputs.metaFilePathstringDirectory to write envx.meta.json file
overwritebooleanWhether to overwrite existing output files (default: false)

CLI arguments will always take precedence over values in the config file.

When to use it?

The config file is ideal when:

  • You use Typenv across multiple scripts
  • You want consistent paths across environments
  • You integrate Typenv in CI/CD or editor tooling

Keep it at your project root and version it with Git for team consistency.