feat(cli): add comprehensive command suite
+ Adds new commands for managing boxes, environment variables, and running the server. * The command structure is greatly expanded to improve user experience and coverage for core service functionalities.
This commit is contained in:
17
cmd/main.go
17
cmd/main.go
@@ -5,8 +5,6 @@ import (
|
||||
"os"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"warpbox/lib/server"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -23,17 +21,8 @@ func newRootCommand() *cobra.Command {
|
||||
Long: "WarpBox provides commands for running and managing the WarpBox service.",
|
||||
}
|
||||
|
||||
var addr string
|
||||
runCmd := &cobra.Command{
|
||||
Use: "run",
|
||||
Short: "Run the HTTP server",
|
||||
Long: "Run the WarpBox HTTP server. The root endpoint responds with ok.",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
return server.Run(addr)
|
||||
},
|
||||
}
|
||||
runCmd.Flags().StringVar(&addr, "addr", ":8080", "HTTP server address")
|
||||
|
||||
rootCmd.AddCommand(runCmd)
|
||||
rootCmd.AddCommand(newRunCommand())
|
||||
rootCmd.AddCommand(newBoxCommand())
|
||||
rootCmd.AddCommand(newEnvCommand())
|
||||
return rootCmd
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user