@@ -114,8 +114,8 @@ export function saveConfig(config: Config): void {
114114 mkdirSync ( dir , { recursive : true } ) ;
115115 }
116116
117- const content = `# git-commit-ai configuration
118- # Backend: ollama, openai, anthropic, groq
117+ let content = `# git-commit-ai configuration
118+ # Backend: ollama, llamacpp, openai, anthropic, groq
119119backend = "${ config . backend } "
120120model = "${ config . model } "
121121ollama_url = "${ config . ollama_url } "
@@ -126,6 +126,20 @@ temperature = ${config.temperature}
126126retry_temperatures = [${ config . retry_temperatures . join ( ", " ) } ]
127127` ;
128128
129+ // Add optional fields if set
130+ if ( config . default_language ) {
131+ content += `default_language = "${ config . default_language } "\n` ;
132+ }
133+ if ( config . default_scope ) {
134+ content += `default_scope = "${ config . default_scope } "\n` ;
135+ }
136+ if ( config . default_type ) {
137+ content += `default_type = "${ config . default_type } "\n` ;
138+ }
139+ if ( config . ignore_patterns && config . ignore_patterns . length > 0 ) {
140+ content += `ignore_patterns = [${ config . ignore_patterns . map ( p => `"${ p } "` ) . join ( ", " ) } ]\n` ;
141+ }
142+
129143 writeFileSync ( configPath , content , "utf-8" ) ;
130144}
131145
0 commit comments