@zerodeploy/cli 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +246 -16
  2. package/dist/cli.js +1527 -179
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -24,7 +24,7 @@ zerodeploy login
24
24
  zerodeploy org create "My Company"
25
25
 
26
26
  # 3. Create a site
27
- zerodeploy site create my-company "My Website" --subdomain my-website
27
+ zerodeploy site create my-company "My Website"
28
28
 
29
29
  # 4. Deploy your site
30
30
  zerodeploy deploy my-website --org my-company --dir ./dist
@@ -60,6 +60,17 @@ Display current logged-in user information.
60
60
  zerodeploy whoami
61
61
  ```
62
62
 
63
+ #### `zerodeploy usage`
64
+
65
+ Display current usage and plan limits with visual progress bars.
66
+
67
+ ```bash
68
+ zerodeploy usage
69
+ ```
70
+
71
+ **Options:**
72
+ - `--json` - Output as JSON for scripting
73
+
63
74
  ### Organizations
64
75
 
65
76
  #### `zerodeploy org list`
@@ -96,44 +107,93 @@ List all sites in an organization.
96
107
  zerodeploy site list my-company
97
108
  ```
98
109
 
99
- #### `zerodeploy site create <orgSlug> <name> --subdomain <subdomain>`
110
+ #### `zerodeploy site create <orgSlug> <name>`
100
111
 
101
- Create a new site in an organization.
112
+ Create a new site in an organization. The subdomain is auto-generated from the name.
102
113
 
103
114
  **Options:**
104
- - `--subdomain <subdomain>` - Subdomain for the site (required, globally unique)
105
115
  - `--repo <owner/repo>` - Link to a GitHub repository
106
116
 
107
117
  ```bash
108
118
  # Create a site
109
- zerodeploy site create my-company "My Website" --subdomain my-website
119
+ zerodeploy site create my-company "My Website"
110
120
 
111
121
  # Create a site linked to a GitHub repo
112
- zerodeploy site create my-company "Dashboard" --subdomain dashboard --repo company/monorepo
122
+ zerodeploy site create my-company "Dashboard" --repo company/monorepo
113
123
  ```
114
124
 
115
125
  Your site will be available at `https://<subdomain>.zerodeploy.app`
116
126
 
127
+ #### `zerodeploy site rename <siteSlug> <newName> --org <orgSlug>`
128
+
129
+ Rename a site's display name.
130
+
131
+ ```bash
132
+ zerodeploy site rename my-website "New Website Name" --org my-company
133
+ ```
134
+
135
+ Note: This changes the display name, not the slug or subdomain.
136
+
137
+ #### `zerodeploy site link <orgSlug> <siteSlug> <repo>`
138
+
139
+ Link a site to a GitHub repository.
140
+
141
+ ```bash
142
+ zerodeploy site link my-company dashboard company/monorepo
143
+ ```
144
+
145
+ #### `zerodeploy site unlink <orgSlug> <siteSlug>`
146
+
147
+ Remove the GitHub repository link from a site.
148
+
149
+ ```bash
150
+ zerodeploy site unlink my-company dashboard
151
+ ```
152
+
153
+ #### `zerodeploy site subdomain <orgSlug> <siteSlug> <subdomain>`
154
+
155
+ Update the subdomain for a site.
156
+
157
+ ```bash
158
+ zerodeploy site subdomain my-company my-website new-subdomain
159
+ ```
160
+
161
+ After updating, your site will be accessible at `https://new-subdomain.zerodeploy.app`.
162
+
117
163
  #### `zerodeploy site delete <siteSlug> --org <orgSlug>`
118
164
 
119
165
  Delete a site and all its deployments.
120
166
 
167
+ **Options:**
168
+ - `--force` - Skip confirmation prompt
169
+
121
170
  ```bash
122
171
  zerodeploy site delete my-website --org my-company
123
172
  ```
124
173
 
125
174
  ### Deployment
126
175
 
127
- #### `zerodeploy deploy <siteSlug> [options]`
176
+ #### `zerodeploy deploy [siteSlug] [options]`
128
177
 
129
- Deploy a directory to a site.
178
+ Deploy a directory to a site. If using a `zerodeploy.json` config file, site and org can be omitted.
130
179
 
131
180
  **Options:**
132
- - `--org <orgSlug>` - Organization slug (required)
181
+ - `--org <orgSlug>` - Organization slug (required, or from config)
133
182
  - `--dir <directory>` - Directory to deploy (default: auto-detect)
134
183
  - `--build` - Run build command before deploying
184
+ - `--no-build` - Skip build step
135
185
  - `--build-command <cmd>` - Custom build command
136
186
  - `--install` - Run install command before building
187
+ - `--preview` - Deploy without setting as current (preview only)
188
+ - `--no-verify` - Skip deployment verification
189
+ - `--no-auto-rollback` - Disable automatic rollback on verification failure
190
+
191
+ **CI/CD Options:**
192
+ - `--pr <number>` - PR number
193
+ - `--pr-title <title>` - PR title
194
+ - `--commit <sha>` - Commit SHA
195
+ - `--branch <branch>` - Branch name
196
+ - `--github-output` - Output deployment info in GitHub Actions format
137
197
 
138
198
  ```bash
139
199
  # Deploy specific directory
@@ -147,18 +207,34 @@ zerodeploy deploy my-website --org my-company --build
147
207
 
148
208
  # Install dependencies, build, and deploy
149
209
  zerodeploy deploy my-website --org my-company --install --build
210
+
211
+ # Deploy as preview (doesn't go live)
212
+ zerodeploy deploy my-website --org my-company --preview
150
213
  ```
151
214
 
152
215
  Output:
153
216
  ```
154
217
  Deploying: ./dist
155
218
  Found 42 files (1.2 MB)
156
- Uploading files...
157
- [100%] 42/42 files
219
+ Uploading...
220
+ Finalizing...
221
+ Verifying...
158
222
 
159
223
  Deployment successful!
160
- URL: https://my-website.zerodeploy.app
161
- Preview: https://019b1234-my-website.zerodeploy.app
224
+ URL: https://my-website.zerodeploy.app (verified)
225
+ Preview: https://abc12345-my-website.zerodeploy.app
226
+ ```
227
+
228
+ #### `zerodeploy deploy promote <deploymentId>`
229
+
230
+ Promote a preview deployment to production.
231
+
232
+ ```bash
233
+ # Promote using short ID (first 8 chars)
234
+ zerodeploy deploy promote abc12345
235
+
236
+ # Or use full deployment ID
237
+ zerodeploy deploy promote 019b1234-5678-90ab-cdef-1234567890ab
162
238
  ```
163
239
 
164
240
  #### `zerodeploy deployments list <siteSlug> --org <orgSlug>`
@@ -214,6 +290,145 @@ Delete a deploy token.
214
290
  zerodeploy token delete 019b1234 --org my-company --site my-website
215
291
  ```
216
292
 
293
+ ### Custom Domains
294
+
295
+ Connect your own domain to any ZeroDeploy site with automatic SSL.
296
+
297
+ #### `zerodeploy domain add <domain> --org <org> --site <site>`
298
+
299
+ Add a custom domain to a site. Returns DNS verification instructions.
300
+
301
+ ```bash
302
+ zerodeploy domain add www.example.com --org my-company --site my-website
303
+ ```
304
+
305
+ #### `zerodeploy domain verify <domain> --org <org> --site <site>`
306
+
307
+ Verify domain ownership after adding the TXT record to your DNS.
308
+
309
+ ```bash
310
+ zerodeploy domain verify www.example.com --org my-company --site my-website
311
+ ```
312
+
313
+ #### `zerodeploy domain list --org <org> --site <site>`
314
+
315
+ List all custom domains for a site.
316
+
317
+ ```bash
318
+ zerodeploy domain list --org my-company --site my-website
319
+ ```
320
+
321
+ #### `zerodeploy domain remove <domain> --org <org> --site <site>`
322
+
323
+ Remove a custom domain from a site.
324
+
325
+ ```bash
326
+ zerodeploy domain remove www.example.com --org my-company --site my-website
327
+ ```
328
+
329
+ #### `zerodeploy domain redirect <domain> --org <org> --site <site> --mode <mode>`
330
+
331
+ Set redirect mode for a custom domain. This allows automatic redirects between www and apex (non-www) domains.
332
+
333
+ **Options:**
334
+ - `--mode <mode>` - Redirect mode: `none`, `www_to_apex`, or `apex_to_www`
335
+
336
+ ```bash
337
+ # Redirect www.example.com to example.com
338
+ zerodeploy domain redirect example.com --org my-company --site my-website --mode www_to_apex
339
+
340
+ # Redirect example.com to www.example.com
341
+ zerodeploy domain redirect www.example.com --org my-company --site my-website --mode apex_to_www
342
+
343
+ # Disable redirects
344
+ zerodeploy domain redirect example.com --org my-company --site my-website --mode none
345
+ ```
346
+
347
+ **Custom Domain Setup:**
348
+
349
+ 1. Add the domain: `zerodeploy domain add www.example.com --org my-org --site my-site`
350
+ 2. Add the TXT record to your DNS (shown in output)
351
+ 3. Verify ownership: `zerodeploy domain verify www.example.com --org my-org --site my-site`
352
+ 4. Add the CNAME record to your DNS (shown in output)
353
+ 5. Your site is now live at `https://www.example.com`
354
+
355
+ ### Forms
356
+
357
+ Collect form submissions from your static sites without a backend. Get email notifications when forms are submitted.
358
+
359
+ #### `zerodeploy form list --org <org> --site <site>`
360
+
361
+ List all forms for a site with submission counts.
362
+
363
+ ```bash
364
+ zerodeploy form list --org my-company --site my-website
365
+ ```
366
+
367
+ #### `zerodeploy form export <name> --org <org> --site <site>`
368
+
369
+ Export form submissions as CSV.
370
+
371
+ **Options:**
372
+ - `-o, --output <file>` - Output file path (default: `<name>-submissions.csv`)
373
+
374
+ ```bash
375
+ # Export to default file
376
+ zerodeploy form export contact --org my-company --site my-website
377
+
378
+ # Export to custom file
379
+ zerodeploy form export contact --org my-company --site my-website -o leads.csv
380
+ ```
381
+
382
+ #### `zerodeploy form delete <name> --org <org> --site <site>`
383
+
384
+ Delete a form and all its submissions.
385
+
386
+ **Options:**
387
+ - `--force` - Skip confirmation prompt
388
+
389
+ ```bash
390
+ zerodeploy form delete contact --org my-company --site my-website
391
+ ```
392
+
393
+ #### `zerodeploy form notify <name> --org <org> --site <site>`
394
+
395
+ Configure email notifications for form submissions.
396
+
397
+ **Options:**
398
+ - `--email <email>` - Email address to receive notifications
399
+ - `--disable` - Disable email notifications
400
+
401
+ ```bash
402
+ # Enable notifications
403
+ zerodeploy form notify contact --org my-company --site my-website --email alerts@example.com
404
+
405
+ # Disable notifications
406
+ zerodeploy form notify contact --org my-company --site my-website --disable
407
+ ```
408
+
409
+ ### Account
410
+
411
+ #### `zerodeploy account email <email>`
412
+
413
+ Set or update your email address for deployment notifications.
414
+
415
+ ```bash
416
+ zerodeploy account email you@example.com
417
+ ```
418
+
419
+ #### `zerodeploy account delete`
420
+
421
+ Permanently delete your account and all associated data.
422
+
423
+ **Options:**
424
+ - `--force` - Skip confirmation prompts
425
+
426
+ ```bash
427
+ zerodeploy account delete
428
+ ```
429
+
430
+ **Warning:** This permanently deletes your account, all organizations, sites, deployments, and custom domains.
431
+
217
432
  ## Configuration File
218
433
 
219
434
  Create a `zerodeploy.json` in your project root:
@@ -222,21 +437,36 @@ Create a `zerodeploy.json` in your project root:
222
437
  zerodeploy init --org my-company --site my-website
223
438
  ```
224
439
 
225
- This creates:
440
+ The CLI auto-detects your framework and creates an appropriate config:
226
441
 
227
442
  ```json
228
443
  {
229
444
  "org": "my-company",
230
- "site": "my-website"
445
+ "site": "my-website",
446
+ "dir": "dist",
447
+ "build": "npm run build"
231
448
  }
232
449
  ```
233
450
 
451
+ **Config Options:**
452
+
453
+ | Field | Description |
454
+ |-------|-------------|
455
+ | `org` | Organization slug |
456
+ | `site` | Site slug |
457
+ | `dir` | Build output directory |
458
+ | `build` | Build command (used with `--build` flag) |
459
+ | `install` | Install command (used with `--install` flag) |
460
+
234
461
  Then deploy with just:
235
462
 
236
463
  ```bash
237
- zerodeploy deploy
464
+ zerodeploy deploy # deploy only
465
+ zerodeploy deploy --build # build + deploy
238
466
  ```
239
467
 
468
+ CLI flags always take precedence over config values.
469
+
240
470
  ## Deployed Sites
241
471
 
242
472
  ### URLs