-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.go
30 lines (23 loc) · 787 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package main
import (
"log"
"github.com/sashabaranov/go-openai"
"github.com/spf13/cobra"
"github.com/tiaguinho/cli-bud/auth"
"github.com/tiaguinho/cli-bud/cgpt"
"github.com/tiaguinho/cli-bud/cmds"
)
var rootCmd = &cobra.Command{}
func main() {
rootCmd.PersistentFlags().StringVarP(&cgpt.Model, "model", "m", openai.GPT3Dot5Turbo, "OpenAI model name")
rootCmd.PersistentFlags().StringVarP(&auth.Token, "token", "t", "", "OpenAI API token")
rootCmd.PersistentFlags().BoolVarP(&cgpt.Debug, "debug", "d", false, "Enable debug mode")
rootCmd.AddCommand(auth.SetToken())
rootCmd.AddCommand(cmds.Create())
rootCmd.AddCommand(cmds.Do())
rootCmd.AddCommand(cmds.Message())
rootCmd.AddCommand(cmds.StartChat())
if err := rootCmd.Execute(); err != nil {
log.Fatal(err)
}
}