diff --git a/cmd/cli/init.go b/cmd/cli/init.go new file mode 100644 index 0000000..7b187f2 --- /dev/null +++ b/cmd/cli/init.go @@ -0,0 +1,16 @@ +package cli + +import ( + "fmt" + + "github.com/spf13/cobra" +) + +var initCmd = &cobra.Command{ + Use: "init", + Short: "Initialize a new Sern project.", + Long: `Initialize a new Sern project, either with a JavaScript or a TypeScript template.`, + Run: func(cmd *cobra.Command, args []string) { + fmt.Println("Sern CLI - Init") + }, +} diff --git a/cmd/cli/root.go b/cmd/cli/root.go index 111e376..32b34c7 100644 --- a/cmd/cli/root.go +++ b/cmd/cli/root.go @@ -20,6 +20,7 @@ func Execute() { rootCmd.Flags().BoolP("help", "h", false, "Help for the Sern CLI.") rootCmd.Flags().BoolP("version", "v", false, "The version of the Sern CLI.") rootCmd.SetVersionTemplate("Sern CLI - Version {{.Version}}\n") + rootCmd.AddCommand(initCmd) if err := rootCmd.Execute(); err != nil { fmt.Println(err) diff --git a/go.mod b/go.mod index b0e07b2..40ccd50 100644 --- a/go.mod +++ b/go.mod @@ -2,8 +2,9 @@ module github.com/sern-handler/cli go 1.18 +require github.com/spf13/cobra v1.4.0 + require ( github.com/inconshreveable/mousetrap v1.0.0 // indirect - github.com/spf13/cobra v1.4.0 // indirect github.com/spf13/pflag v1.0.5 // indirect )