diff --git a/pkg/cli/cmd.go b/pkg/cli/cmd.go index 151c34b..e1c1044 100644 --- a/pkg/cli/cmd.go +++ b/pkg/cli/cmd.go @@ -68,7 +68,7 @@ var newCmd = &cobra.Command{ Short: "Start a new conversation", Long: `Start a new conversation with the Large Language Model.`, Run: func(cmd *cobra.Command, args []string) { - messageContents, err := InputFromEditor("# What would you like to say?", "message.*.md") + messageContents, err := InputFromEditor("# What would you like to say?\n", "message.*.md") if err != nil { Fatal("Failed to get input: %v\n", err) return @@ -103,9 +103,15 @@ var promptCmd = &cobra.Command{ Short: "Do a one-shot prompt", Long: `Prompt the Large Language Model and get a response.`, Run: func(cmd *cobra.Command, args []string) { + message := strings.Join(args, " ") + if len(strings.Trim(message, " \t\n")) == 0 { + Fatal("No message was provided.\n") + return + } + messages := []Message{ { - OriginalContent: strings.Join(args, " "), + OriginalContent: message, Role: "user", }, }