2026-02-28 18:03:12 +00:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"os"
|
|
|
|
|
|
|
|
|
|
"github.com/spf13/cobra"
|
2026-02-28 19:56:23 +00:00
|
|
|
"gmgauthier.com/grokkit/config"
|
2026-02-28 18:03:12 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
var rootCmd = &cobra.Command{
|
|
|
|
|
Use: "grokkit",
|
|
|
|
|
Short: "Personal Grok / xAI command-line toolkit",
|
|
|
|
|
Long: `A fast, native Go CLI for Grok. Chat, edit files, and supercharge your git workflow.`,
|
2026-02-28 20:52:03 +00:00
|
|
|
PersistentPreRun: func(cmd *cobra.Command, args []string) {
|
|
|
|
|
config.Load()
|
|
|
|
|
},
|
2026-02-28 18:03:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func Execute() {
|
|
|
|
|
if err := rootCmd.Execute(); err != nil {
|
|
|
|
|
os.Exit(1)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
|
rootCmd.AddCommand(chatCmd)
|
|
|
|
|
rootCmd.AddCommand(editCmd)
|
|
|
|
|
rootCmd.AddCommand(reviewCmd)
|
|
|
|
|
rootCmd.AddCommand(commitMsgCmd)
|
|
|
|
|
rootCmd.AddCommand(commitCmd)
|
|
|
|
|
rootCmd.AddCommand(prDescribeCmd)
|
|
|
|
|
rootCmd.AddCommand(historyCmd)
|
2026-02-28 22:29:16 +00:00
|
|
|
rootCmd.AddCommand(agentCmd)
|
2026-02-28 21:53:35 +00:00
|
|
|
chatCmd.Flags().StringP("model", "m", "", "Grok model to use (overrides config)")
|
2026-02-28 22:59:16 +00:00
|
|
|
}
|