func prompt(param string) (answer string) {
	var input string
	promptString := map[string]PromptRes{
		"dbdel":              {Message: color.RedString("[DANGER]") + "Do you want to delete the database (default : %s) [y/N]: ", DefaultValue: "N"},
		"dbuser":             {Message: "Database username (default : %s) : ", DefaultValue: cliSession.Config.Database.User},
		"dbpassword":         {Message: "Database password (generated : (" + color.RedString("%s") + ") : ", DefaultValue: cliSession.Config.Database.Password},
		"dbip":               {Message: "Database IP (default : %s) : ", DefaultValue: cliSession.Config.Database.IP},
		"dbport":             {Message: "Database Port (default : %s) : ", DefaultValue: strconv.Itoa(int(cliSession.Config.Database.Port))},
		"dbtype":             {Message: "Database type [postgres, jsondb, mongodb] (default : %s): ", DefaultValue: cliSession.Config.Database.DatabaseType},
		"dbname":             {Message: "Database name (default : %s): ", DefaultValue: cliSession.Config.Database.Database},
		"apiuser":            {Message: "API username (default : %s) : ", DefaultValue: cliSession.Config.API.User},
		"apipassword":        {Message: "API password (generated : (" + color.RedString("%s") + ") : ", DefaultValue: defaultAPIPassword},
		"apiport":            {Message: "API port (default : %s) : ", DefaultValue: strconv.Itoa(int(cliSession.Config.API.Port))},
		"serverip":           {Message: "Server IP (default : %s) : ", DefaultValue: cliSession.Config.Server.IP},
		"serverport":         {Message: "Server port (default : %s) : ", DefaultValue: strconv.Itoa(int(cliSession.Config.Server.Port))},
		"serverpassword":     {Message: "Server password (generated : (" + color.RedString("%s") + ") : ", DefaultValue: cliSession.Config.Server.Password},
		"usetls":             {Message: "Use TLS (default : %s) [Y/n]: ", DefaultValue: defaultTLS},
		"createuser":         {Message: "Create a new user (default : %s) [Y/n]: ", DefaultValue: defaultCreateUser},
		"algorithm":          {Message: "Load balancing algorithm (default : %s) : ", DefaultValue: cliSession.Config.Algorithm.Name},
		"projectname":        {Message: "Project name (default : %s) : ", DefaultValue: cliSession.Config.Project.Name},
		"projectdescription": {Message: "Project description (default : %s) : ", DefaultValue: cliSession.Config.Project.Description},
		"wordlist-password":  {Message: "Choose a password wordlist to download [default : %s]: \n", DefaultValue: defaultPasswordWordlist},
		"wordlist-domain":    {Message: "Choose a domain wordlist to download [default : %s]: \n", DefaultValue: defaultDomainWordlist},
	}
	fmt.Printf(promptString[param].Message, promptString[param].DefaultValue)
	fmt.Scanln(&input)
	if input == "" {
		return promptString[param].DefaultValue
	}
	return input
}
prompt user for configuration parameters
package cmd
import (
	"crypto/rand"
	"fmt"
	"os"
	"strconv"
	"strings"
	"time"
	"github.com/netm4ul/netm4ul/core/security"
	"github.com/netm4ul/netm4ul/core/config"
	"github.com/netm4ul/netm4ul/core/database/models"
	"github.com/BurntSushi/toml"
	"github.com/fatih/color"
	"github.com/netm4ul/netm4ul/core/database"
	"github.com/pkg/errors"
	log "github.com/sirupsen/logrus"
	"github.com/spf13/cobra"
)
type PromptRes struct {
	Message      string
	DefaultValue string
}
const (
	passwordLen               = 20
	defaultConfigPath         = "netm4ul.conf"
	defaultDBSetupUser        = "postgres"
	defaultDBname             = "netm4ul"
	defaultDBIP               = "localhost"
	defaultDBPort             = uint16(5432)
	defaultDBType             = "postgresql"
	defaultAPIUser            = "user"
	defaultAPIIP              = "localhost"
	defaultAPIPort            = uint16(8080)
	defaultServerIP           = "localhost"
	defaultServerPort         = uint16(444)
	defaultServerUser         = "user"
	defaultTLS                = "y"  
	defaultCreateUser         = "y"  
	defaultModuleStatus       = "y"  
	defaultAlgorithm          = "random"
	defaultProjectName        = "first"
	defaultProjectDescription = "Your first project"
	defaultPasswordWordlist   = "0"
	defaultDomainWordlist     = "0"
)
var (
	defaultDBSetupPassword, _ = GeneratePassword(passwordLen)
	defaultAPIPassword, _     = GeneratePassword(passwordLen)
	defaultServerPassword, _  = GeneratePassword(passwordLen)
	cliDBSetupUser            string
	cliDBSetupPassword        string
	cliDBSetupIP              string
	cliDBSetupPort            uint16
	cliDBSetupType            string
	cliServerPassword         string
	cliServerIP               string
	cliServerPort             uint16
	cliAPIUser                string
	cliAPIPassword            string
	cliAPIIP                  string
	cliAPIPort                uint16
	cliDisableTLS             bool
	cliAlgorithm              string
	cliWordlist               string
	skipDBSetup               bool
	skipServerSetup           bool
	skipAPISetup              bool
	skipModulesSetup          bool
	skipAlgorithmSetup        bool
	skipProjectSetup          bool
	skipWordlists             bool
)
var setupDatabaseCmd = &cobra.Command{
	Use:   "database",
	Short: "NetM4ul setup",
	Run: func(cmd *cobra.Command, args []string) {
		err := setupDB()
		if err != nil {
			log.Errorln("Could not setup the database : " + err.Error())
		}
		err = saveConfigFile()
		if err != nil {
			log.Fatal("Could not save the file : " + err.Error())
		}
	},
}
var setupAPICmd = &cobra.Command{
	Use:   "api",
	Short: "NetM4ul setup",
	Run: func(cmd *cobra.Command, args []string) {
		err := setupAPI()
		if err != nil {
			log.Errorln("Could not setup the API : " + err.Error())
		}
		err = saveConfigFile()
		if err != nil {
			log.Fatal("Could not save the file : " + err.Error())
		}
	},
}
var setupServerCmd = &cobra.Command{
	Use:   "server",
	Short: "NetM4ul setup",
	Run: func(cmd *cobra.Command, args []string) {
		err := setupServer()
		if err != nil {
			log.Errorln("Could not setup the Server : " + err.Error())
		}
		err = saveConfigFile()
		if err != nil {
			log.Fatal("Could not save the file : " + err.Error())
		}
	},
}
var setupAlgorithmCmd = &cobra.Command{
	Use:   "algorithm",
	Short: "NetM4ul setup",
	Run: func(cmd *cobra.Command, args []string) {
		err := setupAlgorithm()
		if err != nil {
			log.Errorln("Could not setup the Algorithm : " + err.Error())
		}
		err = saveConfigFile()
		if err != nil {
			log.Fatal("Could not save the file : " + err.Error())
		}
	},
}
var setupWordlistsCmd = &cobra.Command{
	Use:   "wordlists",
	Short: "NetM4ul setup",
	Run: func(cmd *cobra.Command, args []string) {
		err := setupWordlists()
		if err != nil {
			log.Errorln("Could not setup the Wordlists : " + err.Error())
		}
		err = saveConfigFile()
		if err != nil {
			log.Fatal("Could not save the file : " + err.Error())
		}
	},
}
var setupTLSCmd = &cobra.Command{
	Use:   "tls",
	Short: "NetM4ul setup",
	Run: func(cmd *cobra.Command, args []string) {
		err := setupAlgorithm()
		if err != nil {
			log.Errorln("Could not setup the Algorithm : " + err.Error())
		}
		err = saveConfigFile()
		if err != nil {
			log.Fatal("Could not save the file : " + err.Error())
		}
	},
}
var setupCmd = &cobra.Command{
	Use:   "setup",
	Short: "NetM4ul setup",
	PersistentPreRun: func(cmd *cobra.Command, args []string) {
		createSessionBase()
		if cliSession.ConfigPath == "" {
			cliSession.ConfigPath = defaultConfigPath
		}
	},
	Run: func(cmd *cobra.Command, args []string) {
		var err error
		if _, err := os.Stat(cliSession.ConfigPath); err != nil {
			err := saveConfigFile()
			if err != nil {
				log.Fatalf("Could not create: %s", err.Error())
			}
		}
		cliSession.Config, err = loadExistingConfig()
		if err != nil {
			log.Fatalf("Could load the existing config file %s", err.Error())
		}
		if !skipProjectSetup {
			err = setupProject()
			if err != nil {
				log.Fatalf("Could not setup the project : %s", err.Error())
			}
		} else {
			fmt.Println("Skiping Project setup")
		}
		if !skipDBSetup {
			err = setupDB()
			if err != nil {
				log.Fatalf("Could not setup the database : %s", err.Error())
			}
		} else {
			fmt.Println("Skiping Database setup")
		}
		if !skipAPISetup {
			err = setupAPI()
			if err != nil {
				log.Fatalf("Could not setup the API : %s", err.Error())
			}
		} else {
			fmt.Println("Skiping API setup")
		}
		if !skipServerSetup {
			err = setupServer()
			if err != nil {
				log.Fatalf("Could not setup the Server : %s", err.Error())
			}
		} else {
			fmt.Println("Skiping Server setup")
		}
		if !skipModulesSetup {
			err = setupModules()
			if err != nil {
				log.Fatalf("Could not setup modules : %s", err.Error())
			}
		} else {
			fmt.Println("Skiping modules setup")
		}
		if !skipAlgorithmSetup {
			err = setupAlgorithm()
			if err != nil {
				log.Fatalf("Could not setup the algorithm : %s", err.Error())
			}
		} else {
			fmt.Println("Skiping algorithm setup")
		}
		if !skipWordlists {
			err = setupWordlists()
			if err != nil {
				log.Fatalf("Could not setup the wordlists : %s", err.Error())
			}
		} else {
			fmt.Println("Skiping wordlists setup")
		}
		err = saveConfigFile()
		if err != nil {
			log.Fatal("Could not save the file : " + err.Error())
		}
	},
}