2 unstable releases
Uses new Rust 2024
| new 0.1.0 | Feb 16, 2026 |
|---|---|
| 0.0.1 | Feb 15, 2026 |
#10 in #astrid
140KB
3.5K
SLoC
Unified configuration system for the Astrid runtime.
This crate provides a single Config type that consolidates all
configuration previously scattered across RuntimeConfig, SecurityPolicy,
BudgetConfig, ServersConfig, GatewayConfig, and HooksConfig.
Usage
use astrid_config::Config;
// Load with full precedence chain (defaults → system → user → workspace → env).
let resolved = Config::load(Some(std::path::Path::new("."))).unwrap();
let config = resolved.config;
println!("Using model: {}", config.model.model);
Configuration Precedence
From highest to lowest priority:
- Workspace (
{workspace}/.astrid/config.toml) — can only tighten security - User (
~/.astrid/config.toml) - System (
/etc/astrid/config.toml) - Environment variables (
ASTRID_*,ANTHROPIC_*) — fallback only - Embedded defaults (
defaults.tomlcompiled into binary)
Design
This crate has no dependencies on other internal astrid crates. It only
depends on serde, toml, thiserror, tracing, and directories.
Conversion from config types to domain types happens at the integration
boundary (CLI startup, gateway init) via bridge modules.
Dependencies
~6–19MB
~139K SLoC