goldwarden-vaultwarden-bitw.../cli/cmd/autofill.go

30 lines
540 B
Go

//go:build linux
package cmd
import (
"bufio"
"encoding/hex"
"os"
"github.com/quexten/goldwarden/cli/autotype"
"github.com/spf13/cobra"
)
var autofillCmd = &cobra.Command{
Hidden: true,
Use: "autotype",
Short: "Autotype credentials",
Long: `Autotype credentials`,
Run: func(cmd *cobra.Command, args []string) {
reader := bufio.NewReader(os.Stdin)
textHex, _ := reader.ReadString('\n')
text, _ := hex.DecodeString(textHex)
autotype.TypeString(string(text))
},
}
func init() {
rootCmd.AddCommand(autofillCmd)
}