package cmd

import (
	"fmt"

	"github.com/elliottsam/vault-config/crypto"
	"github.com/spf13/cobra"
)

// keygenCmd represents the keygen command
var keygenCmd = &cobra.Command{
	Use:   "keygen",
	Short: "Creates key suitable for encryption",
	Long: `Generates a random 32 byte base64 encoded
key suitable for use with the encryption
implementation used in this tool`,
	Run: func(cmd *cobra.Command, args []string) {
		fmt.Printf("Key: %s\n", crypto.RandomKeyB64(32))
	},
}

func init() {
	RootCmd.AddCommand(keygenCmd)
}
