summaryrefslogtreecommitdiffstats
path: root/cmd/deploy/main.go
diff options
context:
space:
mode:
authorbndw <ben@bdw.to>2026-01-23 21:19:50 -0800
committerbndw <ben@bdw.to>2026-01-23 21:19:50 -0800
commit1694ba1b8ad68e2d2ad21c1442c29b6f3f2c1632 (patch)
tree9411bc6b4b273263e31b33aa37dead47cdec4be4 /cmd/deploy/main.go
parentb5d97f633c960a826577fd80cb1d29e392dce34b (diff)
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
Diffstat (limited to 'cmd/deploy/main.go')
-rw-r--r--cmd/deploy/main.go30
1 files changed, 13 insertions, 17 deletions
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() {
16 switch command { 16 switch command {
17 case "init": 17 case "init":
18 runInit(os.Args[2:]) 18 runInit(os.Args[2:])
19 case "deploy":
20 runDeploy(os.Args[2:])
21 case "list": 19 case "list":
22 runList(os.Args[2:]) 20 runList(os.Args[2:])
23 case "remove": 21 case "rm", "remove":
24 runRemove(os.Args[2:]) 22 runRemove(os.Args[2:])
25 case "logs": 23 case "logs":
26 runLogs(os.Args[2:]) 24 runLogs(os.Args[2:])
@@ -35,9 +33,8 @@ func main() {
35 case "help", "--help", "-h": 33 case "help", "--help", "-h":
36 printUsage() 34 printUsage()
37 default: 35 default:
38 fmt.Fprintf(os.Stderr, "Unknown command: %s\n\n", command) 36 // Default action is deploy - pass all args including the first one
39 printUsage() 37 runDeploy(os.Args[1:])
40 os.Exit(1)
41 } 38 }
42} 39}
43 40
@@ -45,13 +42,13 @@ func printUsage() {
45 usage := `deploy - Deploy Go apps and static sites to a VPS with automatic HTTPS 42 usage := `deploy - Deploy Go apps and static sites to a VPS with automatic HTTPS
46 43
47USAGE: 44USAGE:
48 deploy <command> [flags] 45 deploy [flags] Deploy an app or static site
46 deploy <command> [flags] Run a subcommand
49 47
50COMMANDS: 48COMMANDS:
51 init Initialize a fresh VPS (one-time setup) 49 init Initialize a fresh VPS (one-time setup)
52 deploy Deploy a Go app or static site
53 list List all deployed apps and sites 50 list List all deployed apps and sites
54 remove Remove a deployment 51 rm Remove a deployment
55 logs View logs for a deployment 52 logs View logs for a deployment
56 status Check status of a deployment 53 status Check status of a deployment
57 restart Restart a deployment 54 restart Restart a deployment
@@ -59,24 +56,23 @@ COMMANDS:
59 webui Launch web UI to manage deployments 56 webui Launch web UI to manage deployments
60 57
61FLAGS: 58FLAGS:
62 Run 'deploy <command> -h' for command-specific flags 59 Run 'deploy -h' or 'deploy <command> -h' for flags
63 60
64EXAMPLES: 61EXAMPLES:
65 # Initialize VPS 62 # Initialize VPS (sets it as default host)
66 deploy init --host user@vps-ip 63 deploy init --host user@vps-ip
67 64
68 # Deploy Go app 65 # Deploy Go app
69 deploy deploy --host user@vps-ip --binary ./myapp --domain api.example.com 66 deploy --binary ./myapp --domain api.example.com
70 67
71 # Deploy static site 68 # Deploy static site
72 deploy deploy --host user@vps-ip --static --dir ./dist --domain example.com 69 deploy --static --dir ./dist --domain example.com
73 70
74 # List deployments 71 # List deployments
75 deploy list --host user@vps-ip 72 deploy list
76 73
77CONFIG FILE: 74 # View logs
78 Create ~/.config/deploy/config to set default host: 75 deploy logs myapp
79 host: user@your-vps-ip
80` 76`
81 fmt.Fprint(os.Stderr, usage) 77 fmt.Fprint(os.Stderr, usage)
82} 78}