config

Layered configuration system for Rust applications with strong 12-factor support

Library
Cargo
v0.15.25
3,202stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
71/100Good
Development Activity80
Maintenance40
Community64
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
79/100Good
Architecture84
Code Quality85
Innovation70
Learning Curve75

config is a Rust crate for building layered application configuration: set defaults, load values from JSON, TOML, YAML, INI, RON, JSON5, or Corn files, override with environment variables, and finally apply explicit programmatic overrides — all merged into one queryable, loosely-typed configuration object. It’s designed around the 12-factor app pattern of layering config sources by precedence rather than committing to a single format.

Values can be read as any reasonably convertible type and accessed via a JSONPath-like dotted/subscript syntax (redis.port, databases[0].name), and the crate’s Format trait lets applications add support for custom or proprietary config formats without forking the library. It is a read-only configuration loader — it does not write changed values back to source files.

What You Get

  • A ConfigBuilder for composing layered sources: defaults, files, environment variables, and explicit set() overrides, applied in a defined precedence order
  • File format support behind feature flags: json, toml, yaml, ini, ron, json5, and corn
  • Environment-variable source binding with configurable prefix/separator for 12-factor-style config
  • JSONPath-subset value access supporting nested (redis.port) and indexed (databases[0].name) paths
  • A Format trait extension point for adding custom or proprietary configuration formats
  • serde-based deserialization into strongly-typed structs via config.try_deserialize::<T>()

Common Use Cases

  • Loading a service’s configuration from a base file, an environment-specific override file, and environment variables in one merged view
  • Building 12-factor-compliant applications where configuration precedence follows file defaults overridden by environment variables
  • Deserializing merged configuration directly into a strongly-typed application settings struct via serde
  • Adding a proprietary or uncommon configuration format to an existing app via the Format trait without switching config libraries

Under The Hood

Architecture - The crate is organized as a Cargo workspace with a layered-source model: builder.rs implements ConfigBuilder, which accumulates Source implementations (see source.rs) in precedence order; src/file/ handles file-based sources with per-format parsers dispatched through the Format trait in format.rs; src/env.rs implements the environment-variable source; src/path/ implements the JSONPath-subset traversal used for dotted/indexed value access; and config.rs ties builder output into the final queryable Config object, with de.rs/ser.rs providing serde (de)serialization and value.rs/map.rs the internal loosely-typed value representation.

Tech Stack - Built on serde for typed (de)serialization plus per-format parser crates gated behind feature flags (toml, serde_yaml-family, rust-ini, ron, json5, a Corn parser), so applications only compile in the parsers they actually use. The workspace targets Rust 2024 edition with MSRV 1.85.0, and enforces an extensive set of rust_2018_idioms and clippy lints workspace-wide, plus deny.toml/committed.toml/_typos.toml for dependency auditing, commit message linting, and typo checking in CI.

Code Quality - Testing is substantial: a tests/testsuite integration suite alongside numerous runnable examples/ (simple usage, async sources, custom string/file formats, priority layering, file watching), all exercised in CI. The project has 94 contributors, ~1,314 commits, and averages 8 commits/month, indicating active, ongoing maintenance rather than a stalled utility crate.

API Design - The primary flow — Config::builder().add_source(...).build() then .get::<T>("path") or .try_deserialize::<T>() — reads as a fluent builder pattern familiar to Rust developers, and the JSONPath-subset access syntax avoids requiring callers to define intermediate structs just to read one nested value. The examples/ directory doubles as executable documentation for less common flows like async sources and custom formats, lowering the cost of adopting advanced features.

Used by 6 apps in this directory

TypeScript
51%
MIT

Anarlog

Note Taking · AI Assistants · Productivity

9,087

Anarlog is an open-source, local-first AI meeting notetaker that records, transcribes, and summarizes meetings entirely on your device — no cloud lock-in, no mandatory account, and every note saved as a plain markdown file you own forever.

View details
86
Repo Health
77
Technical
69
Dependency
Built with
TypeScript51%
Rust38%
Updated today
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
TypeScript
61%
EPL-2.0

Huly Platform

Project Management · Team Chat · Collaboration

27,384

Open-source all-in-one workspace that replaces Linear, Jira, Slack, and Notion for product and engineering teams.

View details
90
Repo Health
86
Technical
64
Dependency
Built with
TypeScript61%
Svelte34%
Updated 1 weeks ago
Rust
91%
Apache 2.0

Murr

Databases

107

A RocksDB-based NVMe/S3 cache purpose-built for AI inference workloads — a faster Redis replacement optimized for batch, low-latency, zero-copy reads and writes between data pipelines and inference apps.

View details
63
Repo Health
72
Technical
75
Dependency
Built with
Rust91%
Updated 1 months ago
Rust
89%
Apache 2.0

Qdrant

Databases · AI Development · Search

34,058

Open-source vector database and search engine built in Rust for production-grade AI applications — from semantic search to RAG pipelines and recommendation systems.

View details
92
Repo Health
87
Technical
69
Dependency
Built with
Rust89%
Updated yesterday
Rust
97%
MPL 2.0

Sonic

Databases · Search

21,315

Fast, lightweight, schema-less search backend in Rust — microsecond queries, 30MB RAM, no document storage required.

View details
88
Repo Health
88
Technical
73
Dependency
Built with
Rust97%
Updated 3 days ago

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