@@ -87,37 +87,6 @@ func (a *App) generateCommitMessage(ctx context.Context, diff string, cfg *ai.Co
8787 return msg , nil
8888}
8989
90- // formatGitCommand formats the git commit command for display based on message content.
91- // Handles both single-line and multi-line commit messages.
92- func formatGitCommand (msg string ) string {
93- lines := strings .Split (msg , "\n " )
94- nonEmptyLines := make ([]string , 0 , len (lines ))
95-
96- // Filter out empty lines
97- for _ , line := range lines {
98- if trimmed := strings .TrimSpace (line ); trimmed != "" {
99- nonEmptyLines = append (nonEmptyLines , trimmed )
100- }
101- }
102-
103- if len (nonEmptyLines ) == 0 {
104- return "git commit -m \" \" "
105- }
106-
107- if len (nonEmptyLines ) == 1 {
108- return fmt .Sprintf ("git commit -m \" %s\" " , nonEmptyLines [0 ])
109- }
110-
111- var builder strings.Builder
112- builder .WriteString (fmt .Sprintf ("git commit -m \" %s\" " , nonEmptyLines [0 ]))
113-
114- for _ , line := range nonEmptyLines [1 :] {
115- builder .WriteString (fmt .Sprintf (" \\ \n -m \" %s\" " , line ))
116- }
117-
118- return builder .String ()
119- }
120-
12190// CommitAction handles the generation of commit messages
12291func (a * App ) CommitAction (c * cli.Context ) error {
12392 if c .NArg () > 0 {
@@ -163,7 +132,7 @@ func (a *App) CommitAction(c *cli.Context) error {
163132
164133 // Display the generated command
165134 fmt .Println ("✅ Commit message generated. You can now run:" )
166- fmt .Printf (" %s\n " , formatGitCommand (msg ))
135+ fmt .Printf (" %s\n " , utils . FormatGitCommand (msg ))
167136
168137 return nil
169138}
@@ -269,6 +238,9 @@ func (a *App) updateConfigFromFlags(cfg *config.Config, c *cli.Context) {
269238 if commitType := c .String ("commit-type" ); commitType != "" {
270239 cfg .CommitType = commitType
271240 }
241+ if temperature := c .Float64 ("temperature" ); temperature != 0 {
242+ cfg .Temperature = temperature
243+ }
272244 if customConvention := c .String ("custom-convention" ); customConvention != "" {
273245 cfg .CustomConvention = customConvention
274246 }
0 commit comments