-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit by Serverless devs docs 1-8-2024 11:45:32
- Loading branch information
serverless-devs
committed
Jan 8, 2024
1 parent
dd8e1e1
commit 0da3761
Showing
16 changed files
with
1,142 additions
and
814 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,68 @@ | ||
--- | ||
title: Clean command | ||
description: 'Clean command' | ||
position: 7 | ||
title: Clean Command | ||
description: 'Clean Command' | ||
position: 3 | ||
category: 'Commands' | ||
--- | ||
|
||
# Clean command | ||
|
||
The `clean` command can be used to clean up the cache of Serverless Devs. You can use this command to clean up the environment, dependency packages that are not used, and the cache. | ||
|
||
- [Command-description](#Command-description) | ||
- [Parameter description](#Parameter-description) | ||
- [Example](#Example) | ||
- [Precautions](#Precautions) | ||
|
||
## Command description | ||
|
||
After you execute the `s clean -h` command, we can view the help information: | ||
|
||
# Clean Command | ||
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. | ||
- [Command Overview](#command-overview) | ||
- [Parameters](#parameters) | ||
- [Usage Examples](#usage-examples) | ||
- [Cautions](#cautions) | ||
## Command Overview | ||
To access help information, execute `s clean -h`: | ||
```shell script | ||
$ s clean -h | ||
Usage: s cli [options] | ||
|
||
Usage: s clean [options] | ||
Clean up the cache related functions of serverless devs. You can clean up the environment, unused dependent packages and related cache contents through this command. | ||
Example: | ||
$ s clean --component fc api | ||
$ s clean --all | ||
Tips: | ||
Get all installed component: s component | ||
|
||
Example: | ||
$ s clean --component fc-api | ||
$ s clean --all | ||
|
||
Tips: | ||
Get all installed component: s component | ||
|
||
📖 Document: https://github.com/Serverless-Devs/Serverless-Devs/tree/master/docs/en/command/clean.md | ||
|
||
📖 Document: https://serverless.help/t/s/clean | ||
Options: | ||
--all Clean up the environment | ||
--cache [dirName] Delete the <dirName> file in the cache | ||
--component [componentName] Remove component (like: fc, [email protected]) | ||
-h, --help Display help for command | ||
--all Clean up the environment | ||
--logs Clean logs | ||
--cache [dirName] Delete the <dirName> file in the cache | ||
--component [componentName] Remove component (like: fc, [email protected]) | ||
-h, --help Display help for command | ||
``` | ||
|
||
### Parameter description | ||
|
||
### Parameters | ||
Navigate through the command's options with ease, each tailored for a specific aspect of the clean-up process: | ||
| Parameter | Abbreviation | Required | Description | | ||
|-----|-----|-----|-----| | ||
| all | | No | Cleans the environment. | | ||
| cache | | No | Deletes the <dirName> files in the cache. | | ||
| component | | No | Deletes a component. You can use a component name or [Component name@Version]. | | ||
|
||
|
||
### Example | ||
|
||
If you want to clean a component, you can specify the component name in the `--component` command. For example: | ||
|
||
| all | | Optional | Initiates a comprehensive environment clean-up | | ||
| logs | | Optional | Targets log files for cleaning | | ||
| cache | | Optional | Specifies and removes a <dirName> within the cache | | ||
| component | | Optional | Deletes a particular component (e.g., fc, [email protected]) | | ||
### Usage Examples | ||
To purge a specific component, employ the `--component` flag alongside the name of the component: | ||
```shell script | ||
$ s clean --component fc-api | ||
Component [fc-api] has been cleaned up successfully. | ||
$ s clean --component fc api | ||
[2023-******][INFO][s_cli] Component [fc api] has been cleaned up successfully. | ||
``` | ||
|
||
If you want to clean up the environment, you can use the `--all` parameter. For example: | ||
|
||
For cache removal, utilize the `--cache` option as demonstrated below: | ||
```shell script | ||
$ s clean --cache | ||
[2023-******][INFO][s_cli] Cache cleaned up successfully. | ||
``` | ||
Log file clean-up can be achieved through the `--logs` parameter: | ||
```shell script | ||
$ s clean --logs | ||
[2023-******][INFO][s_cli] Logs cleaned up successfully. | ||
``` | ||
For an all-encompassing clean-up, the `--all` parameter is at your disposal: | ||
```shell script | ||
$ s clean --all | ||
The environment of Serverless Devs has been cleaned up successfully. | ||
[2023-******][INFO][s_cli] Component cleaned up successfully. | ||
[2023-******][INFO][s_cli] Cache cleaned up successfully. | ||
[2023-******][INFO][s_cli] Logs cleaned up successfully. | ||
[2023-******][INFO][s_cli] The environment of Serverless Devs has been cleaned up successfully. | ||
``` | ||
|
||
## Precautions | ||
When you clean up a component, the system follows the following logic: | ||
1. First, the system checks and cleans the components that meet the condition in the Registry cache. | ||
2. Then, the system checks and cleans the component that meets the condition in the GitHub Registry cache. | ||
## Cautions | ||
Please note the following protocols when executing a component-specific clean-up: | ||
1. The system will first assess if there are any corresponding components within the current Registry cache and proceed to clear them. | ||
2. Following that, the system will purge the ultimate Registry cache, the Github Registry, eradicating any components that match the criteria. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,80 +1,51 @@ | ||
--- | ||
title: Component command | ||
description: 'Component command' | ||
position: 8 | ||
category: 'Commands' | ||
title: Component Command | ||
description: 'Component Command' | ||
position: 5 | ||
category: 'Command' | ||
--- | ||
|
||
# Component command | ||
|
||
The `component` command is used to obtain the details of components that are installed. | ||
`component` is used to get the details of installed components. | ||
|
||
- [Command description](#Command-description) | ||
- [Parameter description](#Parameter-description) | ||
- [Command Parse](#Command-Parse) | ||
- [Parameter](#Parameter) | ||
- [Example](#Example) | ||
- [Precautions](#Precautions) | ||
|
||
## Command description | ||
## Command Parse | ||
|
||
After you run the `s component -h` command, the following help information is returned: | ||
When we execute `s component -h`, we can get help information: | ||
|
||
```shell script | ||
$ s component -h | ||
Usage: s component [options] | ||
|
||
Get details of installed components. | ||
|
||
Example: | ||
$ s component | ||
|
||
Example: | ||
$ s component | ||
$ s component --component fc-api | ||
|
||
📖 Document: https://github.com/Serverless-Devs/Serverless-Devs/tree/master/docs/en/command/component.md | ||
📖 Document: https://serverless.help/t/s/component | ||
|
||
Options: | ||
--component <componentName> Gets the specified component information (like: fc, [email protected]) | ||
-h, --help Display help for command | ||
-h, --help Display help for command. | ||
``` | ||
|
||
### Parameter description | ||
### Parameter | ||
|
||
| Parameter | Abbreviation | Required | Description | | ||
|-----|-----|-----|-----| | ||
| name | | No | You can obtain the specified component information, such as the component name or [Component name @Version number] | | ||
No parameters are required. | ||
|
||
### Example | ||
|
||
If you want to obtain the information about a component, you can use the `--component` parameter. Example: | ||
|
||
```shell script | ||
$ s component --component fc-api | ||
Component: fc | ||
Registry: serverless registry [http://registry.devsapp.cn/simple] | ||
Version: 0.1.27 | ||
Size: 100 MB | ||
Description: 阿里云函数计算基础组件 | ||
Path: ~/.s/components/fc | ||
Hompage: https://github.com/devsapp/fc | ||
|
||
🙋 Delete the component, please use the command [s clean --component [email protected]] | ||
``` | ||
We can execute `s component` to get all installed components, for example: | ||
|
||
If you want to obtain the information about all installed components, run the `s component` command. Example: | ||
```shell script | ||
$ s component | ||
|
||
🔎 serverless registry [http://registry.devsapp.cn/simple] | ||
Component Description Size Version | ||
fc 阿里云函数计算基础组件 100 MB 0.1.27 | ||
devsapp/fc 阿里云函数计算基础组件 100 MB 0.1.27 | ||
fc-api 函数计算api操作组件 100 MB 0.0.44 | ||
|
||
🔎 github registry [https://api.github.com/repos] | ||
Component Description Size Version | ||
fc 阿里云函数计算基础组件 100 MB 0.1.27 | ||
devsapp/fc 阿里云函数计算基础组件 100 MB 0.1.27 | ||
|
||
🔎 serverless registry [https://registry.serverless-devs.com] | ||
Component Version Size Description | ||
fc 0.1.27 100 MB Aliyun Function Compute Base Component | ||
devsapp/fc 0.1.27 100 MB Aliyun Function Compute Base Component | ||
fc api 0.0.44 100 MB Function Compute api operation component | ||
``` | ||
|
||
|
||
## Precautions | ||
When you query a component, the system displays the information about the current registry and the default GitHub registry. If you need to view other registries, run the `s set registry` command to switch registries. |
Oops, something went wrong.