Skip to main content

Config

Struct Config 

Source
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

Source

pub fn load() -> Result<Self>

Load configuration from global and project settings.

Source

pub fn global_dir() -> PathBuf

Get the global configuration directory.

Source

pub fn project_dir() -> PathBuf

Get the project configuration directory.

Source

pub fn sessions_dir() -> PathBuf

Get the sessions directory.

Source

pub fn package_dir() -> PathBuf

Get the package directory.

Source

pub fn extension_index_path() -> PathBuf

Get the extension index cache file path.

Source

pub fn auth_path() -> PathBuf

Get the auth file path.

Source

pub fn permissions_path() -> PathBuf

Get the extension permissions file path.

Source

pub fn load_with_roots( config_path: Option<&Path>, global_dir: &Path, cwd: &Path, ) -> Result<Self>

Source

pub fn settings_path_with_roots( scope: SettingsScope, global_dir: &Path, cwd: &Path, ) -> PathBuf

Source

pub fn patch_settings_with_roots( scope: SettingsScope, global_dir: &Path, cwd: &Path, patch: Value, ) -> Result<PathBuf>

Source

pub fn merge(base: Self, other: Self) -> Self

Merge two configurations, with other taking precedence.

Source

pub fn compaction_enabled(&self) -> bool

Source

pub fn steering_queue_mode(&self) -> QueueMode

Source

pub fn follow_up_queue_mode(&self) -> QueueMode

Source

pub fn compaction_reserve_tokens(&self) -> u32

Source

pub fn compaction_keep_recent_tokens(&self) -> u32

Source

pub fn branch_summary_reserve_tokens(&self) -> u32

Source

pub fn retry_enabled(&self) -> bool

Source

pub fn retry_max_retries(&self) -> u32

Source

pub fn retry_base_delay_ms(&self) -> u32

Source

pub fn retry_max_delay_ms(&self) -> u32

Source

pub fn image_auto_resize(&self) -> bool

Source

pub fn should_check_for_updates(&self) -> bool

Whether to check for version updates on startup (default: true).

Source

pub fn image_block_images(&self) -> bool

Source

pub fn terminal_show_images(&self) -> bool

Source

pub fn terminal_clear_on_shrink(&self) -> bool

Source

pub fn thinking_budget(&self, level: &str) -> u32

Source

pub fn enable_skill_commands(&self) -> bool

Source

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):

  1. cli_override (from --extension-policy flag)
  2. PI_EXTENSION_POLICY environment variable
  3. extension_policy.profile from settings.json
  4. Default: “safe”

If allow_dangerous is true (from config or env), exec/env are removed from the policy’s deny list.

Source

pub fn resolve_extension_policy( &self, cli_override: Option<&str>, ) -> ExtensionPolicy

Source

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):

  1. cli_override (from --repair-policy flag)
  2. PI_REPAIR_POLICY environment variable
  3. repair_policy.mode from settings.json
  4. Default: “suggest”
Source

pub fn resolve_repair_policy( &self, cli_override: Option<&str>, ) -> RepairPolicyMode

Source

pub fn resolve_extension_risk_with_metadata(&self) -> ResolvedExtensionRisk

Resolve runtime risk controller settings from config and environment.

Resolution order (highest precedence first):

  1. PI_EXTENSION_RISK_* env vars
  2. extensionRisk config
  3. deterministic defaults
Source

pub fn resolve_extension_risk(&self) -> RuntimeRiskConfig

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() -> Config

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

impl<'de> Deserialize<'de> for Config
where Config: Default,

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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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: NoopSpan) -> Self

Instruments this future with a span (no-op when disabled).
Source§

fn in_current_span(self) -> Self

Instruments this future with the current span (no-op when disabled).
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> ModelDump for T
where T: Serialize,

Source§

fn model_dump(&self, options: DumpOptions) -> Result<Value, Error>

Serialize a model to a JSON value. Read more
Source§

fn model_dump_json(&self) -> Result<String, Error>

Serialize a model to a JSON string with default options.
Source§

fn model_dump_json_pretty(&self) -> Result<String, Error>

Serialize a model to a pretty-printed JSON string.
Source§

fn model_dump_json_with_options( &self, options: DumpOptions, ) -> Result<String, Error>

Serialize a model to a JSON string with full options support. Read more
Source§

impl<T> ModelValidate for T

Source§

fn model_validate( input: impl Into<ValidateInput>, options: ValidateOptions, ) -> Result<T, ValidationError>

Create and validate a model from input. Read more
Source§

fn model_validate_json(json: &str) -> Result<Self, ValidationError>

Create and validate a model from JSON string with default options.
Source§

fn model_validate_dict( dict: HashMap<String, Value>, ) -> Result<Self, ValidationError>

Create and validate a model from a HashMap with default options.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

Source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
Source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
Source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
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<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>,

Source§

impl<T> ParallelSend for T

Source§

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

Source§

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