<p align="center">
<img src="https://raw.githubusercontent.com/lupodevelop/envie/9054a0d/assets/img/logo.png" alt="envie logo" width="200" />
</p>
[](https://hex.pm/packages/envie)[](https://hexdocs.pm/envie/)[](https://gleam.run)[](https://opensource.org/licenses/MIT)
# envie
Type-safe environment configuration for Gleam.
Cross-platform, zero runtime dependencies.
> Why the name? `envy` was taken on Hex, so `envie` it is. French for *desire*. You shouldn't be jealous of other languages' config loaders, just *desire* a better one. 🥐
## Install
```sh
gleam add envie
```
```gleam
import envie
pub fn main() {
let port = envie.get_int("PORT", 3000)
let debug = envie.get_bool("DEBUG", False)
}
```
## Features
- read/write env vars with no ceremony
- type-safe getters with defaults (`get_int`, `get_bool`, ...)
- strict `require_*` validators (port, url, range, allow-list, ...)
- composable decoders for custom rules
- `.env` file loading with overrides and multi-file priority
- structured `schema` for full app configuration
- `inspect` traces for debugging which values were used
- `testing` helpers that restore env after each test
- works on Erlang, Node.js, Bun, Deno; safe no-op in browsers
## Documentation
- [Quick start](docs/quickstart.md): install, core API, type-safe getters
- [Validated access](docs/validation.md): `require_*`, custom decoders, errors
- [`.env` files](docs/dotenv.md): single file, multiple environments
- [Schema](docs/schema.md): structured config and `inspect` traces
- [Testing utilities](docs/testing.md): `with_env`, `isolated`
- [API reference](docs/api-reference.md): full function table, platforms, requirements
## Requirements
Gleam **1.14**+, OTP 27+ on BEAM. Only `gleam_stdlib`.
---
<p align="center">Made with Gleam 💜</p>