Skip to main content

Config

Struct Config 

Source
pub struct Config {
Show 39 fields pub backend: CliBackend, pub backend_order: Vec<CliBackend>, pub commit_mode: CommitMode, pub sparkle_mode: CommitMode, pub provider: String, pub model: String, pub cli_path: String, pub claude_path: String, pub codex_path: String, pub claude_model: String, pub codex_model: String, pub codex_provider: String, pub gemini_path: String, pub gemini_model: String, pub opencode_pr_provider: String, pub opencode_pr_model: String, pub opencode_cheap_provider: String, pub opencode_cheap_model: String, pub claude_pr_model: String, pub claude_cheap_model: String, pub codex_pr_model: String, pub codex_cheap_model: String, pub codex_pr_provider: String, pub codex_cheap_provider: String, pub gemini_pr_model: String, pub gemini_cheap_model: String, pub pr_base_branch: String, pub branch_mode: BranchMode, pub diff_source: DiffSource, pub max_diff_length: usize, pub use_emojis: bool, pub use_lower_case: bool, pub commit_template: String, pub languages: Vec<LanguageConfig>, pub active_language: String, pub show_language_selector: bool, pub auto_update: bool, pub refine: RefineConfig, pub custom: CustomConfig,
}
Expand description

Main configuration. All fields have defaults matching the TypeScript extension.

Fields§

§backend: CliBackend§backend_order: Vec<CliBackend>§commit_mode: CommitMode§sparkle_mode: CommitMode§provider: String§model: String§cli_path: String§claude_path: String§codex_path: String§claude_model: String§codex_model: String§codex_provider: String§gemini_path: String§gemini_model: String§opencode_pr_provider: String§opencode_pr_model: String§opencode_cheap_provider: String§opencode_cheap_model: String§claude_pr_model: String§claude_cheap_model: String§codex_pr_model: String§codex_cheap_model: String§codex_pr_provider: String§codex_cheap_provider: String§gemini_pr_model: String§gemini_cheap_model: String§pr_base_branch: String§branch_mode: BranchMode§diff_source: DiffSource§max_diff_length: usize§use_emojis: bool§use_lower_case: bool§commit_template: String§languages: Vec<LanguageConfig>§active_language: String§show_language_selector: bool§auto_update: bool§refine: RefineConfig§custom: CustomConfig

Implementations§

Source§

impl Config

Source

pub fn default_config_dir() -> Option<PathBuf>

Default config directory: $XDG_CONFIG_HOME/opencodecommit or $HOME/.config/opencodecommit.

Source

pub fn active_language_instruction(&self) -> String

Resolve the language instruction for the active language.

Source

pub fn active_prompt_modules(&self) -> PromptModules

Resolve prompt modules for the active language. Missing fields on the active language fall back to the first language.

Source

pub fn backend_cli_path(&self) -> &str

Return the CLI path for the current backend.

Source

pub fn cli_path_for(&self, backend: CliBackend) -> &str

Return the CLI path for a specific backend.

Source

pub fn effective_backend_order(&self) -> &[CliBackend]

Return the effective backend order for failover.

Source

pub fn backend_model(&self) -> &str

Return the model for the current backend.

Source

pub fn backend_pr_model(&self) -> &str

Return the PR model for the current backend.

Source

pub fn backend_cheap_model(&self) -> &str

Return the cheap model for the current backend.

Source

pub fn backend_pr_provider(&self) -> &str

Return the PR provider for the current backend (OpenCode/Codex only).

Source

pub fn backend_cheap_provider(&self) -> &str

Return the cheap provider for the current backend (OpenCode/Codex only).

Source

pub fn default_config_path() -> Option<PathBuf>

Default config file path: $XDG_CONFIG_HOME/opencodecommit/config.toml or $HOME/.config/opencodecommit/config.toml.

Source

pub fn load(path: &Path) -> Result<Self>

Load config from a TOML file. Missing fields get defaults.

Source

pub fn load_or_default(explicit_path: Option<&Path>) -> Result<Self>

Load from the default config path, or return defaults if no file exists.

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, 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> 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,