pub struct Config {Show 38 fields
pub theme: Option<String>,
pub hide_thinking_block: Option<bool>,
pub show_hardware_cursor: Option<bool>,
pub default_provider: Option<String>,
pub default_model: Option<String>,
pub default_thinking_level: Option<String>,
pub enabled_models: Option<Vec<String>>,
pub steering_mode: Option<String>,
pub follow_up_mode: Option<String>,
pub check_for_updates: Option<bool>,
pub quiet_startup: Option<bool>,
pub collapse_changelog: Option<bool>,
pub last_changelog_version: Option<String>,
pub double_escape_action: Option<String>,
pub editor_padding_x: Option<u32>,
pub autocomplete_max_visible: Option<u32>,
pub session_picker_input: Option<u32>,
pub session_store: Option<String>,
pub session_durability: Option<String>,
pub compaction: Option<CompactionSettings>,
pub branch_summary: Option<BranchSummarySettings>,
pub retry: Option<RetrySettings>,
pub shell_path: Option<String>,
pub shell_command_prefix: Option<String>,
pub gh_path: Option<String>,
pub images: Option<ImageSettings>,
pub markdown: Option<MarkdownSettings>,
pub terminal: Option<TerminalSettings>,
pub thinking_budgets: Option<ThinkingBudgets>,
pub packages: Option<Vec<PackageSource>>,
pub extensions: Option<Vec<String>>,
pub skills: Option<Vec<String>>,
pub prompts: Option<Vec<String>>,
pub themes: Option<Vec<String>>,
pub enable_skill_commands: Option<bool>,
pub extension_policy: Option<ExtensionPolicyConfig>,
pub repair_policy: Option<RepairPolicyConfig>,
pub extension_risk: Option<ExtensionRiskConfig>,
}Expand description
Main configuration structure.
Fields§
§theme: Option<String>§hide_thinking_block: Option<bool>§show_hardware_cursor: Option<bool>§default_provider: Option<String>§default_model: Option<String>§default_thinking_level: Option<String>§enabled_models: Option<Vec<String>>§steering_mode: Option<String>§follow_up_mode: Option<String>§check_for_updates: Option<bool>§quiet_startup: Option<bool>§collapse_changelog: Option<bool>§last_changelog_version: Option<String>§double_escape_action: Option<String>§editor_padding_x: Option<u32>§autocomplete_max_visible: Option<u32>§session_picker_input: Option<u32>Non-interactive session picker selection (1-based index).
session_store: Option<String>Session persistence backend: jsonl (default) or sqlite (requires sqlite-sessions).
session_durability: Option<String>Session durability mode: strict, balanced (default), or throughput.
compaction: Option<CompactionSettings>§branch_summary: Option<BranchSummarySettings>§retry: Option<RetrySettings>§shell_path: Option<String>§shell_command_prefix: Option<String>§gh_path: Option<String>Override path to GitHub CLI (gh) for features like /share.
images: Option<ImageSettings>§markdown: Option<MarkdownSettings>§terminal: Option<TerminalSettings>§thinking_budgets: Option<ThinkingBudgets>§packages: Option<Vec<PackageSource>>§extensions: Option<Vec<String>>§skills: Option<Vec<String>>§prompts: Option<Vec<String>>§themes: Option<Vec<String>>§enable_skill_commands: Option<bool>§extension_policy: Option<ExtensionPolicyConfig>§repair_policy: Option<RepairPolicyConfig>§extension_risk: Option<ExtensionRiskConfig>Implementations§
Source§impl Config
impl Config
Sourcepub fn global_dir() -> PathBuf
pub fn global_dir() -> PathBuf
Get the global configuration directory.
Sourcepub fn project_dir() -> PathBuf
pub fn project_dir() -> PathBuf
Get the project configuration directory.
Sourcepub fn sessions_dir() -> PathBuf
pub fn sessions_dir() -> PathBuf
Get the sessions directory.
Sourcepub fn package_dir() -> PathBuf
pub fn package_dir() -> PathBuf
Get the package directory.
Sourcepub fn extension_index_path() -> PathBuf
pub fn extension_index_path() -> PathBuf
Get the extension index cache file path.
Sourcepub fn permissions_path() -> PathBuf
pub fn permissions_path() -> PathBuf
Get the extension permissions file path.
pub fn load_with_roots( config_path: Option<&Path>, global_dir: &Path, cwd: &Path, ) -> Result<Self>
pub fn settings_path_with_roots( scope: SettingsScope, global_dir: &Path, cwd: &Path, ) -> PathBuf
pub fn patch_settings_with_roots( scope: SettingsScope, global_dir: &Path, cwd: &Path, patch: Value, ) -> Result<PathBuf>
Sourcepub fn merge(base: Self, other: Self) -> Self
pub fn merge(base: Self, other: Self) -> Self
Merge two configurations, with other taking precedence.
pub fn compaction_enabled(&self) -> bool
pub fn steering_queue_mode(&self) -> QueueMode
pub fn follow_up_queue_mode(&self) -> QueueMode
pub fn compaction_reserve_tokens(&self) -> u32
pub fn compaction_keep_recent_tokens(&self) -> u32
pub fn branch_summary_reserve_tokens(&self) -> u32
pub fn retry_enabled(&self) -> bool
pub fn retry_max_retries(&self) -> u32
pub fn retry_base_delay_ms(&self) -> u32
pub fn retry_max_delay_ms(&self) -> u32
pub fn image_auto_resize(&self) -> bool
Sourcepub fn should_check_for_updates(&self) -> bool
pub fn should_check_for_updates(&self) -> bool
Whether to check for version updates on startup (default: true).
pub fn image_block_images(&self) -> bool
pub fn terminal_show_images(&self) -> bool
pub fn terminal_clear_on_shrink(&self) -> bool
pub fn thinking_budget(&self, level: &str) -> u32
pub fn enable_skill_commands(&self) -> bool
Sourcepub fn resolve_extension_policy_with_metadata(
&self,
cli_override: Option<&str>,
) -> ResolvedExtensionPolicy
pub fn resolve_extension_policy_with_metadata( &self, cli_override: Option<&str>, ) -> ResolvedExtensionPolicy
Resolve the extension policy from config, CLI override, and env var.
Resolution order (highest precedence first):
cli_override(from--extension-policyflag)PI_EXTENSION_POLICYenvironment variableextension_policy.profilefrom settings.json- Default: “safe”
If allow_dangerous is true (from config or env), exec/env are removed
from the policy’s deny list.
pub fn resolve_extension_policy( &self, cli_override: Option<&str>, ) -> ExtensionPolicy
Sourcepub fn resolve_repair_policy_with_metadata(
&self,
cli_override: Option<&str>,
) -> ResolvedRepairPolicy
pub fn resolve_repair_policy_with_metadata( &self, cli_override: Option<&str>, ) -> ResolvedRepairPolicy
Resolve the repair policy from config, CLI override, and env var.
Resolution order (highest precedence first):
cli_override(from--repair-policyflag)PI_REPAIR_POLICYenvironment variablerepair_policy.modefrom settings.json- Default: “suggest”
pub fn resolve_repair_policy( &self, cli_override: Option<&str>, ) -> RepairPolicyMode
Sourcepub fn resolve_extension_risk_with_metadata(&self) -> ResolvedExtensionRisk
pub fn resolve_extension_risk_with_metadata(&self) -> ResolvedExtensionRisk
Resolve runtime risk controller settings from config and environment.
Resolution order (highest precedence first):
PI_EXTENSION_RISK_*env varsextensionRiskconfig- deterministic defaults
pub fn resolve_extension_risk(&self) -> RuntimeRiskConfig
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<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
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 moreSource§impl<T> ModelDump for Twhere
T: Serialize,
impl<T> ModelDump for Twhere
T: Serialize,
Source§fn model_dump(&self, options: DumpOptions) -> Result<Value, Error>
fn model_dump(&self, options: DumpOptions) -> Result<Value, Error>
Source§fn model_dump_json(&self) -> Result<String, Error>
fn model_dump_json(&self) -> Result<String, Error>
Source§fn model_dump_json_pretty(&self) -> Result<String, Error>
fn model_dump_json_pretty(&self) -> Result<String, Error>
Source§fn model_dump_json_with_options(
&self,
options: DumpOptions,
) -> Result<String, Error>
fn model_dump_json_with_options( &self, options: DumpOptions, ) -> Result<String, Error>
Source§impl<T> ModelValidate for Twhere
T: DeserializeOwned,
impl<T> ModelValidate for Twhere
T: DeserializeOwned,
Source§fn model_validate(
input: impl Into<ValidateInput>,
options: ValidateOptions,
) -> Result<T, ValidationError>
fn model_validate( input: impl Into<ValidateInput>, options: ValidateOptions, ) -> Result<T, ValidationError>
Source§fn model_validate_json(json: &str) -> Result<Self, ValidationError>
fn model_validate_json(json: &str) -> Result<Self, ValidationError>
Source§fn model_validate_dict(
dict: HashMap<String, Value>,
) -> Result<Self, ValidationError>
fn model_validate_dict( dict: HashMap<String, Value>, ) -> Result<Self, ValidationError>
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().