Expand description
Configuration management for Gestura.
Core config types (struct definitions, pure helpers) are defined in the
gestura-core-config domain crate and re-exported here. This module
extends them with security-dependent methods via the
AppConfigSecurityExt extension trait, JSON→YAML migration, and
keychain integration.
§Backward compatibility
Older versions stored configuration as JSON in ~/.gestura/config.json.
On load, if config.yaml does not exist but config.json does, we
automatically migrate the JSON file to YAML.
§File location and layering
Gestura’s user configuration is centered on ~/.gestura/config.yaml.
Pure types and validation live in gestura-core-config, while this facade
adds the runtime wiring needed to make configuration work in the full app.
This includes:
- file-system loading and saving helpers
- JSON-to-YAML migration glue for older installs
- security-aware secret hydration from keychain/secure storage
- canonical-key and legacy-key fallback logic for stored secrets
- user-friendly recovery behavior for fresh installs and reinstalls
§Configuration Precedence
Configuration values are loaded with the following precedence (highest first):
- Environment variables (GESTURA_* prefix)
- Config file (
~/.gestura/config.yaml) - Default values
See crate::config_env for environment variable documentation.
§Secret handling
Secrets should preferentially live in secure storage rather than plaintext config files. This module provides the security-aware bridge that can:
- read from keychain-backed secure storage when available
- fall back to legacy key names during migration
- self-heal secrets into canonical storage keys when possible
- populate the public
AppConfigmodel with hydrated runtime values
Keeping this logic here rather than in gestura-core-config preserves a
clean separation between pure config modeling and OS-integrated secret
management.
Modules§
- config_
env - Environment Variable Configuration Support
- hooks_
types - Hook configuration types used in
crate::types::AppConfig. - types
- Configuration types and pure
AppConfigmethods. - validation
- Configuration validation and health checking
- watcher
- Configuration file watcher for runtime configuration reloading
Structs§
- Agent
Telemetry Settings - Settings for request-level agent-loop telemetry.
- Agent
Telemetry Trace Export Settings - OTLP trace export settings for request-level agent telemetry.
- Anthropic
Config - AppConfig
- Application configuration persisted to a YAML file.
- Config
Error - Configuration error
- Config
Health Check - Configuration health check result
- Config
Validation Result - Configuration validation result
- Config
Warning - Configuration warning
- Config
Watcher - Configuration file watcher
- Developer
Settings - Developer and simulator settings
- Gemini
Config - Global
Permission Settings - Global permission settings for tool execution.
- Grok
Config - Hook
Command Template - A command template for a hook.
- Hook
Definition - A single hook definition.
- Hooks
Settings - Global hooks settings.
- HotReloadable
Settings - Settings that can be hot-reloaded without restart
- LlmSettings
- LLM settings grouping provider-specific configs
- McpJson
File - Represents an
.mcp.jsonconfiguration file. - McpServer
Entry - Full MCP server entry compatible with
.mcp.json. - McpTool
- MCP tool entry (basic) — DEPRECATED: use
McpServerEntryinstead. - Notification
Settings - Notification settings for response completion and MCP feedback
- Notification
Settings Patch - Partial update payload for notification settings.
- Ollama
Config - Open
AiConfig - Pipeline
Settings - Pipeline and context management settings.
- Privacy
Settings - Privacy and data-handling preferences for the local app experience.
- Project
Guardrails Settings - Settings for project-level guardrails discovery and prompt injection.
- Prompt
Enhancement Settings - Prompt enhancement settings for LLM-powered prompt improvement
- Prompt
Enhancement Settings Patch - Partial update payload for prompt-enhancement settings.
- Reflection
Settings - Settings for ERL-inspired experiential reflection.
- Simulator
Settings - Simulator-specific configuration
- UiSettings
- UI preferences including theme mode and accent color.
- Voice
Settings - Voice settings; default uses local Whisper
- WebSearch
Config - Web search configuration.
- Whisper
Model Info - Information about available Whisper models
Enums§
- Agent
Telemetry Trace Export Protocol - OTLP trace export settings for request-level agent telemetry.
- ApiKey
Validation - API key validation result
- AppError
- Top-level application error for Gestura.
- Config
Change Event - Events emitted when configuration changes
- Global
Permission Level - Global permission level for new sessions.
- Hook
Event - A hook event.
- McpScope
- Configuration scope for MCP servers.
- McpTransport
Type - Transport type for MCP server connections.
- WebSearch
Provider - Web search provider selection.
Constants§
- ENV_
MAPPINGS - Environment variable mappings for AppConfig fields
- ENV_
PREFIX - Environment variable prefix for all Gestura configuration
Traits§
- AppConfig
Security Ext - Extension trait adding security-dependent methods to
AppConfig.
Functions§
- get_env
- Get an environment variable with the GESTURA_ prefix
- get_
env_ bool - Get an environment variable as a boolean
- get_
env_ u32 - Get an environment variable as a u32
- get_
env_ u64 - Get an environment variable as a u64
- get_
env_ usize - Get an environment variable as a usize
- get_
set_ env_ vars - Get all environment variables that are set
- import_
claude_ desktop_ servers - Import MCP servers from Claude Desktop config.
- infer_
transport_ from_ endpoint - Infer the MCP transport type from an endpoint URL.
- is_
secret_ key - Check if a key is a secret (should be redacted in logs)
- print_
env_ docs - Print documentation for all environment variables
- redact_
secret - Redact a secret value for logging
- validate_
anthropic_ key - Validate an Anthropic API key
- validate_
api_ key - Validate any API key by provider name
- validate_
config - Validate an AppConfig
- validate_
grok_ key - Validate a Grok API key
- validate_
openai_ key - Validate an OpenAI API key