# dotenv (Dart)

> Load environment variables at runtime from a .env file in Dart

Source: https://talira.ai/catalog/dotenv-dart-7gcpndze
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library, Command-line tool
- Categories: [libraries / configuration](https://talira.ai/categories/libraries/configuration), [languages / dart](https://talira.ai/categories/languages/dart)
- Licence: MIT[^2]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [mockturtl](https://talira.ai/orgs/mockturtl.md)

dotenv loads environment variables at runtime from a `.env` file in Dart, so a development or test environment can mimic production's configuration, the twelve-factor way. It parses the file and can merge its values with `Platform.environment`. A command-line tool, run with `dart pub global run dotenv`, creates a `.env` file and adds it to `.gitignore`, or prints the file's variables or the whole environment.

## Links

- GitHub: https://github.com/mockturtl/dotenv

## Problems it solves

- load config from a .env file in my Dart server or CLI
- keep secrets out of my Dart code in development
- merge .env values with the real environment in Dart

## Features

- parses a .env file at runtime
- optionally merges its values with Platform.environment
- CLI to create a .env file and add it to .gitignore
- CLI to print the file's variables or the whole environment

## Trust

Overall: 0.19 out of 1.
Signals: maintenance 0.06, adoption 0.41, momentum 0.08, community 0.34, backing 0.30, extensibility 0.00.

- latest release v1.0.0 8.4 years ago
- 116 GitHub stars
- 6 contributors
- backed by mockturtl

Warnings:

- last commit 3.1 years ago

## Forks

- [flutter_dotenv](https://talira.ai/catalog/flutter-dotenv-kd30crdp.md): Load configuration into a Flutter app from a .env file. Its own project.

## Alternatives

- [flutter_dotenv](https://talira.ai/catalog/flutter-dotenv-kd30crdp.md): Load configuration into a Flutter app from a .env file

## Sources

[^1]: https://github.com/mockturtl/dotenv/blob/master/README.md (checked 28 Nov 2026)
[^2]: https://github.com/mockturtl/dotenv/blob/master/LICENSE (checked 28 Nov 2026)
