Skip to content

Commit

Permalink
Improve jf how AI assistant command interface UI (#2705)
Browse files Browse the repository at this point in the history
  • Loading branch information
sverdlov93 authored Sep 26, 2024
1 parent 75a66e0 commit 75c0bf2
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions general/ai/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,20 @@ func HowCmd(c *cli.Context) error {
if err != nil {
return err
}
validResponse := strings.HasPrefix(llmAnswer, "jf")
// Print the generated command within a styled table frame.
coreutils.PrintMessageInsideFrame(coreutils.PrintBoldTitle(llmAnswer), " ")
if validResponse {
coreutils.PrintMessageInsideFrame(coreutils.PrintBoldTitle(llmAnswer), " ")
} else {
log.Output(" " + coreutils.PrintYellow(llmAnswer))
}

log.Output()
if err = sendFeedback(); err != nil {
return err
// If the response is a valid JFrog CLI command, ask the user for feedback.
if validResponse {
log.Output()
if err = sendFeedback(); err != nil {
return err
}
}

log.Output("\n" + coreutils.PrintComment("-------------------") + "\n")
Expand Down

0 comments on commit 75c0bf2

Please sign in to comment.