Skip to content

Commit c6fda79

Browse files
committed
feat: add anthropic base url and scope control to config
This enables support for Anthropic API integration by adding a configurable base URL. It also allows disabling scope in commit messages via the no_scope CLI flag, improving flexibility in formatting.
1 parent 0bf5c92 commit c6fda79

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/config.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ pub struct Config {
102102
#[serde(default)]
103103
pub openai_base_url: Option<String>,
104104

105+
/// Base URL for Anthropic API (default: https://api.anthropic.com/v1)
106+
#[serde(default)]
107+
pub anthropic_base_url: Option<String>,
108+
105109
/// Commit message format options
106110
#[serde(default)]
107111
pub format: CommitFormat,
@@ -147,6 +151,7 @@ impl Default for Config {
147151
temperature: default_temperature(),
148152
num_predict: default_num_predict(),
149153
openai_base_url: None,
154+
anthropic_base_url: None,
150155
format: CommitFormat::default(),
151156
}
152157
}
@@ -225,6 +230,9 @@ impl Config {
225230
if let Some(ref m) = cli.model {
226231
self.model = m.clone();
227232
}
233+
if cli.no_scope {
234+
self.format.include_scope = false;
235+
}
228236
}
229237

230238
fn validate(&self) -> Result<()> {

0 commit comments

Comments
 (0)