diff --git a/cmd/quickstart/quickstart.go b/cmd/quickstart/quickstart.go new file mode 100644 index 00000000..cf4e92fa --- /dev/null +++ b/cmd/quickstart/quickstart.go @@ -0,0 +1,25 @@ +package quickstart + +import ( + "github.com/spf13/cobra" +) + +func NewCmd() *cobra.Command { + var quickstartCmd = &cobra.Command{ + Use: "quickstart [sdk]", + Short: "Create a minimal getting started app for the specified SDK", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + sdk := args[0] + printInstructionsFor(sdk, sdk, cmd) + return nil + }, + } + return quickstartCmd +} + +func printInstructionsFor(language, alias string, cmd *cobra.Command) { + cmd.Printf("Getting started with Resonate for %s\n", alias) + cmd.Println("> 🏴‍☠️ 1. Run git clone git@github.com:resonatehq/" + language + "-quickstart.git quickstart && cd quickstart") + cmd.Println("> 🏴‍☠️ 2. Follow the Getting Started instructions in Readme.md") +} diff --git a/cmd/root.go b/cmd/root.go index 3dec80f4..3c5fa4bc 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -7,6 +7,7 @@ import ( "github.com/resonatehq/resonate/cmd/dst" "github.com/resonatehq/resonate/cmd/promises" + "github.com/resonatehq/resonate/cmd/quickstart" "github.com/resonatehq/resonate/cmd/schedules" "github.com/resonatehq/resonate/cmd/serve" "github.com/resonatehq/resonate/pkg/client" @@ -40,6 +41,7 @@ func init() { rootCmd.AddCommand(schedules.NewCmd(c)) rootCmd.AddCommand(dst.NewCmd()) rootCmd.AddCommand(serve.ServeCmd()) + rootCmd.AddCommand(quickstart.NewCmd()) // Set default output rootCmd.SetOut(os.Stdout)