package main import ( "fmt" "os" ) func main() { if len(os.Args) < 2 { printUsage() os.Exit(1) } command := os.Args[1] switch command { case "init": runInit(os.Args[2:]) case "list": runList(os.Args[2:]) case "rm", "remove": runRemove(os.Args[2:]) case "logs": runLogs(os.Args[2:]) case "status": runStatus(os.Args[2:]) case "restart": runRestart(os.Args[2:]) case "env": runEnv(os.Args[2:]) case "webui": runWebUI(os.Args[2:]) case "vps": runVPS(os.Args[2:]) case "vps-update": runUpdate(os.Args[2:]) case "vps-ssh": runSSH(os.Args[2:]) case "help", "--help", "-h": printUsage() default: // Default action is deploy - pass all args including the first one runDeploy(os.Args[1:]) } } func printUsage() { usage := `deploy - Deploy Go apps and static sites to a VPS with automatic HTTPS USAGE: deploy [flags] Deploy an app or static site deploy [flags] Run a subcommand COMMANDS: init Initialize a fresh VPS (one-time setup) list List all deployed apps and sites rm Remove a deployment logs View logs for a deployment status Check status of a deployment restart Restart a deployment env Manage environment variables vps Show VPS health (uptime, disk, memory, load) vps-update Update VPS packages (apt update && upgrade) vps-ssh Open an interactive SSH session webui Launch web UI to manage deployments FLAGS: Run 'deploy -h' or 'deploy -h' for flags EXAMPLES: # Initialize VPS (sets it as default host) deploy init --host user@vps-ip # Deploy Go app deploy --binary ./myapp --domain api.example.com # Deploy static site deploy --static --dir ./dist --domain example.com # List deployments deploy list # View logs deploy logs myapp # Check VPS health deploy vps # Update VPS packages deploy vps-update ` fmt.Fprint(os.Stderr, usage) }