- Eliminate header comments with timestamps and ownership from all source files - Update agent and edit commands to clean such comments and simplify response handling - Add helper to remove last modified lines in edit command - Minor formatting and import cleanups across codebase
33 lines
824 B
Go
33 lines
824 B
Go
package cmd
|
|
|
|
import (
|
|
"github.com/fatih/color"
|
|
"github.com/spf13/cobra"
|
|
"gmgauthier.com/grokkit/config"
|
|
"gmgauthier.com/grokkit/internal/git"
|
|
"gmgauthier.com/grokkit/internal/grok"
|
|
)
|
|
|
|
var historyCmd = &cobra.Command{
|
|
Use: "history",
|
|
Short: "Summarize recent git history",
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
log := git.Run([]string{"log", "--oneline", "-10"})
|
|
if log == "" {
|
|
color.Yellow("No commits found.")
|
|
return
|
|
}
|
|
|
|
modelFlag, _ := cmd.Flags().GetString("model")
|
|
model := config.GetModel(modelFlag)
|
|
|
|
client := grok.NewClient()
|
|
messages := []map[string]string{
|
|
{"role": "system", "content": "Summarize the recent git history in 3-5 bullet points."},
|
|
{"role": "user", "content": log},
|
|
}
|
|
color.Yellow("Summarizing recent commits...")
|
|
client.Stream(messages, model)
|
|
},
|
|
}
|