key.go 543 B

1234567891011121314151617181920212223
  1. package cmd
  2. import (
  3. "github.com/runningwater/gohub/pkg/console"
  4. "github.com/runningwater/gohub/pkg/helpers"
  5. "github.com/spf13/cobra"
  6. )
  7. var CmdKey = &cobra.Command{
  8. Use: "key",
  9. Short: "Generate App key, will print the generated key",
  10. Run: runKeyGenerate,
  11. Args: cobra.NoArgs,
  12. }
  13. func runKeyGenerate(cmd *cobra.Command, args []string) {
  14. console.Success("---")
  15. console.Success("App Key:")
  16. console.Success(helpers.RandomString(32))
  17. console.Success("---")
  18. console.Warning("please go to .env file to change the APP_KEY option")
  19. }