From 1694ba1b8ad68e2d2ad21c1442c29b6f3f2c1632 Mon Sep 17 00:00:00 2001 From: bndw Date: Fri, 23 Jan 2026 21:19:50 -0800 Subject: Make deploy the default action and require --binary - Remove "deploy" subcommand, deploy is now the default action - Require --binary flag explicitly (no auto-discovery) - Add "rm" as alias for "remove" - Update help text --- cmd/deploy/main.go | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) (limited to 'cmd/deploy/main.go') diff --git a/cmd/deploy/main.go b/cmd/deploy/main.go index 1589af3..e86eff7 100644 --- a/cmd/deploy/main.go +++ b/cmd/deploy/main.go @@ -16,11 +16,9 @@ func main() { switch command { case "init": runInit(os.Args[2:]) - case "deploy": - runDeploy(os.Args[2:]) case "list": runList(os.Args[2:]) - case "remove": + case "rm", "remove": runRemove(os.Args[2:]) case "logs": runLogs(os.Args[2:]) @@ -35,9 +33,8 @@ func main() { case "help", "--help", "-h": printUsage() default: - fmt.Fprintf(os.Stderr, "Unknown command: %s\n\n", command) - printUsage() - os.Exit(1) + // Default action is deploy - pass all args including the first one + runDeploy(os.Args[1:]) } } @@ -45,13 +42,13 @@ func printUsage() { usage := `deploy - Deploy Go apps and static sites to a VPS with automatic HTTPS USAGE: - deploy [flags] + deploy [flags] Deploy an app or static site + deploy [flags] Run a subcommand COMMANDS: init Initialize a fresh VPS (one-time setup) - deploy Deploy a Go app or static site list List all deployed apps and sites - remove Remove a deployment + rm Remove a deployment logs View logs for a deployment status Check status of a deployment restart Restart a deployment @@ -59,24 +56,23 @@ COMMANDS: webui Launch web UI to manage deployments FLAGS: - Run 'deploy -h' for command-specific flags + Run 'deploy -h' or 'deploy -h' for flags EXAMPLES: - # Initialize VPS + # Initialize VPS (sets it as default host) deploy init --host user@vps-ip # Deploy Go app - deploy deploy --host user@vps-ip --binary ./myapp --domain api.example.com + deploy --binary ./myapp --domain api.example.com # Deploy static site - deploy deploy --host user@vps-ip --static --dir ./dist --domain example.com + deploy --static --dir ./dist --domain example.com # List deployments - deploy list --host user@vps-ip + deploy list -CONFIG FILE: - Create ~/.config/deploy/config to set default host: - host: user@your-vps-ip + # View logs + deploy logs myapp ` fmt.Fprint(os.Stderr, usage) } -- cgit v1.2.3