esa-cli 1.0.1 → 1.0.2-beta.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.
@@ -1,271 +1,392 @@
1
- ## Commands
1
+ ## ESA CLI Commands
2
2
 
3
- ### esa-cli init [name]
3
+ ESA CLI offers a number of commands to manage your Alibaba Cloud ESA Functions & Pages.
4
4
 
5
- Initialize a project with a template or a framework.
5
+ **init** - Create a new project from a variety of web frameworks and templates.
6
+ **dev** - Start a local server for developing your Functions & Pages.
7
+ **commit** - Commit your code and save as a new version.
8
+ **deploy** - Deploy your Functions & Pages to Alibaba Cloud.
9
+ **deployments** - Manage your deployments and versions.
10
+ **project** - Manage your Functions & Pages projects.
11
+ **site** - List your activated sites.
12
+ **domain** - Manage domain bindings for your Functions & Pages.
13
+ **route** - Manage route bindings for your Functions & Pages.
14
+ **login** - Authorize ESA CLI with your Alibaba Cloud account.
15
+ **logout** - Remove ESA CLI's authorization for accessing your account.
16
+ **config** - Modify your local or global configuration.
17
+ **lang** - Set the language of the CLI.
18
+
19
+ ### How to run ESA CLI commands
20
+
21
+ If you have installed esa-cli globally, please refer to the following commands for execution.
22
+
23
+ **Installation**
6
24
 
7
- ```bash
8
- esa-cli init [name]
25
+ ```
26
+ npm i esa-cli@latest -g
9
27
  ```
10
28
 
11
- - Positionals:
12
- - name: Project name
29
+ **Execute commands**
13
30
 
14
- - Options:
15
- - -f, --framework string: Choose a frontend framework (react/vue/nextjs...)
16
- - -l, --language string: Choose programming language (typescript/javascript). Choices: typescript | javascript
17
- - -t, --template string: Template name to use
18
- - -y, --yes boolean: Answer "Yes" to all prompts (default: false)
19
- - --git boolean: Initialize git repository
20
- - --deploy boolean: Deploy after initialization
31
+ ```
32
+ esa-cli <COMMAND> <SUBCOMMAND> [PARAMETERS] [OPTIONS]
33
+ ```
21
34
 
22
35
  ---
23
36
 
24
- ### esa-cli dev [entry]
37
+ If you have installed ESA CLI locally in your project (rather than globally), the way to run ESA CLI will depend on your specific setup and package manager.
25
38
 
26
- Start a local server for developing your project.
39
+ ```
40
+ npx esa-cli <COMMAND> <SUBCOMMAND> [PARAMETERS] [OPTIONS]
41
+ ```
27
42
 
28
- ```bash
29
- esa-cli dev [entry]
43
+ **You can add ESA CLI commands that you use often as scripts in your project's package.json file:**
44
+
45
+ ```json
46
+ {
47
+ ...
48
+ "scripts": {
49
+ "deploy": "esa-cli deploy",
50
+ "dev": "esa-cli dev"
51
+ }
52
+ ...
53
+ }
30
54
  ```
31
55
 
32
- - Positionals:
33
- - entry: Entry file of Functions& Pages
56
+ **Then you can run them using your package manager of choice:**
34
57
 
35
- - Options:
36
- - -p, --port number: Port to listen on
37
- - -m, --minify boolean: Minify code during development (default: false)
38
- - --refresh-command string: Command to run before auto-refresh on save
39
- - --local-upstream string: Host to act as origin in development
40
- - --debug boolean: Output debug logs (default: false)
58
+ ```
59
+ npm run deploy
60
+ ```
41
61
 
42
62
  ---
43
63
 
44
- ### esa-cli commit [entry]
64
+ ## init
45
65
 
46
- Commit your code and save as a new version.
66
+ Create a new project via templates. A variety of web frameworks are available to choose from as well as templates. Dependencies are installed by default, with the option to deploy your project immediately.
47
67
 
48
- ```bash
49
- esa-cli commit [entry]
68
+ ```
69
+ esa-cli init [<NAME>] [OPTIONS]
50
70
  ```
51
71
 
52
- - Options:
53
- - -m, --minify boolean: Minify code before committing (default: false)
54
- - -a, --assets string: Assets directory
55
- - -d, --description string: Description for Functions& Pages/version (skip interactive input)
56
- - -n, --name string: Functions& Pages name
72
+ **NAME** _optional (default: name of working directory)_
73
+ The name of the Functions & Pages project. This is both the directory name and name property in the generated ESA CLI configuration.
74
+
75
+ **--framework, -f** _optional_
76
+ Choose a frontend framework (react/vue/nextjs...)
77
+
78
+ **--language, -l** _optional_
79
+ Choose programming language (typescript/javascript). Choices: typescript | javascript
80
+
81
+ **--template, -t** _optional_
82
+ Template name to use
83
+
84
+ **--yes, -y** _optional_
85
+ Answer "Yes" to all prompts (default: false), template uses helloworld
86
+
87
+ **--git** _optional_
88
+ Initialize git repository
89
+
90
+ **--deploy** _optional_
91
+ Deploy after initialization
57
92
 
58
93
  ---
59
94
 
60
- ### esa-cli deploy [entry]
95
+ ## dev
61
96
 
62
- Deploy your project.
97
+ Start a local server for developing your Functions & Pages.
63
98
 
64
- ```bash
65
- esa-cli deploy [entry]
66
99
  ```
100
+ esa-cli dev [<ENTRY>] [OPTIONS]
101
+ ```
102
+
103
+ **ENTRY** _optional_
104
+ Entry file of Functions & Pages
105
+
106
+ **--port, -p** _optional_
107
+ Port to listen on
108
+
109
+ **--minify, -m** _optional_
110
+ Minify code during development (default: false)
111
+
112
+ **--refresh-command** _optional_
113
+ Command to run before auto-refresh on save
67
114
 
68
- - Positionals:
69
- - entry: Entry file of Functions& Pages
115
+ **--local-upstream** _optional_
116
+ Host to act as origin in development
70
117
 
71
- - Options:
72
- - -v, --version string: Version to deploy (skip interactive selection)
73
- - -e, --environment string: Environment to deploy to. Choices: staging | production
74
- - -n, --name string: Name of Functions& Pages
75
- - -a, --assets string: Assets directory (e.g., ./dist)
76
- - -d, --description string: Description of the version
77
- - -m, --minify boolean: Minify the code
118
+ **--debug** _optional_
119
+ Output debug logs (default: false)
78
120
 
79
121
  ---
80
122
 
81
- ### esa-cli deployments list
123
+ ## commit
82
124
 
83
- List all deployments.
125
+ Commit your code and save as a new version.
84
126
 
85
- ```bash
86
- esa-cli deployments list
87
127
  ```
128
+ esa-cli commit [<ENTRY>] [OPTIONS]
129
+ ```
130
+
131
+ **ENTRY** _optional_
132
+ Entry file of Functions & Pages
133
+
134
+ **--minify, -m** _optional_
135
+ Minify code before committing (default: false)
136
+
137
+ **--assets, -a** _optional_
138
+ Assets directory
88
139
 
89
- No additional options.
140
+ **--description, -d** _optional_
141
+ Description for Functions & Pages/version (skip interactive input)
142
+
143
+ **--name, -n** _optional_
144
+ Functions & Pages name
90
145
 
91
146
  ---
92
147
 
93
- ### esa-cli deployments delete [deploymentId...]
148
+ ## deploy
94
149
 
95
- Delete one or more deployment versions.
150
+ Generate a code version and deploy the project to both staging and production environments.
96
151
 
97
- ```bash
98
- esa-cli deployments delete [deploymentId...]
99
152
  ```
153
+ esa-cli deploy [<ENTRY>] [OPTIONS]
154
+ ```
155
+
156
+ **ENTRY** _optional_
157
+ Entry file of Functions & Pages, defaults to entry configuration in `esa.jsonc`
158
+
159
+ **--version, -v** _optional_
160
+ Version to deploy (skip interactive selection)
161
+
162
+ **--environment, -e** _optional_
163
+ Environment to deploy to. Choices: staging | production
164
+
165
+ **--name, -n** _optional_
166
+ Name of Functions & Pages
100
167
 
101
- - Positionals:
102
- - deploymentId...: Deployment version IDs to delete (one or more)
168
+ **--assets, -a** _optional_
169
+ Assets directory (e.g., ./dist)
170
+
171
+ **--description, -d** _optional_
172
+ Description of the version
173
+
174
+ **--minify, -m** _optional_
175
+ Whether to minify the code
103
176
 
104
177
  ---
105
178
 
106
- ### esa-cli project list
179
+ ## deployments
107
180
 
108
- List all your projects.
181
+ Manage your deployments and versions.
182
+
183
+ ### deployments list
184
+
185
+ List all code versions under the current Functions & Pages.
109
186
 
110
- ```bash
111
- esa-cli project list
112
187
  ```
188
+ esa-cli deployments list
189
+ ```
190
+
191
+ ### deployments delete
192
+
193
+ Delete one or more code versions of the current Functions & Pages.
113
194
 
114
- No additional options.
195
+ ```
196
+ esa-cli deployments delete [<DEPLOYMENT_ID>...] [OPTIONS]
197
+ ```
198
+
199
+ **DEPLOYMENT_ID** _required_
200
+ Deployment version IDs to delete (can pass multiple at once)
115
201
 
116
202
  ---
117
203
 
118
- ### esa-cli project delete <projectName>
204
+ ## project
205
+
206
+ Manage your Functions & Pages projects.
207
+
208
+ ### project list
209
+
210
+ List all Functions & Pages under the account.
211
+
212
+ ```
213
+ esa-cli project list
214
+ ```
215
+
216
+ ### project delete
119
217
 
120
- Delete a project.
218
+ Delete specified Functions & Pages.
121
219
 
122
- ```bash
123
- esa-cli project delete <projectName>
220
+ ```
221
+ esa-cli project delete <PROJECT_NAME> [OPTIONS]
124
222
  ```
125
223
 
126
- - Positionals:
127
- - projectName: The name of the project to delete
224
+ **PROJECT_NAME** _required_
225
+ Name of the Functions or Pages to delete
128
226
 
129
227
  ---
130
228
 
131
- ### esa-cli site list
229
+ ## site
230
+
231
+ List your activated sites.
232
+
233
+ ### site list
132
234
 
133
- List all your sites.
235
+ List all activated sites under the account.
134
236
 
135
- ```bash
237
+ ```
136
238
  esa-cli site list
137
239
  ```
138
240
 
139
- No additional options.
140
-
141
241
  ---
142
242
 
143
- ### esa-cli domain add <domain>
243
+ ## domain
244
+
245
+ Manage domain bindings for your Functions & Pages.
144
246
 
145
- Bind a domain to your project.
247
+ ### domain add
146
248
 
147
- ```bash
148
- esa-cli domain add <domain>
249
+ Bind a domain to the current Functions & Pages.
250
+
251
+ ```
252
+ esa-cli domain add <DOMAIN> [OPTIONS]
149
253
  ```
150
254
 
151
- - Positionals:
152
- - domain: The domain name to bind
255
+ **Only sites activated under this account can be bound**
153
256
 
154
- ---
257
+ **DOMAIN** _required_
258
+ The domain name to bind (must be activated under the account's sites)
155
259
 
156
- ### esa-cli domain list
260
+ ### domain list
157
261
 
158
- List all related domains.
262
+ View all bound domains for the current Functions & Pages.
159
263
 
160
- ```bash
264
+ ```
161
265
  esa-cli domain list
162
266
  ```
163
267
 
164
- No additional options.
165
-
166
- ---
268
+ ### domain delete
167
269
 
168
- ### esa-cli domain delete <domain>
270
+ Delete bound domains under the current Functions & Pages.
169
271
 
170
- Delete a related domain.
171
-
172
- ```bash
173
- esa-cli domain delete <domain>
272
+ ```
273
+ esa-cli domain delete <DOMAIN> [OPTIONS]
174
274
  ```
175
275
 
176
- - Positionals:
177
- - domain: The domain name to delete
276
+ **DOMAIN** _required_
277
+ The domain name to delete binding
178
278
 
179
279
  ---
180
280
 
181
- ### esa-cli route add
281
+ ## route
182
282
 
183
- Bind a route to the current project.
283
+ Manage route bindings for your Functions & Pages.
184
284
 
185
- ```bash
186
- esa-cli route add [route] [site] [--alias <routeName>] [--route <route>] [--site <site>]
285
+ ### route add
286
+
287
+ Bind a route to the current Functions & Pages.
288
+
289
+ ```
290
+ esa-cli route add [<ROUTE>] [<SITE>] [OPTIONS]
187
291
  ```
188
292
 
189
- - Positionals (optional):
190
- - route: The route value, e.g. example.com/_ or _.example.com/\*
191
- - site: The site name, e.g. example.com
293
+ **ROUTE** _optional_
294
+ Route value, e.g. example.com/_ or _.example.com/\*
192
295
 
193
- - Options:
194
- - -r, --route string: Route value, e.g. example.com/\*
195
- - Host supports leading `*` for suffix match (e.g., `*.example.com`)
196
- - Path supports trailing `*` for prefix match (e.g., `/api/*`)
197
- - -s, --site string: Site name (must be an active site)
198
- - -a, --alias string: Route name (alias)
296
+ **SITE** _optional_
297
+ Site name, e.g. example.com
199
298
 
200
- ---
299
+ **Only sites activated under this account can be bound**
201
300
 
202
- ### esa-cli route list
301
+ **--route, -r** _optional_
302
+ Route value, e.g. example.com/\*
203
303
 
204
- List all related routes.
304
+ - Host supports leading `*` for suffix match (e.g., `*.example.com`)
305
+ - Path supports trailing `*` for prefix match (e.g., `/api/*`)
205
306
 
206
- ```bash
207
- esa-cli route list
208
- ```
307
+ **--site, -s** _optional_
308
+ Site name (must be an activated site under the account)
209
309
 
210
- No additional options.
310
+ **--alias, -a** _optional_
311
+ Route name (alias) e.g. apple, orange, etc.
211
312
 
212
- ---
313
+ ### route list
314
+
315
+ View all bound routes under the current Functions & Pages.
316
+
317
+ ```
318
+ esa-cli route list
319
+ ```
213
320
 
214
- ### esa-cli route delete <routeName>
321
+ ### route delete
215
322
 
216
- Delete a related route.
323
+ Delete bound routes under Functions & Pages.
217
324
 
218
- ```bash
219
- esa-cli route delete <routeName>
325
+ ```
326
+ esa-cli route delete <ROUTE_NAME> [OPTIONS]
220
327
  ```
221
328
 
222
- - Positionals:
223
- - routeName: The name of the route to delete
329
+ **ROUTE_NAME** _required_
330
+ The name of the route to delete
224
331
 
225
332
  ---
226
333
 
227
- ### esa-cli login
334
+ ## login
228
335
 
229
- Login to the server.
336
+ Authorize ESA CLI with your Alibaba Cloud account.
230
337
 
231
- ```bash
232
- esa-cli login
233
338
  ```
339
+ esa-cli login [OPTIONS]
340
+ ```
341
+
342
+ **--access-key-id, --ak** _optional_
343
+ AccessKey ID (AK)
344
+
345
+ **--access-key-secret, --sk** _optional_
346
+ AccessKey Secret (SK)
347
+
348
+ **--endpoint, -e** _optional_
349
+ API endpoint URL Example: esa.cn-hangzhou.aliyuncs.com
234
350
 
235
- - Options:
236
- - --access-key-id, --ak string: AccessKey ID (AK)
237
- - --access-key-secret, --sk string: AccessKey Secret (SK)
351
+ **Environment Variables**
352
+ Read from environment variables:
353
+
354
+ - **ESA_ACCESS_KEY_ID**
355
+ - **ESA_ACCESS_KEY_SECRET**
356
+ - **ESA_ENDPOINT**
238
357
 
239
358
  ---
240
359
 
241
- ### esa-cli logout
360
+ ## logout
242
361
 
243
- Logout.
362
+ Remove ESA CLI's authorization for accessing your account.
244
363
 
245
- ```bash
364
+ ```
246
365
  esa-cli logout
247
366
  ```
248
367
 
249
368
  ---
250
369
 
251
- ### esa-cli config [-l | -g]
370
+ ## config
252
371
 
253
372
  Modify your local or global configuration.
254
373
 
255
- ```bash
256
- esa-cli config [--local] [--global]
374
+ ```
375
+ esa-cli config [OPTIONS]
257
376
  ```
258
377
 
259
- - Options:
260
- - -l, --local boolean: Edit local config file (default: false)
261
- - -g, --global boolean: Edit global config file (default: false)
378
+ **--local, -l** _optional_
379
+ Edit local config file (default: false)
380
+
381
+ **--global, -g** _optional_
382
+ Edit global config file (default: false)
262
383
 
263
384
  ---
264
385
 
265
- ### esa-cli lang
386
+ ## lang
266
387
 
267
388
  Set the language of the CLI.
268
389
 
269
- ```bash
390
+ ```
270
391
  esa-cli lang
271
392
  ```