@shipstatic/ship 0.8.0 → 0.8.2

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.
package/README.md CHANGED
@@ -15,14 +15,29 @@ npm install @shipstatic/ship
15
15
  ## CLI Usage
16
16
 
17
17
  ```bash
18
- # Deploy a directory (shortcut)
18
+ # Deploy a directory
19
19
  ship ./dist
20
20
 
21
21
  # Deploy with labels
22
22
  ship ./dist --label production --label v1.0.0
23
23
 
24
- # Disable automatic detection
25
- ship ./dist --no-path-detect --no-spa-detect
24
+ # Deploy and link to a domain in one pipe
25
+ ship ./dist -q | ship domains set www.example.com
26
+ ```
27
+
28
+ ### Composability
29
+
30
+ The `-q` flag outputs only the resource identifier — perfect for piping and scripting:
31
+
32
+ ```bash
33
+ # Deploy and link domain
34
+ ship ./dist -q | ship domains set www.example.com
35
+
36
+ # Deploy and open in browser
37
+ open https://$(ship ./dist -q)
38
+
39
+ # Batch operations
40
+ ship deployments list -q | xargs -I{} ship deployments remove {} -q
26
41
  ```
27
42
 
28
43
  ### Deployments
@@ -31,22 +46,22 @@ ship ./dist --no-path-detect --no-spa-detect
31
46
  ship deployments list
32
47
  ship deployments upload <path> # Upload from file or directory
33
48
  ship deployments upload <path> --label production # Upload with labels
34
- ship deployments get <id>
35
- ship deployments set <id> --label production # Update labels
36
- ship deployments remove <id>
49
+ ship deployments get <deployment>
50
+ ship deployments set <deployment> --label production
51
+ ship deployments remove <deployment>
37
52
  ```
38
53
 
39
54
  ### Domains
40
55
 
41
56
  ```bash
42
57
  ship domains list
43
- ship domains set staging # Reserve domain (no deployment yet)
44
- ship domains set staging <deployment-id> # Link domain to deployment
45
- ship domains set staging --label production # Update labels only
46
- ship domains get staging
58
+ ship domains set www.example.com # Reserve domain (no deployment yet)
59
+ ship domains set www.example.com <deployment> # Link domain to deployment
60
+ ship domains set www.example.com --label prod # Update labels only
61
+ ship domains get www.example.com
47
62
  ship domains validate www.example.com # Check if domain is valid and available
48
63
  ship domains verify www.example.com # Trigger DNS verification
49
- ship domains remove staging
64
+ ship domains remove www.example.com
50
65
  ```
51
66
 
52
67
  ### Tokens
@@ -60,8 +75,7 @@ ship tokens remove <token>
60
75
  ### Account & Setup
61
76
 
62
77
  ```bash
63
- ship whoami # Get current account (alias for account get)
64
- ship account get
78
+ ship whoami
65
79
  ship config # Create or update ~/.shiprc
66
80
  ship ping # Check API connectivity
67
81
  ```
@@ -80,10 +94,11 @@ ship completion uninstall
80
94
  --deploy-token <token> Deploy token for single-use deployments
81
95
  --config <file> Custom config file path
82
96
  --label <label> Add label (repeatable)
83
- --no-path-detect Disable automatic path optimization and flattening
84
- --no-spa-detect Disable automatic SPA detection and configuration
97
+ --no-path-detect Disable automatic path optimization
98
+ --no-spa-detect Disable automatic SPA detection
85
99
  --no-color Disable colored output
86
100
  --json Output results in JSON format
101
+ -q, --quiet Output only the resource identifier
87
102
  --version Show version information
88
103
  ```
89
104
 
@@ -107,12 +122,12 @@ const deployment = await ship.deployments.upload('./dist', {
107
122
  });
108
123
 
109
124
  // Manage domains
110
- await ship.domains.set('staging', { deployment: deployment.id });
125
+ await ship.domains.set('www.example.com', { deployment: deployment.deployment });
111
126
  await ship.domains.list();
112
127
 
113
128
  // Update labels
114
- await ship.deployments.set(deployment.id, { labels: ['production', 'v1.0'] });
115
- await ship.domains.set('staging', { labels: ['live'] });
129
+ await ship.deployments.set(deployment.deployment, { labels: ['production', 'v1.0'] });
130
+ await ship.domains.set('www.example.com', { labels: ['live'] });
116
131
  ```
117
132
 
118
133
  ## Browser Usage
@@ -187,11 +202,11 @@ ship.setDeployToken(token) // Set deploy token after construction
187
202
  ### Deployments
188
203
 
189
204
  ```typescript
190
- ship.deployments.upload(input, options?) // Upload new deployment
191
- ship.deployments.list() // List all deployments
192
- ship.deployments.get(id) // Get deployment details
193
- ship.deployments.set(id, { labels }) // Update deployment labels
194
- ship.deployments.remove(id) // Delete deployment
205
+ ship.deployments.upload(input, options?) // Upload new deployment
206
+ ship.deployments.list() // List all deployments
207
+ ship.deployments.get(deployment) // Get deployment details
208
+ ship.deployments.set(deployment, { labels }) // Update deployment labels
209
+ ship.deployments.remove(deployment) // Delete deployment
195
210
  ```
196
211
 
197
212
  ### Domains
@@ -228,19 +243,19 @@ ship.account.get() // Get current account
228
243
 
229
244
  ```typescript
230
245
  // Reserve domain (no deployment yet)
231
- ship.domains.set('staging');
246
+ ship.domains.set('www.example.com');
232
247
 
233
248
  // Link domain to deployment
234
- ship.domains.set('staging', { deployment: 'abc123' });
249
+ ship.domains.set('www.example.com', { deployment: 'happy-cat-abc1234.shipstatic.com' });
235
250
 
236
251
  // Switch to a different deployment (atomic)
237
- ship.domains.set('staging', { deployment: 'xyz789' });
252
+ ship.domains.set('www.example.com', { deployment: 'other-deploy-xyz7890.shipstatic.com' });
238
253
 
239
254
  // Update labels only (deployment preserved)
240
- ship.domains.set('staging', { labels: ['prod', 'v2'] });
255
+ ship.domains.set('www.example.com', { labels: ['prod', 'v2'] });
241
256
 
242
257
  // Update both
243
- ship.domains.set('staging', { deployment: 'abc123', labels: ['prod'] });
258
+ ship.domains.set('www.example.com', { deployment: 'happy-cat-abc1234.shipstatic.com', labels: ['prod'] });
244
259
  ```
245
260
 
246
261
  **No unlinking:** Once a domain is linked, `{ deployment: null }` returns a 400 error. To take a site offline, deploy a maintenance page. To clean up, delete the domain.
@@ -248,8 +263,8 @@ ship.domains.set('staging', { deployment: 'abc123', labels: ['prod'] });
248
263
  **Domain format:** Domain names are FQDNs. The SDK accepts any format (case-insensitive, Unicode) — the API normalizes:
249
264
 
250
265
  ```typescript
251
- ship.domains.set('Example.COM', { deployment: 'abc' }); // → normalized to 'example.com'
252
- ship.domains.set('münchen.de', { deployment: 'abc' }); // → Unicode supported
266
+ ship.domains.set('WWW.Example.COM'); // → normalized to 'www.example.com'
267
+ ship.domains.set('www.münchen.de'); // → Unicode supported
253
268
  ```
254
269
 
255
270
  ### Deploy Options
@@ -263,7 +278,6 @@ ship.deploy('./dist', {
263
278
  spaDetect?: boolean, // Auto-detect SPA (default: true)
264
279
  maxConcurrency?: number, // Concurrent uploads (default: 4)
265
280
  timeout?: number, // Request timeout (ms)
266
- subdomain?: string, // Suggested subdomain
267
281
  via?: string, // Client identifier (e.g. 'sdk', 'cli')
268
282
  apiKey?: string, // Per-request API key override
269
283
  deployToken?: string, // Per-request deploy token override
package/SKILL.md CHANGED
@@ -40,10 +40,17 @@ Alternative: set the `SHIP_API_KEY` environment variable or pass `--api-key` per
40
40
  ```bash
41
41
  ship ./dist
42
42
  ship ./dist --label production --label v1.0
43
- ship ./dist --json # Returns {"deployment": "<id>", "url": "https://..."}
43
+ ship ./dist --json # Returns {"deployment": "happy-cat-abc1234.shipstatic.com", ...}
44
44
  ```
45
45
 
46
- ## Workflow 2 — Reserve a Domain
46
+ ## Workflow 2 — Deploy and Link Domain
47
+
48
+ ```bash
49
+ # Deploy and link in one pipe
50
+ ship ./dist -q | ship domains set www.example.com
51
+ ```
52
+
53
+ ## Workflow 3 — Reserve a Domain
47
54
 
48
55
  ```bash
49
56
  # Pre-flight check
@@ -53,21 +60,21 @@ ship domains validate www.example.com
53
60
  ship domains set www.example.com
54
61
 
55
62
  # Or reserve an internal subdomain (instant, no DNS)
56
- ship domains set my-site
63
+ ship domains set my-site.shipstatic.com
57
64
  ```
58
65
 
59
66
  Internal domains (`my-site.shipstatic.com`) are free and instant. Custom domains require DNS configuration — the CLI prints the required records.
60
67
 
61
68
  **Apex domains are not supported.** Always use a subdomain: `www.example.com`, not `example.com`.
62
69
 
63
- ## Workflow 3 — Link Domain to Deployment
70
+ ## Workflow 4 — Link Domain to Deployment
64
71
 
65
72
  ```bash
66
73
  # Link domain to a deployment
67
- ship domains set www.example.com <deployment-id>
74
+ ship domains set www.example.com <deployment>
68
75
 
69
76
  # Switch to a different deployment (instant rollback)
70
- ship domains set www.example.com <other-deployment-id>
77
+ ship domains set www.example.com <other-deployment>
71
78
 
72
79
  # For custom domains: verify DNS after configuring records
73
80
  ship domains verify www.example.com
@@ -78,9 +85,9 @@ ship domains verify www.example.com
78
85
  ```bash
79
86
  # Deployments
80
87
  ship deployments list
81
- ship deployments get <id>
82
- ship deployments set <id> --label production
83
- ship deployments remove <id>
88
+ ship deployments get <deployment>
89
+ ship deployments set <deployment> --label production
90
+ ship deployments remove <deployment>
84
91
 
85
92
  # Domains
86
93
  ship domains list
@@ -94,4 +101,4 @@ ship whoami
94
101
  ship ping
95
102
  ```
96
103
 
97
- Use `--json` on any command for machine-readable output.
104
+ Use `--json` on any command for machine-readable output. Use `-q` for the key identifier only.