2023-12-23 07:18:30 +01:00
|
|
|
//go:build linux
|
2023-07-17 03:23:26 +02:00
|
|
|
|
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
2024-02-17 09:51:41 +01:00
|
|
|
"bufio"
|
|
|
|
"encoding/hex"
|
2023-12-23 12:26:01 +01:00
|
|
|
"os"
|
|
|
|
|
2024-05-04 01:06:24 +02:00
|
|
|
"github.com/quexten/goldwarden/cli/autotype"
|
2023-07-17 03:23:26 +02:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
var autofillCmd = &cobra.Command{
|
2024-02-08 16:35:07 +01:00
|
|
|
Hidden: true,
|
|
|
|
Use: "autotype",
|
|
|
|
Short: "Autotype credentials",
|
|
|
|
Long: `Autotype credentials`,
|
2023-07-17 03:23:26 +02:00
|
|
|
Run: func(cmd *cobra.Command, args []string) {
|
2024-02-17 09:51:41 +01:00
|
|
|
reader := bufio.NewReader(os.Stdin)
|
|
|
|
textHex, _ := reader.ReadString('\n')
|
|
|
|
text, _ := hex.DecodeString(textHex)
|
|
|
|
autotype.TypeString(string(text))
|
2023-07-17 03:23:26 +02:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
rootCmd.AddCommand(autofillCmd)
|
|
|
|
}
|