enact-config
Unified configuration management for Enact with secure storage, multi-agent support, and YAML-based configuration.
Features
- ENACT_HOME: Centralized data directory (
~/.enactby default) - YAML Configuration: Human-readable, editable config files
- Multi-Agent Support: Define multiple agents with different capabilities
- Project Workspaces: Scoped configuration and memory per project
- Hierarchical Config: Global → Agent → Project → Environment variables
- Environment Variables: Read secrets from
ENACT_*environment variables - Encrypted Storage: AES-256-GCM encrypted secrets
- Agent/Project Registry: Programmatic access to agents and projects
ENACT_HOME Structure
~/.enact/
├── config.yaml # Global configuration
├── config.encrypted # Encrypted secrets
├── agents/ # Agent definitions
│ ├── assistant/
│ │ ├── agent.yaml
│ │ └── sessions/
│ └── coder/
│ ├── agent.yaml
│ └── sessions/
└── projects/ # Project workspaces
├── my-webapp/
│ ├── project.yaml
│ └── sessions/
└── docs/
├── project.yaml
└── sessions/
Quick Start
ENACT_HOME
use ;
// Get ENACT_HOME (defaults to ~/.enact, override with ENACT_HOME env var)
let home = enact_home;
// Ensure directory structure exists
ensure_home_dirs?;
Global Configuration
use Config;
// Load from ENACT_HOME/config.yaml
let config = load_from_home?;
// Modify and save
let mut config = default;
config.runtime.max_concurrent_executions = 20;
config.save_to_home?;
Agent Registry
use ;
// List all agents
let agents = list?;
// Load specific agent
let agent = get?;
// Create new agent
let agent = AgentDef ;
agent.save?;
Project Registry
use ;
// List all projects
let projects = list?;
// Load specific project
let project = get?;
// Load task board
let board = load?;
// Create project
let project = ProjectDef ;
project.save?;
ConfigManager (Legacy Encrypted Config)
use ;
let config_path = default_config_path?;
let manager = new.await?;
// Load configuration
let config = manager.load.await?;
// Set a secret (stored in encrypted file)
manager.set_secret.await?;
// Save configuration
manager.save.await?;
Modules
home — ENACT_HOME Management
use ;
/// Returns the Enact home directory.
/// Priority: 1. ENACT_HOME env var, 2. $HOME/.enact, 3. ./.enact
;
/// Ensures the standard ENACT_HOME directory structure exists.
/// Creates: agents/, projects/, state/, logs/
;
config — Global Configuration
YAML-based configuration with serde support.
use Config;
// Load/save from ENACT_HOME
agent_def — Agent Definitions
Agent registry and agent.yaml management.
use ;
/// Per-agent definition (agents/<name>/agent.yaml)
/// Registry for discovering agents
;
project_def — Project Definitions
Project registry, task boards, and project.yaml management.
use ;
/// Per-project definition (projects/<slug>/project.yaml)
/// Task board (projects/<slug>/taskboard.yaml)
/// Single task on the board
/// Registry for discovering projects
;
encrypted_store — Encrypted Configuration
Legacy encrypted configuration storage.
use ;
let store = new?;
store.save?;
let config = store.load?;
doctor — Configuration Health Check
Validates ENACT_HOME: directory structure, YAML validity of config.yaml and agent/project definitions, taskboards, provider API keys, encrypted secrets, and daemon state. Used by enact doctor, gateway startup (enact serve), and the pre-commit hook.
use ;
let home = enact_home;
let report = run_checks;
if report.has_failures
Configuration Resolution
Configuration is resolved in this order (later overrides earlier):
- Environment variables (highest priority)
- Project configuration (
projects/<slug>/project.yaml) - Agent configuration (
agents/<name>/agent.yaml) - Global configuration (
config.yaml)
Environment Variable Mapping
Keys are converted to environment variables by:
- Converting to uppercase
- Replacing dots with underscores
- Prefixing with
ENACT_
| Key | Environment Variable |
|---|---|
providers.openai.api_key |
ENACT_PROVIDERS_OPENAI_API_KEY |
memory.retention_days |
ENACT_MEMORY_RETENTION_DAYS |
approval.enabled |
ENACT_APPROVAL_ENABLED |
Air-Gapped Mode
When runtime.mode === "airgapped":
- Cloud sync is disabled
- Network access is blocked
- Only local features are available
Examples
Creating an Agent
use ;
let agent = AgentDef ;
agent.save?;
Creating a Project
use ;
let project = ProjectDef ;
project.save?;
// Create empty task board
let board = default;
board.save?;
Loading Configuration
use ;
// Load global config
let config = load_from_home?;
// Load agent
let agent = get?
.expect;
// Load project
let project = get?
.expect;
License
MIT