Skip to main content

Config

Struct Config 

Source
pub struct Config {
Show 25 fields pub settings_dir: PathBuf, pub soul_path: Option<PathBuf>, pub skills_dir: Option<PathBuf>, pub workspace_dir: Option<PathBuf>, pub credentials_dir: Option<PathBuf>, pub messengers: Vec<MessengerConfig>, pub use_secrets: bool, pub gateway_url: Option<String>, pub model: Option<ModelProvider>, pub secrets_password_protected: bool, pub totp_enabled: bool, pub agent_access: bool, pub agent_name: String, pub message_spacing: u16, pub tab_width: u16, pub sandbox: SandboxConfig, pub clawhub_url: Option<String>, pub clawhub_token: Option<String>, pub system_prompt: Option<String>, pub messenger_poll_interval_ms: Option<u32>, pub tool_permissions: HashMap<String, ToolPermission>, pub tls_cert: Option<PathBuf>, pub tls_key: Option<PathBuf>, pub memory_flush: MemoryFlushConfig, pub workspace_context: WorkspaceContextConfig,
}

Fields§

§settings_dir: PathBuf

Root state directory (e.g. ~/.rustyclaw). All other paths are derived from this unless explicitly overridden.

§soul_path: Option<PathBuf>

Path to SOUL.md file (default: <workspace_dir>/SOUL.md)

§skills_dir: Option<PathBuf>

Skills directory (default: <workspace_dir>/skills)

§workspace_dir: Option<PathBuf>

Agent workspace directory (default: <settings_dir>/workspace)

§credentials_dir: Option<PathBuf>

Credentials directory (default: <settings_dir>/credentials)

§messengers: Vec<MessengerConfig>

Messenger configurations

§use_secrets: bool

Whether to use secrets storage

§gateway_url: Option<String>

Gateway WebSocket URL for the TUI to connect to

§model: Option<ModelProvider>

Selected model provider and default model

§secrets_password_protected: bool

Whether the secrets vault is encrypted with a user password (as opposed to an auto-generated key file).

§totp_enabled: bool

Whether TOTP two-factor authentication is enabled for the vault.

§agent_access: bool

Whether the agent is allowed to access secrets on behalf of the user.

§agent_name: String

User-chosen name for this agent instance (shown in TUI title, authenticator app labels, etc.). Defaults to “RustyClaw”.

§message_spacing: u16

Number of blank lines inserted between messages in the TUI. Set to 0 for compact output, 1 (default) for comfortable spacing.

§tab_width: u16

Number of spaces a tab character occupies in the TUI. Defaults to 5.

§sandbox: SandboxConfig

Sandbox configuration for agent isolation.

§clawhub_url: Option<String>

ClawHub registry URL (default: https://registry.clawhub.dev/api/v1).

§clawhub_token: Option<String>

ClawHub API token for publishing / authenticated downloads.

§system_prompt: Option<String>

System prompt for the agent (used for messenger conversations).

§messenger_poll_interval_ms: Option<u32>

Messenger polling interval in milliseconds (default: 2000).

§tool_permissions: HashMap<String, ToolPermission>

Per-tool permission overrides. Tools not listed here default to Allow.

§tls_cert: Option<PathBuf>

Path to TLS certificate file (PEM) for WSS gateway connections.

§tls_key: Option<PathBuf>

Path to TLS private key file (PEM) for WSS gateway connections.

§memory_flush: MemoryFlushConfig

Pre-compaction memory flush configuration.

§workspace_context: WorkspaceContextConfig

Workspace context injection configuration.

Implementations§

Source§

impl Config

Source

pub fn workspace_dir(&self) -> PathBuf

Agent workspace directory — holds SOUL.md, skills/, etc. Default: <settings_dir>/workspace

Source

pub fn credentials_dir(&self) -> PathBuf

Credentials directory — holds secrets vault, key file, OAuth tokens. Default: <settings_dir>/credentials

Source

pub fn agent_dir(&self) -> PathBuf

Default agent directory — per-agent state (sessions, etc.). Default: <settings_dir>/agents/main

Source

pub fn sessions_dir(&self) -> PathBuf

Sessions directory for the default agent.

Source

pub fn soul_path(&self) -> PathBuf

Path to SOUL.md — inside the workspace.

Source

pub fn skills_dir(&self) -> PathBuf

Skills directory — inside the workspace.

Source

pub fn skills_dirs(&self) -> Vec<PathBuf>

Returns all skills directories in priority order (lowest to highest). Order: bundled OpenClaw → user OpenClaw → user RustyClaw

Source

pub fn logs_dir(&self) -> PathBuf

Logs directory.

Source

pub fn ensure_dirs(&self) -> Result<()>

Ensure the entire directory skeleton exists on disk.

Source

pub fn load(path: Option<PathBuf>) -> Result<Self>

Load configuration from file, with OpenClaw compatibility

Source

pub fn save(&self, path: Option<PathBuf>) -> Result<()>

Save configuration to file

Trait Implementations§

Source§

impl Clone for Config

Source§

fn clone(&self) -> Config

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Config

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Config

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Config

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Config

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,