You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/serverless-devs/command/clean.md
+21-2Lines changed: 21 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,13 +5,18 @@ position: 3
5
5
category: 'Commands'
6
6
---
7
7
# Clean Command
8
+
8
9
The `s clean` command is designated to clear the cache and associated functionalities within Serverless Devs. With this command, you're able to cleanse the environment, eliminate unused dependencies, and remove relevant cached data.
Copy file name to clipboardExpand all lines: content/en/serverless-devs/command/cli.md
+26-5Lines changed: 26 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,14 +5,20 @@ position: 4
5
5
category: 'Commands'
6
6
---
7
7
# Cli Command
8
+
8
9
The `cli` command provides a command line interface within Yamlized, allowing direct use of Serverless Devs components via the CLI without the dependence on Yaml files.
> For insights into the differences between Yaml mode and Cli mode, as well as their respective use cases, please consult the [Yaml Mode vs. Cli Mode Comparison](./../yaml_and_cli.md) document.
14
-
## Command Breakdown
17
+
>
18
+
## Command Overview
19
+
15
20
Executing `s cli -h` displays the relevant help information:
21
+
16
22
```shell script
17
23
$ s cli -h
18
24
Usage: s cli [options]
@@ -27,14 +33,20 @@ Options:
27
33
-p, --props <jsonString> JSON string of props
28
34
-h, --help Display helpforcommand
29
35
```
36
+
30
37
Typical usage involves:
38
+
31
39
```shell script
32
40
s cli [component name, e.g., fc, fc api, etc.] [component method] -p/--props [Yaml property equivalent for the method (JSON string)] -a/--access [specify key info] [additional settings]
33
41
```
42
+
34
43
## Common Usage Patterns
44
+
35
45
### General Component Support
46
+
36
47
In Cli mode, you can support components by using the `-p, --props [jsonString]` parameter.
37
48
For instance, a Serverless Devs application might be described like so:
49
+
38
50
```yaml
39
51
edition: 3.0.0
40
52
access: "myaccess"
@@ -51,23 +63,32 @@ resources:
51
63
hosts:
52
64
- host: auto
53
65
```
66
+
54
67
This setup's `website-starter` segment can normally be deployed with `s website-starter deploy`.
55
68
However, to deploy via `cli` mode, you bypass the Yaml file and directly input complete parameter details on the command line:
69
+
56
70
```shell script
57
71
s cli devsapp/website deploy -p "{\"bucket\":\"testbucket\",\"src\":{\"codeUri\":\"./\",\"publishDir\":\"./build\",\"index\":\"index.html\"},\"region\":\"cn-hangzhou\",\"hosts\":[{\"host\":\"auto\"}]}" -a myaccess
58
72
```
73
+
59
74
### Specific Component Support
75
+
60
76
Serverless Devs offers several well-designed components that are optimized for Cli mode. For example, the `fc api` component is prioritized for command line usage, facilitating quick interactions with certain Aliyun Function Compute (FC) service interfaces, such as:
77
+
61
78
- Listing functions within a specified service and region:
79
+
62
80
```shell script
63
81
s cli fc api listFunctions --service-name my-service --region cn-beijing -a myaccess
64
82
```
83
+
65
84
- Updating function code via the command line:
85
+
66
86
```shell script
67
87
s cli fc api updateFunction --region cn-hangzhou --serviceName fc-deploy-service --functionName http-trigger-function --code '{"zipFile":"./"}'
68
88
```
89
+
69
90
Furthermore, several components that typically support Yaml mode may also offer an optimized pure command line interface for specific operations. An example is the `fc` component, which provides commands for resource synchronization:
91
+
70
92
```shell script
71
93
s cli fc sync --region cn-shanghai --service-name myService --type config
0 commit comments