What is Typenv?

Learn what Typenv and the .envx format bring to environment configuration.

What is Typenv?

Typenv is a modern specification for environment configuration, built to replace legacy .env files.
It introduces a new file format—.envx—designed to bring clarity, type safety, and early validation to your environment variables.

Just like TypeScript improves JavaScript with types,
Typenv improves .env with structure, validation, and tooling.


Why Typenv?

Traditional .env files are:

  • ❌ untyped (everything is a string)
  • ❌ prone to silent errors and typos
  • ❌ lack documentation or validation
  • ❌ hard to manage in larger teams or CI pipelines

Typenv solves this by making env files:

  • Typedstring,number, boolean, enum,email, url, etc.
  • Self-validating — schema-based rules catch misconfigurations early
  • Composable — supports variables, interpolation, and ternary conditions
  • Documented — you can describe each variable in-place

Introducing .envx

Typenv uses the .envx file extension to define structured, type-safe variables.

PORT = 3000
DEV_MODE = ${NODE_ENV} == "development" ? true : false

[PORT]
type = "number"
required = true
description = "Port the server listens on"

It still feels like .env — but with superpowers.


Not a Tool, a Format

Typenv is not a library or a CLI — it's a format.

  • Just like .env is a convention adopted by tools like dotenv,
  • .envx is a specification that tools can follow and implement.

You can use any CLI, loader, or framework that understands the .envx format.


Why .envx?

The x stands for:

  • extended syntax
  • explicit types
  • expressive validation
  • and extra safety

Summary

Typenv is to .env what TypeScript is to JavaScript: a smarter, safer, and more scalable way to manage configuration.

No runtime surprises. No hidden bugs. Just clean, typed, and validated environment files built for modern development.


Want to try it out? Just rename your .env file to .envx and start adding types.