diff --git a/cmd/auth/auth.go b/cmd/auth/auth.go index 33cba9bcad..cb077a1896 100644 --- a/cmd/auth/auth.go +++ b/cmd/auth/auth.go @@ -71,7 +71,7 @@ var AuthCmd = &cobra.Command{ os.Exit(1) } - if password == "" { + if ai.NeedPassword(backend) && password == "" { fmt.Printf("Enter %s Key: ", backend) bytePassword, err := term.ReadPassword(int(syscall.Stdin)) if err != nil { diff --git a/pkg/ai/iai.go b/pkg/ai/iai.go index 4cd2eb8ac0..39e66b3dc2 100644 --- a/pkg/ai/iai.go +++ b/pkg/ai/iai.go @@ -67,3 +67,7 @@ func (p *AIProvider) GetPassword() string { func (p *AIProvider) GetModel() string { return p.Model } + +func NeedPassword(backend string) bool { + return backend != "localai" +}