gemini-commit-message

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 108de4c4df581ffadf5b2c0eaec5847bc5059ab0
parent a31c282542143441466299353a71d17c4856e322
Author: Minerva_juppiter <94231606+minerva-jupiter@users.noreply.github.com>
Date:   Sat, 25 Apr 2026 01:32:59 +0000

refactor(git): update model version and improve console output (#7)

- Update gemini model to `gemini-flash-lite-latest`
- Format output by printing the raw message instead of debug string
- Suppress success message on clipboard copy to reduce terminal noise
Diffstat:
Msrc/main.rs | 12++++--------
1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/main.rs b/src/main.rs @@ -6,10 +6,7 @@ use std::env; use std::process::Command; fn get_git_diff() -> Result<String, Box<dyn std::error::Error>> { - let diff = Command::new("git") - .arg("diff") - .arg("--cached") - .output()?; + let diff = Command::new("git").arg("diff").arg("--cached").output()?; if !diff.status.success() { println!("error get_git_diff {}", diff.status); @@ -79,10 +76,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> { let prompto = create_prompt(&diff); let message = generate_commit_message(&prompto, api_key)?; - println!("{:?}", message); + println!("{}", message); match copy_to_clip(&message) { - Ok(_) => println!("success to copy to clip"), + Ok(_) => {} Err(e) => eprintln!("fail to copy to clip {:?}", e), } Ok(()) @@ -149,8 +146,7 @@ fn generate_commit_message( prompt: &str, api_key: String, ) -> Result<String, Box<dyn std::error::Error>> { - let url = - "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent"; + let url = "https://generativelanguage.googleapis.com/v1beta/models/gemini-flash-lite-latest:generateContent"; let payload = serde_json::json!({ "contents": [