Skip to content

Commit 51dca40

Browse files
committed
feat: register pods and manager subcommands directly under root and rename manager serve to manager start
1 parent 17d965c commit 51dca40

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

cmd/devenv/manager.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ type ManagerServerConfig struct {
8787
var mgrServerConfig ManagerServerConfig
8888

8989
var managerServerCmd = &cobra.Command{
90-
Use: "serve",
90+
Use: "start",
9191
Short: "Start the DevENV Manager HTTP API server",
9292
Long: `Start the DevENV Manager HTTP API server.
9393
@@ -102,9 +102,6 @@ Clients must provide a Bearer token in the Authorization header.`,
102102
}
103103

104104
func init() {
105-
// Add manager command to root
106-
rootCmd.AddCommand(managerCmd)
107-
108105
// --- Pods Command Init ---
109106
managerPodsListCmd.Flags().StringVarP(&mgrPodsNamespace, "namespace", "n", "default", "Kubernetes namespace")
110107
managerPodsListCmd.Flags().BoolVarP(&mgrPodsAllNamespace, "all-namespaces", "A", false, "List pods across all namespaces")

cmd/devenv/pods.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,6 @@ Examples:
103103
}
104104

105105
func init() {
106-
// Add pods command to root
107-
rootCmd.AddCommand(podsCmd)
108106

109107
// Add pods command flags
110108
podsListCmd.Flags().StringVarP(&podsNamespace, "namespace", "n", "", "Kubernetes namespace (default: default)")

cmd/devenv/root.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ func init() {
2424
rootCmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "Enable verbose output")
2525

2626
// Add subcommands to root
27+
rootCmd.AddCommand(authCmd)
2728
rootCmd.AddCommand(generateCmd)
28-
rootCmd.AddCommand(versionCmd)
29+
rootCmd.AddCommand(managerCmd)
30+
rootCmd.AddCommand(podsCmd)
2931
rootCmd.AddCommand(validateCmd)
30-
rootCmd.AddCommand(authCmd)
32+
rootCmd.AddCommand(versionCmd)
3133
}

0 commit comments

Comments
 (0)