diff options
| author | bndw <ben@bdw.to> | 2026-01-24 09:36:34 -0800 |
|---|---|---|
| committer | bndw <ben@bdw.to> | 2026-01-24 09:36:34 -0800 |
| commit | ef37850c7090493cf2b26d2e565511fe23cc9bfc (patch) | |
| tree | d9b494783b87ed670c1159b9da863bb062bc0601 | |
| parent | 758595a26cac53d4913527a5aa627e5cde632b3f (diff) | |
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
| -rw-r--r-- | README.md | 67 |
1 files changed, 33 insertions, 34 deletions
| @@ -28,8 +28,8 @@ go install ./cmd/deploy | |||
| 28 | ### 1. Initialize Your VPS (One-time) | 28 | ### 1. Initialize Your VPS (One-time) |
| 29 | 29 | ||
| 30 | ```bash | 30 | ```bash |
| 31 | # Initialize a fresh VPS | 31 | # Initialize a fresh VPS (this sets it as the default host) |
| 32 | deploy init --host user@your-vps-ip | 32 | deploy host init user@your-vps-ip |
| 33 | ``` | 33 | ``` |
| 34 | 34 | ||
| 35 | This will: | 35 | This will: |
| @@ -45,15 +45,15 @@ This will: | |||
| 45 | GOOS=linux GOARCH=amd64 go build -o myapp | 45 | GOOS=linux GOARCH=amd64 go build -o myapp |
| 46 | 46 | ||
| 47 | # Deploy it | 47 | # Deploy it |
| 48 | deploy deploy --host user@vps-ip --binary ./myapp --domain api.example.com | 48 | deploy --binary ./myapp --domain api.example.com |
| 49 | 49 | ||
| 50 | # With environment variables | 50 | # With environment variables |
| 51 | deploy deploy --host user@vps-ip --binary ./myapp --domain api.example.com \ | 51 | deploy --binary ./myapp --domain api.example.com \ |
| 52 | --env DB_HOST=localhost \ | 52 | --env DB_HOST=localhost \ |
| 53 | --env API_KEY=secret | 53 | --env API_KEY=secret |
| 54 | 54 | ||
| 55 | # Or from an env file | 55 | # Or from an env file |
| 56 | deploy deploy --host user@vps-ip --binary ./myapp --domain api.example.com \ | 56 | deploy --binary ./myapp --domain api.example.com \ |
| 57 | --env-file .env.production | 57 | --env-file .env.production |
| 58 | ``` | 58 | ``` |
| 59 | 59 | ||
| @@ -64,7 +64,7 @@ deploy deploy --host user@vps-ip --binary ./myapp --domain api.example.com \ | |||
| 64 | npm run build | 64 | npm run build |
| 65 | 65 | ||
| 66 | # Deploy it | 66 | # Deploy it |
| 67 | deploy deploy --host user@vps-ip --static --dir ./dist --domain example.com | 67 | deploy --static --dir ./dist --domain example.com |
| 68 | ``` | 68 | ``` |
| 69 | 69 | ||
| 70 | ## App Requirements | 70 | ## App Requirements |
| @@ -106,72 +106,72 @@ func main() { | |||
| 106 | 106 | ||
| 107 | ## Commands | 107 | ## Commands |
| 108 | 108 | ||
| 109 | ### Initialize VPS | 109 | ### Host Management |
| 110 | |||
| 110 | ```bash | 111 | ```bash |
| 111 | deploy init --host user@vps-ip | 112 | # Initialize a fresh VPS (one-time setup, sets as default) |
| 113 | deploy host init user@vps-ip | ||
| 114 | |||
| 115 | # Update system packages (apt update && apt upgrade) | ||
| 116 | deploy host update | ||
| 117 | |||
| 118 | # Check host status | ||
| 119 | deploy host status | ||
| 120 | |||
| 121 | # SSH into the host | ||
| 122 | deploy host ssh | ||
| 112 | ``` | 123 | ``` |
| 113 | 124 | ||
| 114 | ### Deploy App/Site | 125 | ### Deploy App/Site |
| 115 | ```bash | 126 | ```bash |
| 116 | # Go app | 127 | # Go app |
| 117 | deploy deploy --host user@vps-ip --binary ./myapp --domain api.example.com | 128 | deploy --binary ./myapp --domain api.example.com |
| 118 | 129 | ||
| 119 | # Static site | 130 | # Static site |
| 120 | deploy deploy --host user@vps-ip --static --dir ./dist --domain example.com | 131 | deploy --static --dir ./dist --domain example.com |
| 121 | 132 | ||
| 122 | # Custom name (defaults to binary/directory name) | 133 | # Custom name (defaults to binary/directory name) |
| 123 | deploy deploy --host user@vps-ip --name myapi --binary ./myapp --domain api.example.com | 134 | deploy --name myapi --binary ./myapp --domain api.example.com |
| 124 | ``` | 135 | ``` |
| 125 | 136 | ||
| 126 | ### List Deployments | 137 | ### List Deployments |
| 127 | ```bash | 138 | ```bash |
| 128 | deploy list --host user@vps-ip | 139 | deploy list |
| 129 | ``` | 140 | ``` |
| 130 | 141 | ||
| 131 | ### Manage Deployments | 142 | ### Manage Deployments |
| 132 | ```bash | 143 | ```bash |
| 133 | # View logs | 144 | # View logs |
| 134 | deploy logs myapp --host user@vps-ip | 145 | deploy logs myapp |
| 135 | 146 | ||
| 136 | # View status | 147 | # View status |
| 137 | deploy status myapp --host user@vps-ip | 148 | deploy status myapp |
| 138 | 149 | ||
| 139 | # Restart app | 150 | # Restart app |
| 140 | deploy restart myapp --host user@vps-ip | 151 | deploy restart myapp |
| 141 | 152 | ||
| 142 | # Remove deployment | 153 | # Remove deployment |
| 143 | deploy remove myapp --host user@vps-ip | 154 | deploy remove myapp |
| 144 | ``` | 155 | ``` |
| 145 | 156 | ||
| 146 | ### Environment Variables | 157 | ### Environment Variables |
| 147 | ```bash | 158 | ```bash |
| 148 | # View current env vars (secrets are masked) | 159 | # View current env vars (secrets are masked) |
| 149 | deploy env myapi --host user@vps-ip | 160 | deploy env list myapi |
| 150 | 161 | ||
| 151 | # Set env vars | 162 | # Set env vars |
| 152 | deploy env myapi --host user@vps-ip --set DB_HOST=localhost --set API_KEY=secret | 163 | deploy env set myapi DB_HOST=localhost API_KEY=secret |
| 153 | 164 | ||
| 154 | # Load from file | 165 | # Load from file |
| 155 | deploy env myapi --host user@vps-ip --file .env.production | 166 | deploy env set myapi -f .env.production |
| 156 | 167 | ||
| 157 | # Unset env var | 168 | # Unset env var |
| 158 | deploy env myapi --host user@vps-ip --unset API_KEY | 169 | deploy env unset myapi API_KEY |
| 159 | ``` | 170 | ``` |
| 160 | 171 | ||
| 161 | ## Configuration | 172 | ## Configuration |
| 162 | 173 | ||
| 163 | Create `~/.config/deploy/config` to avoid typing `--host` every time: | 174 | 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`. |
| 164 | |||
| 165 | ``` | ||
| 166 | host: user@your-vps-ip | ||
| 167 | ``` | ||
| 168 | |||
| 169 | Then you can omit the `--host` flag: | ||
| 170 | |||
| 171 | ```bash | ||
| 172 | deploy list | ||
| 173 | deploy deploy --binary ./myapp --domain api.example.com | ||
| 174 | ``` | ||
| 175 | 175 | ||
| 176 | ## How It Works | 176 | ## How It Works |
| 177 | 177 | ||
| @@ -186,8 +186,7 @@ deploy deploy --binary ./myapp --domain api.example.com | |||
| 186 | 186 | ||
| 187 | ### On Laptop | 187 | ### On Laptop |
| 188 | ``` | 188 | ``` |
| 189 | ~/.config/deploy/state.json # All deployment state | 189 | ~/.config/deploy/state.json # All deployment state (including default host) |
| 190 | ~/.config/deploy/config # Optional: default host | ||
| 191 | ``` | 190 | ``` |
| 192 | 191 | ||
| 193 | ### On VPS | 192 | ### On VPS |
