envlint
Language-agnostic .env validation. One schema, any stack.
Validate your .env files in CI before your app even starts. Works with any language.
Why envlint?
Existing solutions like pydantic-settings (Python) or envalid (JavaScript) only work within their own language. You need to run your app to validate your config.
envlint is different:
- Language-agnostic: Define your schema once, validate from any CI pipeline
- Catches issues at build time: Before your app crashes in production
- No code changes: Just a YAML schema and a CLI command
- No SDK or runtime dependency: Your app doesn't need to know envlint exists
# Your app crashes in production because...
KeyError: 'DATABASE_URL'
# Or silently uses wrong values...
API_URL=htpp://api.example.com # typo in scheme
PORT=not_a_number # string where int expected
envlint catches these in CI, not production.
Installation
pip install envlint
Quick Start
1. Create a schema file (.env.schema):
DATABASE_URL:
type: url
required: true
API_KEY:
type: string
required: true
pattern: "^sk_[a-zA-Z0-9]{32}$"
PORT:
type: port
required: false
default: "3000"
DEBUG:
type: bool
required: false
2. Run envlint:
envlint check
3. See results:
┌─────────────────────────────────────────────────┐
│ envlint │
├─────────────────────────────────────────────────┤
│ ✓ All 4 variables validated successfully │
└─────────────────────────────────────────────────┘
Or if there are errors:
┌─────────────────────────────────────────────────┐
│ Errors │
├──────────────┬────────────────────┬─────────────┤
│ Variable │ Error │ Value │
├──────────────┼────────────────────┼─────────────┤
│ DATABASE_URL │ required variable │ - │
│ │ is missing │ │
│ API_KEY │ must match pattern │ invalid_key │
│ PORT │ must be a port │ abc │
│ │ number (0-65535) │ │
└──────────────┴────────────────────┴─────────────┘
Exit code is 1 on errors, 0 on success. Perfect for CI/CD.
Schema Format
Supported Types
| Type | Description | Example |
|---|---|---|
string |
Any string (default) | my-value |
int |
Integer | 42 |
float |
Decimal number | 3.14 |
bool |
Boolean (true/false, 1/0, yes/no) |
true |
url |
Valid URL with scheme | https://api.example.com |
email |
Email address | user@example.com |
port |
Port number (0-65535) | 8080 |
path |
File path | /var/log/app.log |
jwt |
JWT token (header.payload.signature) | eyJhbGciOiJIUzI1NiIs... |
secret |
Sensitive value (masked in output) | sk_live_abc123 |
Full Schema Options
MY_VARIABLE:
type: string # Type (see above)
required: true # Is this variable required?
default: "value" # Default value if missing
pattern: "^[A-Z]+$" # Regex pattern to match
description: "..." # Documentation
choices: # Allowed values
- option1
- option2
min: 0 # Minimum (for numeric types)
max: 100 # Maximum (for numeric types)
Shorthand Syntax
For simple variables, use shorthand:
# These are equivalent:
API_KEY: string
API_KEY:
type: string
required: true
# Just the name = required string
SECRET:
CLI Usage
# Basic validation
envlint check
# Specify files
envlint check --env .env.production --schema env.schema.yml
# Include system environment variables
envlint check --system
# Strict mode (fail on undefined variables)
envlint check --strict
# Verbose output (show warnings)
envlint check --verbose
# Quiet mode (only output on error)
envlint check --quiet
# Generate schema from existing .env
envlint init --from-env .env
# Create template schema
envlint init
CI/CD Integration
GitHub Actions
- name: Validate environment
run: |
pip install envlint
envlint check --env .env.example --schema .env.schema
Pre-commit Hook
# .pre-commit-config.yaml
repos:
- repo: local
hooks:
- id: envlint
name: envlint
entry: envlint check
language: system
pass_filenames: false
Docker Build
FROM python:3.11
RUN pip install envlint
COPY .env.schema .
COPY .env .
RUN envlint check
# ... rest of build
License
GPL v3
Contributing
Contributions welcome! Please read CONTRIBUTING.md first.
Metadata
Release files for envlint 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| envlint-0.3.0.tar.gz | 33.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| envlint-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 57.9 kB
Release files / envlint-0.3.0.tar.gz
| Download URL | envlint-0.3.0.tar.gz |
|---|---|
| Size | 33.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d4c98b96e41701677803aeb3bb9151e99b8a62451e378bb43fabe72eb1861b79
|
|
BLAKE2b-256 checksum How to use checksums |
a9f81dd826b38d8c11790398fa42560679b88bb4d33f09c2b9fc527c9cfca24f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 1, 2026.
Transparency logRelease files / envlint-0.3.0-py3-none-any.whl
| Download URL | envlint-0.3.0-py3-none-any.whl |
|---|---|
| Size | 24.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b60e82de0e6b0755ed417635c0672a2563da6198614a4ec3002e88d20e245be5
|
|
BLAKE2b-256 checksum How to use checksums |
5d17ec7d1e36a0b71c6d9d2c639c12aaa46181f0372690b3201f3d258ab6c016
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 1, 2026.
Transparency log