- Switch chat command from Bubble Tea TUI to basic CLI with bufio. - Hardcode Grok model in commands, remove Viper config. - Stream responses directly in client, remove channel-based streaming. - Add safe previews/backups in edit, simplify prompts across tools. - Update git helper and trim unused deps in go.mod.
28 lines
705 B
Go
28 lines
705 B
Go
package cmd
|
|
|
|
import (
|
|
"github.com/fatih/color"
|
|
"github.com/spf13/cobra"
|
|
"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
|
|
}
|
|
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, "grok-4")
|
|
},
|
|
}
|