From ef37850c7090493cf2b26d2e565511fe23cc9bfc Mon Sep 17 00:00:00 2001 From: bndw Date: Sat, 24 Jan 2026 09:36:34 -0800 Subject: Update README for new command structure - Commands now use host subcommand (deploy host init, update, ssh, status) - Remove --host flag from examples (default host set on init) - Update env commands to new subcommand syntax - Simplify configuration section --- README.md | 67 +++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 33 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 8125bc9..a2253c1 100644 --- a/README.md +++ b/README.md @@ -28,8 +28,8 @@ go install ./cmd/deploy ### 1. Initialize Your VPS (One-time) ```bash -# Initialize a fresh VPS -deploy init --host user@your-vps-ip +# Initialize a fresh VPS (this sets it as the default host) +deploy host init user@your-vps-ip ``` This will: @@ -45,15 +45,15 @@ This will: GOOS=linux GOARCH=amd64 go build -o myapp # Deploy it -deploy deploy --host user@vps-ip --binary ./myapp --domain api.example.com +deploy --binary ./myapp --domain api.example.com # With environment variables -deploy deploy --host user@vps-ip --binary ./myapp --domain api.example.com \ +deploy --binary ./myapp --domain api.example.com \ --env DB_HOST=localhost \ --env API_KEY=secret # Or from an env file -deploy deploy --host user@vps-ip --binary ./myapp --domain api.example.com \ +deploy --binary ./myapp --domain api.example.com \ --env-file .env.production ``` @@ -64,7 +64,7 @@ deploy deploy --host user@vps-ip --binary ./myapp --domain api.example.com \ npm run build # Deploy it -deploy deploy --host user@vps-ip --static --dir ./dist --domain example.com +deploy --static --dir ./dist --domain example.com ``` ## App Requirements @@ -106,72 +106,72 @@ func main() { ## Commands -### Initialize VPS +### Host Management + ```bash -deploy init --host user@vps-ip +# Initialize a fresh VPS (one-time setup, sets as default) +deploy host init user@vps-ip + +# Update system packages (apt update && apt upgrade) +deploy host update + +# Check host status +deploy host status + +# SSH into the host +deploy host ssh ``` ### Deploy App/Site ```bash # Go app -deploy deploy --host user@vps-ip --binary ./myapp --domain api.example.com +deploy --binary ./myapp --domain api.example.com # Static site -deploy deploy --host user@vps-ip --static --dir ./dist --domain example.com +deploy --static --dir ./dist --domain example.com # Custom name (defaults to binary/directory name) -deploy deploy --host user@vps-ip --name myapi --binary ./myapp --domain api.example.com +deploy --name myapi --binary ./myapp --domain api.example.com ``` ### List Deployments ```bash -deploy list --host user@vps-ip +deploy list ``` ### Manage Deployments ```bash # View logs -deploy logs myapp --host user@vps-ip +deploy logs myapp # View status -deploy status myapp --host user@vps-ip +deploy status myapp # Restart app -deploy restart myapp --host user@vps-ip +deploy restart myapp # Remove deployment -deploy remove myapp --host user@vps-ip +deploy remove myapp ``` ### Environment Variables ```bash # View current env vars (secrets are masked) -deploy env myapi --host user@vps-ip +deploy env list myapi # Set env vars -deploy env myapi --host user@vps-ip --set DB_HOST=localhost --set API_KEY=secret +deploy env set myapi DB_HOST=localhost API_KEY=secret # Load from file -deploy env myapi --host user@vps-ip --file .env.production +deploy env set myapi -f .env.production # Unset env var -deploy env myapi --host user@vps-ip --unset API_KEY +deploy env unset myapi API_KEY ``` ## Configuration -Create `~/.config/deploy/config` to avoid typing `--host` every time: - -``` -host: user@your-vps-ip -``` - -Then you can omit the `--host` flag: - -```bash -deploy list -deploy deploy --binary ./myapp --domain api.example.com -``` +The host you initialize becomes the default, so you don't need to specify `--host` for every command. The default host is stored in `~/.config/deploy/state.json`. ## How It Works @@ -186,8 +186,7 @@ deploy deploy --binary ./myapp --domain api.example.com ### On Laptop ``` -~/.config/deploy/state.json # All deployment state -~/.config/deploy/config # Optional: default host +~/.config/deploy/state.json # All deployment state (including default host) ``` ### On VPS -- cgit v1.2.3