config

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

Library
Cargo
v0.15.26
3,214 stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
78 /100 Good
Development Activity 96
Maintenance 52
Community 64
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
79 /100 Good
Architecture 84
Code Quality 85
Innovation 70
Learning Curve 75

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 7 apps in this directory

TypeScript
54%
MIT

Anarlog

AI Assistants · Note Taking · Productivity

9,404

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
68
Dependency
Built with
TypeScript 54%
Rust 34%
Updated 4 days ago
Go
32%
Apache 2.0

CubeSandbox

AI Agents · Developer Tools · Security

12,728

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
82
Repo Health
88
Technical
63
Dependency
Built with
Go 32%
Rust 26%
C 22%
Updated 1 weeks ago
TypeScript
61%
EPL-2.0

Huly Platform

Collaboration · Project Management · Team Chat

27,797

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
62
Dependency
Built with
TypeScript 61%
Svelte 34%
Updated 6 days ago
Rust
92%
Apache 2.0

Murr

Databases

111

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
76
Dependency
Built with
Rust 92%
Updated 2 weeks ago
Rust
90%
Apache 2.0

Qdrant

AI Development · Databases · Search

34,857

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
65
Dependency
Built with
Rust 90%
Updated 5 days ago
Rust
97%
MPL 2.0

Sonic

Databases · Search

21,353

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

View details
88
Repo Health
88
Technical
70
Dependency
Built with
Rust 97%
Updated 1 weeks ago
Rust
64%
Apache 2.0

Temps

Analytics · Devops · Monitoring

801

A self-hosted Rust PaaS that replaces Vercel, Sentry, PostHog, Pingdom, Resend, and E2B with one binary — plus 440+ CLI operations agents like Claude Code can drive directly.

View details
81
Repo Health
86
Technical
70
Dependency
Built with
Rust 64%
TypeScript 34%
Updated 4 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