caarlos0/env
A simple, zero-dependencies library to parse environment variables into structs observed · 2026-08-28
Health v2 · maintenance only
87/100
- Activity 95
- Release rhythm 69
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: 67
- age_days: 4055
- days_rel: 124
- days_push: 30
- n_releases_24m: 4
Adoption not part of the score
6299 stars · 282 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-29, confidence not recorded
A simple, zero-dependency Go library that parses environment variables into struct fields using struct tags. It supports built-in types, pointers, slices, maps, defaults, required fields, file contents, and custom parsers.
Use cases
- parse environment variables into a Go config struct
- load app configuration from env vars with defaults
- require certain environment variables to be set
- read a secret from a file path given in an env var
- parse env vars into slices and maps
- expand environment variables inside env var values
When to choose
- you want a tiny, dependency-free config loader for a Go app or service
- you prefer struct-tag-driven configuration over manual parsing
- you need defaults, required validation, or file-based env values
When to avoid
- you need config files (YAML/TOML/JSON) rather than environment variables
- you want a full-featured config framework with hot reloading or remote sources
Facets
library · maturity stable
configuration-management developer-tools developer-tools backend go cross-platform environment-variables struct-tags zero-dependencies config-parsing generics automation
5 sources
- readme: https://github.com/caarlos0/env · fetched 2026-08-28 · 6b991ba770b9
- homepage: https://pkg.go.dev/github.com/caarlos0/env/v11 · fetched 2026-08-29 · 2a88ec24d97c
- site_page: https://pkg.go.dev/about · fetched 2026-08-29 · 757852027879
- site_page: https://go.dev/about · fetched 2026-08-29 · 8b6453863a90
- site_page: https://go.dev/project · fetched 2026-08-29 · d5ca00bb378b
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| caarlos0/env | main | 87 |
For agents
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem