Skip to content

Commit

Permalink
feat(generate): add generate app-scaffold command
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsimonemms committed Jan 14, 2025
1 parent 8eedadf commit 2cce2ca
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
44 changes: 44 additions & 0 deletions cmd/generate.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
Copyright (C) 2021-2025, Kubefirst
This program is licensed under MIT.
See the LICENSE file for more details.
*/
package cmd

import (
"github.com/konstructio/kubefirst/internal/progress"
"github.com/spf13/cobra"
)

func GenerateCommand() *cobra.Command {
generateCommand := &cobra.Command{
Use: "generate",
Short: "code generator helpers",
}

// wire up new commands
generateCommand.AddCommand(generateApp())

return generateCommand
}

func generateApp() *cobra.Command {
var name string
var environments []string

appScaffoldCmd := &cobra.Command{
Use: "app-scaffold",
Short: "scaffold the gitops application repo",
TraverseChildren: true,
Run: func(_ *cobra.Command, _ []string) {
progress.Success("hello world")
},
}

appScaffoldCmd.Flags().StringVarP(&name, "name", "n", "", "name of the app")
appScaffoldCmd.MarkFlagRequired("name")
appScaffoldCmd.Flags().StringSliceVar(&environments, "environments", []string{"development", "staging", "production"}, "environment names to create")

return appScaffoldCmd
}
1 change: 1 addition & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ func init() {
k3d.LocalCommandAlias(),
google.NewCommand(),
vultr.NewCommand(),
GenerateCommand(),
LaunchCommand(),
LetsEncryptCommand(),
TerraformCommand(),
Expand Down

0 comments on commit 2cce2ca

Please sign in to comment.