mirror of
https://github.com/k8sgpt-ai/k8sgpt.git
synced 2025-08-29 04:40:42 +00:00
feat: don't ask for password if backend is localai
Signed-off-by: Aris Boutselis <aris.boutselis@senseon.io>
This commit is contained in:
parent
c365c53332
commit
74d9a750ca
@ -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 {
|
||||
|
@ -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"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user