https://github.com/arisrhiannon/envlint
Zero-dependency CLI that validates .env files against .env.example — catches missing keys, duplicates, empty values and unsafe .gitignore. Built for CI.
https://github.com/arisrhiannon/envlint
bun ci cli developer-tools dotenv environment-variables linter typescript
Last synced: 18 days ago
JSON representation
Zero-dependency CLI that validates .env files against .env.example — catches missing keys, duplicates, empty values and unsafe .gitignore. Built for CI.
- Host: GitHub
- URL: https://github.com/arisrhiannon/envlint
- Owner: ArisRhiannon
- License: other
- Created: 2026-05-30T20:56:36.000Z (18 days ago)
- Default Branch: main
- Last Pushed: 2026-05-31T01:54:17.000Z (18 days ago)
- Last Synced: 2026-05-31T03:18:10.470Z (18 days ago)
- Topics: bun, ci, cli, developer-tools, dotenv, environment-variables, linter, typescript
- Language: TypeScript
- Homepage: https://github.com/ArisRhiannon/envlint
- Size: 21.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# envlint
> Zero-dependency CLI that validates your `.env` against `.env.example` — catch missing keys, duplicates, empty values and an unsafe `.gitignore` **before** they break a deploy.
[](https://github.com/ArisRhiannon/envlint/actions/workflows/ci.yml)
[](LICENSE)
Misconfigured environment variables are one of the most common causes of "works on my machine" bugs and broken production deploys. `envlint` is a tiny, fast checker that drops into local workflows and CI.
- **No dependencies.** A single self-contained binary, or run directly with [Bun](https://bun.sh).
- **CI-friendly.** Clear exit codes and `--json` output.
- **Safe by default.** Warns when `.env` isn't ignored by Git.
## Install
```sh
curl -fsSL https://raw.githubusercontent.com/ArisRhiannon/envlint/main/install.sh | sh
```
Or build from source:
```sh
git clone https://github.com/ArisRhiannon/envlint
cd envlint
bun run build # produces ./envlint
```
## Usage
```sh
envlint # check ./.env against ./.env.example
envlint .env.production # check a specific file
envlint --example .env.sample
envlint --strict # empty values become errors
envlint --json # machine-readable output
```
### Example output
```text
$ envlint
✖ missing-key: Missing key "DATABASE_URL" defined in example
⚠ extra-key: Extra key "DEBUG" not in example (.env:7)
⚠ empty-value: Empty value for "API_URL" (.env:4)
1 error(s), 2 warning(s)
```
## Rules
| Rule | Severity | Description |
|------|----------|-------------|
| `missing-key` | error | A key in the example file is absent from `.env` |
| `duplicate-key` | error | The same key is defined more than once |
| `gitignore-unsafe` | error | `.env` is not ignored by `.gitignore` |
| `extra-key` | warning | A key in `.env` is not present in the example file |
| `empty-value` | warning | A key has an empty value (becomes an error with `--strict`) |
## Use in CI
```yaml
# .github/workflows/env.yml
name: env
on: [pull_request]
jobs:
envlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- run: curl -fsSL https://raw.githubusercontent.com/ArisRhiannon/envlint/main/install.sh | sh
- run: ~/.local/bin/envlint --strict
```
## Exit codes
| Code | Meaning |
|------|---------|
| `0` | No errors |
| `1` | Errors found |
| `2` | Usage error |
## Development
```sh
bun test # run the test suite
bun run build # compile a single binary
```
## Contributing
Issues and pull requests are welcome. Please run `bun test` before submitting.
## Support
No pressure — a star or a helpful issue means a lot. If `envlint` happened to save you
some time, an optional tip is welcome at `0x4705fA2de020E2D7F7FE08f5dD4585710897f3E1`
(ETH / any EVM chain).
## License
Source-available — **not** OSI open source. Free under the GNU **AGPL-3.0** for
individuals, non-profits, and organizations below **US$1M annual revenue and 50
employees**; larger organizations require a commercial license. See [LICENSE](LICENSE).
© 2026 Aris Rhiannon