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:
2026-04-30 11:31:43 +03:00
parent f0b723e35d
commit 877ac90574
5 changed files with 748 additions and 14 deletions

View File

@@ -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
}