pub struct Config {Show 21 fields
pub model: Option<String>,
pub thinking: Option<ThinkingLevel>,
pub max_tokens: Option<u32>,
pub max_turns: Option<u32>,
pub tools: Option<Vec<String>>,
pub roles: HashMap<String, RoleDef>,
pub hooks: Vec<HookDef>,
pub context: ContextConfig,
pub shell: ShellConfig,
pub write: WriteConfig,
pub guardrails: GuardrailConfig,
pub mode: AgentMode,
pub enabled_models: Option<Vec<String>>,
pub theme: Option<String>,
pub learning: LearningConfig,
pub ui: UiConfig,
pub web: WebConfig,
pub mana: ManaConfig,
pub lua: LuaConfig,
pub secrets: SecretsConfig,
pub personality: PersonalityConfig,
}Expand description
Top-level configuration.
Fields§
§model: Option<String>Default model (alias or full ID).
thinking: Option<ThinkingLevel>Default thinking level.
max_tokens: Option<u32>Default max output tokens per response.
max_turns: Option<u32>Maximum agent turns.
tools: Option<Vec<String>>Active tool names (None = all).
roles: HashMap<String, RoleDef>Named roles.
hooks: Vec<HookDef>Hook definitions.
context: ContextConfigContext management settings.
shell: ShellConfigShell backend settings.
write: WriteConfigWrite tool settings.
guardrails: GuardrailConfigEngineering guardrails — profile-aware guidance and post-write checks.
mode: AgentModeAgent mode — controls tool and mana action access.
enabled_models: Option<Vec<String>>Enabled models for the model selector (None = show all). Entries can be canonical IDs or aliases (e.g. “sonnet”, “claude-sonnet-4-6”).
theme: Option<String>Theme name (“default”, “light”, or custom).
learning: LearningConfigLearning loop settings (memory, skill nudges).
ui: UiConfigUI display settings.
web: WebConfigWeb tool settings.
mana: ManaConfigMana tool settings.
lua: LuaConfigShipped Lua extension runtime policy.
secrets: SecretsConfigSecret injection policy for native command execution.
personality: PersonalityConfigPersonality settings, including identity sentence and saved profiles.
Implementations§
Source§impl Config
impl Config
Sourcepub fn resolve(
user_config_dir: &Path,
project_dir: Option<&Path>,
) -> Result<Self>
pub fn resolve( user_config_dir: &Path, project_dir: Option<&Path>, ) -> Result<Self>
Resolve the full config by merging: defaults < user < project < env < CLI.
Sourcepub fn user_config_dir() -> PathBuf
pub fn user_config_dir() -> PathBuf
Default user config directory.
Sourcepub fn session_dir() -> PathBuf
pub fn session_dir() -> PathBuf
Default session directory.
Sourcepub fn save(&self, path: &Path) -> Result<()>
pub fn save(&self, path: &Path) -> Result<()>
Save config to a TOML file. Creates parent directories if needed.
Sourcepub fn user_config_path() -> PathBuf
pub fn user_config_path() -> PathBuf
Path to the user config.toml file.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more