bare-config
The type-safe configuration authority for Rust.
A pluggable framework that evolves beyond static loading to provide full CRUD operations across multiple backends, enforcing "Parse, don't validate" for the entire configuration lifecycle.
Overview
bare-config is not just another configuration loader. It is a Configuration Authority that:
- Validates at boundaries - Configuration is parsed and validated once at system entry points
- Enforces type safety - Strongly typed configuration values prevent invalid states
- Supports full CRUD - Read, create, update, and delete operations across multiple backends
- Pluggable backends - File system, environment variables, remote services, and custom backends
- Zero runtime overhead - After validation, configuration access is cost-free
Philosophy
Parse, Don't Validate
Traditional configuration libraries mix parsing and validation throughout the codebase. bare-config separates these concerns:
- Parse - Convert raw configuration data (TOML, YAML, JSON, etc.) into typed values
- Validate - Ensure values meet constraints at system boundaries
- Trust - Use validated values without re-checking within the system
This eliminates primitive obsession and ensures data integrity where it matters most.
Quick Start
use ;
Features
- Type-safe configuration - Strongly typed values with compile-time guarantees
- Multiple backends - File system, environment variables, and extensible backend system
- CRUD operations - Full lifecycle management of configuration values
- Hot reloading - Optional runtime configuration updates
- Validation - Schema-based validation with detailed error messages
- Zero dependencies - Core functionality has no external dependencies
Roadmap
- Core configuration framework
- File system backends (TOML, YAML, JSON, INI)
- Environment variable backend
- Validation schema system
- CRUD operations
- Hot reloading
- Remote configuration backends
- Configuration migration tools
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT License (LICENSE-MIT)
Contributing
Contributions are welcome! Please open an issue or submit a PR.
Related Crates
- bare-types - Zero-cost foundation for type-safe domain modeling