mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:17:32 +00:00
feat(cli): init cli (#3186)
* feat(cli): initilize cli * fix(config): allow multiple files * refactor(cli): constructor naming * go mod tidy * refactor: move code out of v2 package * chore: logging v0.1 * chore: remove old gitignore * fix func Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
30
cmd/admin/admin.go
Normal file
30
cmd/admin/admin.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package admin
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
|
||||
"github.com/caos/logging"
|
||||
"github.com/caos/zitadel/cmd/admin/initialise"
|
||||
"github.com/caos/zitadel/cmd/admin/setup"
|
||||
"github.com/caos/zitadel/cmd/admin/start"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func New() *cobra.Command {
|
||||
adminCMD := &cobra.Command{
|
||||
Use: "admin",
|
||||
Short: "The ZITADEL admin CLI let's you interact with your instance",
|
||||
Long: `The ZITADEL admin CLI let's you interact with your instance`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
logging.New().Info("hello world")
|
||||
},
|
||||
}
|
||||
|
||||
adminCMD.AddCommand(
|
||||
initialise.New(),
|
||||
setup.New(),
|
||||
start.New(),
|
||||
)
|
||||
|
||||
return adminCMD
|
||||
}
|
22
cmd/admin/initialise/init.go
Normal file
22
cmd/admin/initialise/init.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package initialise
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
|
||||
"github.com/caos/logging"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func New() *cobra.Command {
|
||||
return &cobra.Command{
|
||||
Use: "init",
|
||||
Short: "initialize ZITADEL instance",
|
||||
Long: `init sets up the minimum requirements to start ZITADEL.
|
||||
Prereqesits:
|
||||
- cockroachdb`,
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
logging.New().Info("hello world")
|
||||
return nil
|
||||
},
|
||||
}
|
||||
}
|
22
cmd/admin/setup/setup.go
Normal file
22
cmd/admin/setup/setup.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package setup
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
|
||||
"github.com/caos/logging"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func New() *cobra.Command {
|
||||
return &cobra.Command{
|
||||
Use: "setup",
|
||||
Short: "setup ZITADEL instance",
|
||||
Long: `sets up data to start ZITADEL.
|
||||
Requirements:
|
||||
- cockroachdb`,
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
logging.New().Info("hello world")
|
||||
return nil
|
||||
},
|
||||
}
|
||||
}
|
23
cmd/admin/start/start.go
Normal file
23
cmd/admin/start/start.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package start
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
|
||||
"github.com/caos/logging"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func New() *cobra.Command {
|
||||
return &cobra.Command{
|
||||
Use: "start",
|
||||
Short: "starts ZITADEL instance",
|
||||
Long: `starts ZITADEL.
|
||||
Requirements:
|
||||
- cockroachdb`,
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
logging.New().Info("hello world")
|
||||
logging.WithFields("field", 1).Info("hello world")
|
||||
return nil
|
||||
},
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user