dotenvy

A well-maintained, actively developed fork of the dotenv crate for loading .env files in Rust

Library
Cargo
v0.15.7
1,239stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
64/100Good
Development Activity64
Maintenance40
Community56
Maturity56
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
70/100Good
Architecture68
Code Quality70
Innovation65
Learning Curve78

dotenvy is a Rust library for loading environment variables from .env files, built as the actively maintained successor to the abandoned dotenv crate. It is the recommended replacement cited in security advisory RUSTSEC-2021-0141, and provides both a non-modifying API (returning an EnvMap without touching std::env) and a modifying API via the #[dotenvy::load] attribute macro for cases where the process environment itself must be populated before other code runs.

Beyond basic key-value loading, dotenvy supports multiline values, variable substitution, configurable load sequencing (file-then-env or env-then-file), reading from arbitrary io::Read sources, and a companion dotenvy_macro crate for compile-time .env inspection via a dotenv! macro. A small CLI binary is also included for loading an env file before executing another command.

What You Get

  • A non-modifying EnvLoader/EnvMap API that parses .env files without touching std::env
  • A modifying API via the #[dotenvy::load] attribute macro for populating the process environment before an async runtime starts
  • Support for multiline values and variable substitution within .env files
  • Configurable load sequencing (InputThenEnv / EnvThenInput) to control override precedence
  • Reader-based loading from any io::Read source, not just files
  • A dotenvy_macro crate providing a dotenv! compile-time macro for embedding values at build time
  • A small CLI binary that loads an env file before executing a specified command

Common Use Cases

  • Loading local development configuration (database URLs, API keys) from a .env file without committing secrets to source control
  • Supporting dev/prod configuration switching by loading different env files per environment
  • Populating environment variables for a spawned child process that reads from std::env
  • Compile-time embedding of configuration values via the dotenv! macro for values that never change at runtime

Under The Hood

Architecture - dotenvy is organized as a small Cargo workspace with a core dotenvy crate plus companion dotenvy-macros/dotenv_codegen crates and a thin CLI binary. The core crate splits parsing (parse.rs), iteration over key-value pairs (iter.rs), and error types (err.rs) from the public lib.rs surface, which exposes an EnvLoader builder that either returns a standalone EnvMap (non-modifying) or, via the #[dotenvy::load] attribute macro, writes directly into std::env before other code (including async runtimes) starts. Tech Stack - Pure Rust with minimal dependencies; the CLI binary and macro support are gated behind optional Cargo features (cli, macros) using clap for argument parsing, keeping the core library dependency-free for consumers who only need file parsing. Code Quality - The codebase is compact (~1,400 lines across four core source files) with #![deny(clippy::uninlined_format_args, clippy::wildcard_imports)] enforced at the crate root; unit tests exist in the parser and iterator modules but coverage is modest relative to the surface area, and error types are deliberately informative (carrying file path and variable name) rather than opaque. API Design - The library favors an ergonomic, builder-style EnvLoader with clear non-modifying vs. modifying entry points, sensible defaults (./​.env, non-overriding), and thorough README-level documentation of configuration options, making it easy to adopt with minimal boilerplate.

Used by 17 apps in this directory

Rust
95%
MIT

claw-code

AI Agents · AI Code Assistants

195,087

A Rust-built CLI agent harness for Claude AI with persistent sessions, MCP tool integration, plugin hooks, and multi-provider support — designed to run autonomous coding workflows without human babysitting.

View details
71
Repo Health
71
Technical
77
Dependency
Built with
Rust95%
Updated 3 days ago
Rust
52%
Apache 2.0

cocoindex

Data Engineering · AI Development

11,350

An incremental data indexing engine that keeps AI agent context perpetually fresh by reprocessing only what changed.

View details
87
Repo Health
85
Technical
64
Dependency
Built with
Rust52%
Python48%
Updated yesterday
Go
32%
Apache 2.0

CubeSandbox

Developer Tools · Security · AI Agents

11,247

Instant, concurrent, hardware-isolated MicroVM sandboxes for AI agents — E2B-API compatible, sub-60ms cold starts, and a built-in zero-trust egress proxy, all self-hostable at scale.

View details
83
Repo Health
88
Technical
63
Dependency
Built with
Go32%
Rust31%
C21%
Updated today
Rust
66%
Other

DefGuard

Security · Networking · Authentication

2,805

Self-hosted secure remote access that unifies WireGuard VPN, identity management, and connection-level MFA in one open-source platform.

View details
85
Repo Health
82
Technical
77
Dependency
Built with
Rust66%
TypeScript32%
Updated today
TypeScript
89%
Other

FastGPT

AI Agents · AI Development

29,387

Build, debug, and deploy knowledge-based AI agents with a visual workflow editor, RAG retrieval, and support for any OpenAI-compatible LLM.

View details
93
Repo Health
84
Technical
70
Dependency
Built with
TypeScript89%
Updated today
TypeScript
75%
Apache 2.0

Fern

Developer Tools

3,761

Fern turns a single OpenAPI, AsyncAPI, or Protobuf definition into type-safe SDKs for nine languages and a hosted API documentation site, all from one CLI and one source of truth.

View details
90
Repo Health
86
Technical
67
Dependency
Built with
TypeScript75%
Updated today
Rust
93%
Apache 2.0

helix-db

Databases

5,803

A graph-vector database built from scratch in Rust that unifies graph traversal, vector search, key-value, and relational storage into a single platform for AI applications.

View details
85
Repo Health
80
Technical
81
Dependency
Built with
Rust93%
Updated today
Rust
96%
Apache 2.0

InfluxDB

Databases · Analytics

31,705

Open-source time-series database built for real-time ingest, fast SQL queries, and embedded Python automation — powered by Apache Arrow and Parquet.

View details
86
Repo Health
76
Technical
72
Dependency
Built with
Rust96%
Updated yesterday
TypeScript
79%
LGPL 3.0

Latitude

AI Agents · Monitoring

4,593

Open-source AI agent monitoring that catches what will break next before your users do.

View details
86
Repo Health
88
Technical
67
Dependency
Built with
TypeScript79%
Python11%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search