@godaddy/cli 0.1.0 → 0.2.0
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 +61 -360
- package/dist/cli.js +262 -201
- package/dist/cli.js.map +4 -4
- package/package.json +10 -3
package/README.md
CHANGED
|
@@ -1,400 +1,101 @@
|
|
|
1
1
|
# GoDaddy CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Agent-first CLI for interacting with GoDaddy Developer Platform.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
# Install the CLI globally from npm
|
|
9
8
|
npm install -g @godaddy/cli
|
|
10
|
-
|
|
11
|
-
# Verify installation
|
|
12
9
|
godaddy --help
|
|
13
10
|
```
|
|
14
11
|
|
|
15
|
-
##
|
|
12
|
+
## Output Contract
|
|
16
13
|
|
|
17
|
-
|
|
18
|
-
# Watch mode for development using tsx
|
|
19
|
-
pnpm tsx --watch index.ts
|
|
14
|
+
All executable commands emit JSON envelopes:
|
|
20
15
|
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
```json
|
|
17
|
+
{"ok":true,"command":"godaddy env get","result":{"environment":"ote"},"next_actions":[...]}
|
|
23
18
|
```
|
|
24
19
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
- **Application Management**: Create, view, and release applications
|
|
28
|
-
- **Authentication**: Secure OAuth-based authentication with GoDaddy
|
|
29
|
-
- **Webhook Management**: List available webhook event types
|
|
30
|
-
- **Environment Management**: Work across different GoDaddy environments
|
|
31
|
-
- **Actions Management**: List and describe available application actions
|
|
32
|
-
|
|
33
|
-
## Command Reference
|
|
34
|
-
|
|
35
|
-
### Global Options
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
godaddy --help # Display help information
|
|
39
|
-
godaddy --version # Display version information
|
|
40
|
-
godaddy -e, --env <environment> # Set target environment (ote, prod)
|
|
41
|
-
godaddy --debug # Enable debug logging for HTTP requests and responses
|
|
20
|
+
```json
|
|
21
|
+
{"ok":false,"command":"godaddy application info demo","error":{"message":"Application 'demo' not found","code":"NOT_FOUND"},"fix":"Use discovery commands such as: godaddy application list or godaddy actions list.","next_actions":[...]}
|
|
42
22
|
```
|
|
43
23
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
godaddy env list
|
|
49
|
-
Options:
|
|
50
|
-
-o, --output <format> # Output format: json or text (default: text)
|
|
24
|
+
`--help` remains standard CLI help text.
|
|
25
|
+
`--output` has been removed; all executable command paths return JSON envelopes.
|
|
26
|
+
Use `--pretty` to format envelopes with 2-space indentation for human readability.
|
|
27
|
+
Long-running operations can stream typed NDJSON events with `--follow`, ending with a terminal `result` or `error` event.
|
|
51
28
|
|
|
52
|
-
|
|
53
|
-
godaddy env get
|
|
54
|
-
Options:
|
|
55
|
-
-o, --output <format> # Output format: json or text (default: text)
|
|
56
|
-
|
|
57
|
-
# Switch to a different environment
|
|
58
|
-
godaddy env set <environment> # <environment> is one of: ote, prod
|
|
59
|
-
Options:
|
|
60
|
-
-o, --output <format> # Output format: json or text (default: text)
|
|
61
|
-
|
|
62
|
-
# View detailed environment configuration
|
|
63
|
-
godaddy env info [environment] # [environment] is one of: ote, prod (defaults to current)
|
|
64
|
-
Options:
|
|
65
|
-
-o, --output <format> # Output format: json or text (default: text)
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
### Authentication Commands
|
|
29
|
+
## Root Discovery
|
|
69
30
|
|
|
70
31
|
```bash
|
|
71
|
-
|
|
72
|
-
godaddy auth login # Opens browser for OAuth authentication
|
|
73
|
-
Options:
|
|
74
|
-
-o, --output <format> # Output format: json or text (default: text)
|
|
75
|
-
|
|
76
|
-
# Logout and clear stored credentials
|
|
77
|
-
godaddy auth logout
|
|
78
|
-
Options:
|
|
79
|
-
-o, --output <format> # Output format: json or text (default: text)
|
|
80
|
-
|
|
81
|
-
# Check current authentication status
|
|
82
|
-
godaddy auth status
|
|
83
|
-
Options:
|
|
84
|
-
-o, --output <format> # Output format: json or text (default: text)
|
|
32
|
+
godaddy
|
|
85
33
|
```
|
|
86
34
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
> **Note**: `godaddy app` can be used as a shorthand alias for `godaddy application`
|
|
90
|
-
|
|
91
|
-
```bash
|
|
92
|
-
# List all applications
|
|
93
|
-
godaddy application list # Alias: godaddy app ls
|
|
94
|
-
Options:
|
|
95
|
-
-o, --output <format> # Output format: json or text (default: text)
|
|
96
|
-
|
|
97
|
-
# Show application information
|
|
98
|
-
godaddy application info <name> # Shows info for the named application
|
|
99
|
-
Options:
|
|
100
|
-
-o, --output <format> # Output format: json or text (default: text)
|
|
101
|
-
|
|
102
|
-
# Initialize a new application
|
|
103
|
-
godaddy application init
|
|
104
|
-
Options:
|
|
105
|
-
--name <name> # Application name
|
|
106
|
-
--description <description> # Application description
|
|
107
|
-
--url <url> # Application URL
|
|
108
|
-
--proxy-url <proxyUrl> # Proxy URL for API endpoints
|
|
109
|
-
--scopes <scopes> # Authorization scopes (space-separated)
|
|
110
|
-
-c, --config <path> # Path to configuration file
|
|
111
|
-
--environment <env> # Environment (ote|prod)
|
|
112
|
-
-o, --output <format> # Output format: json or text (default: text)
|
|
35
|
+
Returns environment/auth snapshots and the full command tree.
|
|
113
36
|
|
|
114
|
-
|
|
115
|
-
godaddy application validate <name>
|
|
116
|
-
Options:
|
|
117
|
-
-o, --output <format> # Output format: json or text (default: text)
|
|
37
|
+
## Global Options
|
|
118
38
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
--label <label> # Application label
|
|
123
|
-
--description <description> # Application description
|
|
124
|
-
--status <status> # Application status (ACTIVE|INACTIVE)
|
|
125
|
-
-o, --output <format> # Output format: json or text (default: text)
|
|
39
|
+
- `-e, --env <environment>`: validate target environment (`ote`, `prod`)
|
|
40
|
+
- `--debug`: enable debug logging (stderr only)
|
|
41
|
+
- `--pretty`: pretty-print JSON envelopes (2-space indentation)
|
|
126
42
|
|
|
127
|
-
|
|
128
|
-
godaddy application release <name>
|
|
129
|
-
Options:
|
|
130
|
-
--release-version <version> # Release version (required)
|
|
131
|
-
--description <description> # Release description
|
|
132
|
-
--config <path> # Path to configuration file
|
|
133
|
-
--environment <env> # Environment (ote|prod)
|
|
134
|
-
-o, --output <format> # Output format: json or text (default: text)
|
|
43
|
+
## Commands
|
|
135
44
|
|
|
136
|
-
|
|
137
|
-
godaddy application deploy <name>
|
|
138
|
-
Options:
|
|
139
|
-
--config <path> # Path to configuration file
|
|
140
|
-
--environment <env> # Environment (ote|prod)
|
|
141
|
-
-o, --output <format> # Output format: json or text (default: text)
|
|
45
|
+
### Environment
|
|
142
46
|
|
|
143
|
-
|
|
144
|
-
godaddy
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
47
|
+
- `godaddy env`
|
|
48
|
+
- `godaddy env list`
|
|
49
|
+
- `godaddy env get`
|
|
50
|
+
- `godaddy env set <environment>`
|
|
51
|
+
- `godaddy env info [environment]`
|
|
148
52
|
|
|
149
|
-
|
|
150
|
-
godaddy application disable <name>
|
|
151
|
-
Options:
|
|
152
|
-
--store-id <storeId> # Store ID (required)
|
|
153
|
-
-o, --output <format> # Output format: json or text (default: text)
|
|
53
|
+
### Authentication
|
|
154
54
|
|
|
155
|
-
|
|
156
|
-
godaddy
|
|
157
|
-
|
|
158
|
-
|
|
55
|
+
- `godaddy auth`
|
|
56
|
+
- `godaddy auth login`
|
|
57
|
+
- `godaddy auth logout`
|
|
58
|
+
- `godaddy auth status`
|
|
159
59
|
|
|
160
|
-
|
|
161
|
-
godaddy application add <type>
|
|
162
|
-
<type> can be one of: # action, subscription, extension
|
|
163
|
-
```
|
|
60
|
+
### Application
|
|
164
61
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
godaddy application
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
62
|
+
- `godaddy application` (alias: `godaddy app`)
|
|
63
|
+
- `godaddy application list` (alias: `godaddy app ls`)
|
|
64
|
+
- `godaddy application info <name>`
|
|
65
|
+
- `godaddy application validate <name>`
|
|
66
|
+
- `godaddy application update <name> [--label <label>] [--description <description>] [--status <status>]`
|
|
67
|
+
- `godaddy application enable <name> --store-id <storeId>`
|
|
68
|
+
- `godaddy application disable <name> --store-id <storeId>`
|
|
69
|
+
- `godaddy application archive <name>`
|
|
70
|
+
- `godaddy application init [--name <name>] [--description <description>] [--url <url>] [--proxy-url <proxyUrl>] [--scopes <scopes>] [--config <path>] [--environment <env>]`
|
|
71
|
+
- `godaddy application release <name> --release-version <version> [--description <description>] [--config <path>] [--environment <env>]`
|
|
72
|
+
- `godaddy application deploy <name> [--config <path>] [--environment <env>] [--follow]`
|
|
176
73
|
|
|
177
|
-
####
|
|
74
|
+
#### Application Add
|
|
178
75
|
|
|
179
|
-
|
|
180
|
-
godaddy application add
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
--environment <env> # Environment (ote|prod)
|
|
187
|
-
-o, --output <format> # Output format: json or text (default: text)
|
|
188
|
-
```
|
|
76
|
+
- `godaddy application add`
|
|
77
|
+
- `godaddy application add action --name <name> --url <url>`
|
|
78
|
+
- `godaddy application add subscription --name <name> --events <events> --url <url>`
|
|
79
|
+
- `godaddy application add extension`
|
|
80
|
+
- `godaddy application add extension embed --name <name> --handle <handle> --source <source> --target <targets>`
|
|
81
|
+
- `godaddy application add extension checkout --name <name> --handle <handle> --source <source> --target <targets>`
|
|
82
|
+
- `godaddy application add extension blocks --source <source>`
|
|
189
83
|
|
|
190
|
-
|
|
84
|
+
### Webhooks
|
|
191
85
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
godaddy application add extension embed
|
|
195
|
-
Options:
|
|
196
|
-
--name <name> # Extension name (required)
|
|
197
|
-
--handle <handle> # Extension handle/unique identifier (required)
|
|
198
|
-
--source <source> # Path to extension source file (required)
|
|
199
|
-
--target <targets> # Comma-separated list of target locations (required)
|
|
200
|
-
--config <path> # Path to configuration file
|
|
201
|
-
--environment <env> # Environment (ote|prod)
|
|
202
|
-
-o, --output <format> # Output format: json or text (default: text)
|
|
86
|
+
- `godaddy webhook`
|
|
87
|
+
- `godaddy webhook events`
|
|
203
88
|
|
|
204
|
-
|
|
205
|
-
godaddy application add extension checkout
|
|
206
|
-
Options:
|
|
207
|
-
--name <name> # Extension name (required)
|
|
208
|
-
--handle <handle> # Extension handle/unique identifier (required)
|
|
209
|
-
--source <source> # Path to extension source file (required)
|
|
210
|
-
--target <targets> # Comma-separated list of checkout target locations (required)
|
|
211
|
-
--config <path> # Path to configuration file
|
|
212
|
-
--environment <env> # Environment (ote|prod)
|
|
213
|
-
-o, --output <format> # Output format: json or text (default: text)
|
|
89
|
+
### Actions
|
|
214
90
|
|
|
215
|
-
|
|
216
|
-
godaddy
|
|
217
|
-
|
|
218
|
-
--source <source> # Path to blocks extension source file (required)
|
|
219
|
-
--config <path> # Path to configuration file
|
|
220
|
-
--environment <env> # Environment (ote|prod)
|
|
221
|
-
-o, --output <format> # Output format: json or text (default: text)
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
### Webhook Commands
|
|
225
|
-
|
|
226
|
-
```bash
|
|
227
|
-
# List available webhook event types
|
|
228
|
-
godaddy webhook events # Lists all available webhook event types you can subscribe to
|
|
229
|
-
Options:
|
|
230
|
-
-o, --output <format> # Output format: json or text (default: text)
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
### Actions Commands
|
|
234
|
-
|
|
235
|
-
```bash
|
|
236
|
-
# List all available actions
|
|
237
|
-
godaddy actions list # Lists all available actions an application can hook into
|
|
238
|
-
Options:
|
|
239
|
-
-o, --output <format> # Output format: json or text (default: text)
|
|
240
|
-
|
|
241
|
-
# Show detailed interface information for a specific action
|
|
242
|
-
godaddy actions describe <action> # Displays request/response schemas for the action
|
|
243
|
-
Options:
|
|
244
|
-
-o, --output <format> # Output format: json or text (default: text)
|
|
245
|
-
```
|
|
91
|
+
- `godaddy actions`
|
|
92
|
+
- `godaddy actions list`
|
|
93
|
+
- `godaddy actions describe <action>`
|
|
246
94
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
The following actions are available for applications to hook into:
|
|
250
|
-
|
|
251
|
-
- `location.address.verify` - Verify and standardize a physical address
|
|
252
|
-
- `commerce.taxes.calculate` - Calculate taxes for a purchase
|
|
253
|
-
- `commerce.shipping-rates.calculate` - Calculate shipping rates
|
|
254
|
-
- `commerce.price-adjustment.apply` - Apply price adjustments
|
|
255
|
-
- `commerce.price-adjustment.list` - List price adjustments
|
|
256
|
-
- `notifications.email.send` - Send email notifications
|
|
257
|
-
- `commerce.payment.get` - Get payment details
|
|
258
|
-
- `commerce.payment.cancel` - Cancel a payment
|
|
259
|
-
- `commerce.payment.refund` - Refund a payment
|
|
260
|
-
- `commerce.payment.process` - Process a payment
|
|
261
|
-
- `commerce.payment.auth` - Authorize a payment
|
|
262
|
-
|
|
263
|
-
## Automation Examples
|
|
264
|
-
|
|
265
|
-
### Complete Application Setup
|
|
266
|
-
|
|
267
|
-
Create and configure an application without interactive prompts:
|
|
95
|
+
## Development
|
|
268
96
|
|
|
269
97
|
```bash
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
--description "Advanced e-commerce integration" \
|
|
274
|
-
--url "https://app.mystore.com" \
|
|
275
|
-
--proxy-url "https://api.mystore.com" \
|
|
276
|
-
--scopes "domains orders customers" \
|
|
277
|
-
--config ./config/godaddy.prod.toml \
|
|
278
|
-
--environment prod \
|
|
279
|
-
--output json \
|
|
280
|
-
--env prod
|
|
281
|
-
|
|
282
|
-
# Add action
|
|
283
|
-
godaddy application add action \
|
|
284
|
-
--name "order.completed" \
|
|
285
|
-
--url "https://api.mystore.com/actions/order-completed" \
|
|
286
|
-
--config ./config/godaddy.prod.toml \
|
|
287
|
-
--environment prod \
|
|
288
|
-
--output json
|
|
289
|
-
|
|
290
|
-
# Add webhook subscription
|
|
291
|
-
godaddy application add subscription \
|
|
292
|
-
--name "order-events" \
|
|
293
|
-
--events "order.created,order.completed,order.cancelled" \
|
|
294
|
-
--url "https://api.mystore.com/webhooks/orders" \
|
|
295
|
-
--config ./config/godaddy.prod.toml \
|
|
296
|
-
--environment prod \
|
|
297
|
-
--output json
|
|
298
|
-
|
|
299
|
-
# Add embed extension
|
|
300
|
-
godaddy application add extension embed \
|
|
301
|
-
--name "my-widget" \
|
|
302
|
-
--handle "my-widget-handle" \
|
|
303
|
-
--source "./extensions/embed/index.tsx" \
|
|
304
|
-
--target "body.end" \
|
|
305
|
-
--config ./config/godaddy.prod.toml \
|
|
306
|
-
--environment prod \
|
|
307
|
-
--output json
|
|
308
|
-
|
|
309
|
-
# Create a release
|
|
310
|
-
godaddy application release my-ecommerce-app \
|
|
311
|
-
--release-version "1.0.0" \
|
|
312
|
-
--description "Initial release" \
|
|
313
|
-
--config ./config/godaddy.prod.toml \
|
|
314
|
-
--environment prod \
|
|
315
|
-
--output json
|
|
316
|
-
|
|
317
|
-
# Deploy the application
|
|
318
|
-
godaddy application deploy my-ecommerce-app \
|
|
319
|
-
--config ./config/godaddy.prod.toml \
|
|
320
|
-
--environment prod \
|
|
321
|
-
--output json
|
|
322
|
-
|
|
323
|
-
# Enable on a store
|
|
324
|
-
godaddy application enable my-ecommerce-app \
|
|
325
|
-
--store-id "12345" \
|
|
326
|
-
--output json
|
|
98
|
+
pnpm install
|
|
99
|
+
pnpm run build
|
|
100
|
+
pnpm test
|
|
327
101
|
```
|
|
328
|
-
|
|
329
|
-
## Environment Management
|
|
330
|
-
|
|
331
|
-
The CLI supports multiple GoDaddy environments:
|
|
332
|
-
|
|
333
|
-
- **ote**: Pre-production environment that mirrors production
|
|
334
|
-
- **prod**: Production environment for live applications
|
|
335
|
-
|
|
336
|
-
You can specify the environment in two ways:
|
|
337
|
-
|
|
338
|
-
1. Using the global `-e, --env` flag with any command: `godaddy application info my-app --env ote`
|
|
339
|
-
2. Setting a default environment: `godaddy env set prod`
|
|
340
|
-
|
|
341
|
-
Use `godaddy env info` to view detailed configuration for your current environment.
|
|
342
|
-
|
|
343
|
-
## Application Configuration
|
|
344
|
-
|
|
345
|
-
The CLI uses a configuration file (`godaddy.toml`) to store your application settings. You can provide a custom configuration file path using the `--config` option with commands that support it.
|
|
346
|
-
|
|
347
|
-
Environment-specific configuration files can be used by naming them `godaddy.<environment>.toml` (e.g., `godaddy.dev.toml`).
|
|
348
|
-
|
|
349
|
-
Example configuration:
|
|
350
|
-
|
|
351
|
-
```toml
|
|
352
|
-
name = "my-app"
|
|
353
|
-
client_id = "your-client-id"
|
|
354
|
-
description = "My GoDaddy Application"
|
|
355
|
-
url = "https://myapp.example.com"
|
|
356
|
-
proxy_url = "https://proxy.example.com"
|
|
357
|
-
authorization_scopes = ["domains", "shopper"]
|
|
358
|
-
version = "0.0.0"
|
|
359
|
-
actions = []
|
|
360
|
-
|
|
361
|
-
[[subscriptions.webhook]]
|
|
362
|
-
name = "domain-events"
|
|
363
|
-
events = ["example:v1:domain:created", "example:v1:domain:updated"]
|
|
364
|
-
url = "https://myapp.example.com/webhooks"
|
|
365
|
-
|
|
366
|
-
[extensions]
|
|
367
|
-
ui_extension = "value"
|
|
368
|
-
|
|
369
|
-
[dependencies]
|
|
370
|
-
app = [{name = "required-app", version = "^1.0.0"}]
|
|
371
|
-
feature = [{name = "required-feature"}]
|
|
372
|
-
```
|
|
373
|
-
|
|
374
|
-
## Application Deployment
|
|
375
|
-
|
|
376
|
-
The deployment process consists of several steps:
|
|
377
|
-
|
|
378
|
-
1. **Initialize**: Create your application with `godaddy application init`
|
|
379
|
-
2. **Configure**: Add components with the `application add` commands
|
|
380
|
-
3. **Validate**: Ensure your configuration is valid with `godaddy application validate`
|
|
381
|
-
4. **Release**: Create a new version with `godaddy application release`
|
|
382
|
-
5. **Deploy**: Deploy your application with `godaddy application deploy`
|
|
383
|
-
6. **Enable**: Enable your application on stores with `godaddy application enable`
|
|
384
|
-
|
|
385
|
-
## Authentication
|
|
386
|
-
|
|
387
|
-
Authentication is handled securely using OAuth. The CLI will:
|
|
388
|
-
|
|
389
|
-
1. Open a browser for authentication with GoDaddy
|
|
390
|
-
2. Store tokens securely in your system keychain
|
|
391
|
-
3. Automatically use the stored token for future commands
|
|
392
|
-
|
|
393
|
-
## Requirements
|
|
394
|
-
|
|
395
|
-
- Node.js 16+
|
|
396
|
-
- Access to GoDaddy Developer Account
|
|
397
|
-
|
|
398
|
-
## License
|
|
399
|
-
|
|
400
|
-
Copyright GoDaddy Inc. All rights reserved.
|