goldwarden/cmd/autofill.go
2023-12-23 12:26:01 +01:00

28 lines
561 B
Go

//go:build linux
package cmd
import (
"os"
"github.com/quexten/goldwarden/autotype"
"github.com/spf13/cobra"
)
var autofillCmd = &cobra.Command{
Use: "autotype",
Short: "Autotype credentials",
Long: `Autotype credentials`,
Run: func(cmd *cobra.Command, args []string) {
username, _ := cmd.Flags().GetString("username")
// get pasword from env
password := os.Getenv("PASSWORD")
autotype.TypeString(username + "\t" + password)
},
}
func init() {
rootCmd.AddCommand(autofillCmd)
autofillCmd.PersistentFlags().String("username", "", "")
}