Skip to main content

AppConfig

Struct AppConfig 

Source
pub struct AppConfig {
Show 21 fields pub provider: String, pub model: String, pub api_key: String, pub api_url: String, pub api_headers: String, pub locale: String, pub one_liner: bool, pub commit_template: String, pub llm_system_prompt: String, pub use_gitmoji: bool, pub gitmoji_format: String, pub review_commit: bool, pub post_commit_push: String, pub suppress_tool_output: bool, pub warn_staged_files_enabled: bool, pub warn_staged_files_threshold: usize, pub confirm_new_version: bool, pub auto_update: Option<bool>, pub fallback_enabled: bool, pub track_generated_commits: bool, pub diff_exclude_globs: Vec<String>,
}

Fields§

§provider: String§model: String§api_key: String§api_url: String§api_headers: String§locale: String§one_liner: bool§commit_template: String§llm_system_prompt: String§use_gitmoji: bool§gitmoji_format: String§review_commit: bool§post_commit_push: String§suppress_tool_output: bool§warn_staged_files_enabled: bool§warn_staged_files_threshold: usize§confirm_new_version: bool§auto_update: Option<bool>§fallback_enabled: bool§track_generated_commits: bool§diff_exclude_globs: Vec<String>

Implementations§

Source§

impl AppConfig

Source

pub fn load() -> Result<Self>

Load config with layered resolution: defaults → global TOML → local .env → env vars

Source

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

Save to global TOML config file

Source

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

Save to local .env file in the git repo root

Source

pub fn fields_display(&self) -> Vec<(&'static str, &'static str, String)>

Get all fields as (display_name, env_suffix, current_value) tuples

Source

pub fn grouped_fields(&self) -> Vec<FieldGroup>

Field groups for the interactive config UI

Source

pub fn set_field(&mut self, suffix: &str, value: &str) -> Result<()>

Set a field by its env suffix

Trait Implementations§

Source§

impl Clone for AppConfig

Source§

fn clone(&self) -> AppConfig

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 AppConfig

Source§

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

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

impl Default for AppConfig

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for AppConfig

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 AppConfig

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> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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>,