Set command
The set
commands are used to configure tools.
- Command description
- set registry command
- set locale command
- set analysis command
- set log command
- set workspace command
Command description
After you run the s set -h
command, the following help information is returned:
$ s set -h
Usage: s set [commands] [options]
You can make some default settings for the tool here.
π Document: https://github.com/Serverless-Devs/Serverless-Devs/tree/master/docs/en/command/set.md
Options:
-h, --help Display help for command
Commands:
registry π Set up a custom registry
locale π§ Set up current language
analysis π Set to enable or disable analysis
log π Set to enable or disable log
workspace π Set workspace path
The sample code contains the following subcommands:
- registry: Configure repositories for Serverless Devs.
- locale: Configure the languages of Serverless Devs.
- analysis: Configure data analysis for Serverless Devs.
- log: Configure logging behavior for serverless devs
- workspace: Configure the default workspace for serverless devs
set registry command
The set registry command is used to configure repositories for Serverless Devs.
After you run the s set registry -h
command, the following help information is returned:
$ s set registry -h
Usage: s set registry [options]
Set registry information.
Example:
$ s set registry
$ s set registry http://registry.devsapp.cn/simple
Options:
-h, --help Display help for command
You can use the following methods to run the set registry command:
- Provide Registry information directly, for example:
s set registry http://registry.devsapp.cn/simple
- Run the command in interactive mode. Example:
Then, follow instructions to select options based on your business requirements.
$ s set registry π Current registry: http://registry.devsapp.cn/simple ? Choose a registry? (Use arrow keys) β― serverless registry [http://registry.devsapp.cn/simple] github registry [https://api.github.com/repos] gitee registry [http://gitee.registry.devsapp.cn/simple] custom registry
You can use the following repositories: Github Registry, Gitee Registry, and Serverless Devs Registry. The following information describes the relationships among the three repositories:
- Github Registry: the ultimate default repository. Even if you do not configure Github Registry for your project, this repository is used when the required information cannot be found in the repository that you configure.
- Gitee Registry: the repository that Gitee and Alibaba Cloud jointly develop for Chinese users.
- Serverless Devs Registry: the default repository for the Serverless Devs community and the default repository for your project.
The following flowchart shows how data is loaded in Serverless Devs.
π Note: By default, the serverless registry is
serverless devs offical registry [http://registry.devsapp.cn/simple]
.
set proxy command
This command allows you to set up a global proxy for HTTP requests.
Execute the s set proxy -h
command, you can see the help document
$ s set proxy -h
Usage: s set proxy [options]
Set proxy information.
Example:
$ s set proxy
$ s set proxy --http_proxy xxxx:xxx --https_proxy xxxx:xxx
$ s set proxy --enable false
π Document: https://github.com/Serverless-Devs/Serverless-Devs/tree/master/docs/zh/command/set.md
Options
--enable whether to enable proxy
--http_proxy <http_proxy_value> Specify the http_proxy.
--https_proxy <https_proxy_value> Specify the https_proxy.
-h, --help Display help for command
There are two ways to set up proxy:
-
Configure directly, for example:
s set proxy --http_proxy xxxx:xxx --https_proxy xxxx:xxx --enable
-
Through the interactive method, configure:
$ s set proxy ? Please enter http_proxy: xxxx:xxx ? Please enter https_proxy: xxxx:xxx ? Do you want to enable proxy Yes
set analysis command
With this command, you can configure the data analysis capabilities of the Serverless Devs developer tools.
Execute the s set analysis -h
command, you can see the help document
$ s set analysis -h
Usage: s set analysis [options]
Set analysis action.
Example:
$ s set analysis
$ s set analysis disable
Options:
-h, --help Display help for command
There are two ways to set up analysis:
- Configure directly, for example:
s set analysis disable
- Through the interactive method, configure:
At this point, you only need to select the corresponding option, and you can operate in a guided manner.
$ s set analysis π Current analysis action: enable ? Choose an action? (Use arrow keys) β― enable disable
π Note: The system default analysis is:
enable
set log command
With this command, you can configure the data log capabilities of the Serverless Devs developer tools.
Execute the s set log -h
command, you can see the help document
$ s set log -h
Usage: s set log [options]
Set log action.
Example:
$ s set log
$ s set log disable
Options:
-h, --help Display help for command
There are two ways to set up log:
- Configure directly, for example:
s set log disable
- Through the interactive method, configure:
At this point, you only need to select the corresponding option, and you can operate in a guided manner.
$ s set log π Current log action: enable ? Choose an action? (Use arrow keys) β― enable disable
π Note: The system default log is:
enable
set workspace command
With this command, you can configure the default path of the Serverless Devs developer tools.
Execute the s set workspace -h
command to see the help documentation
$ s set workspace -h
Usage: s set workspace [options]
Set workspace path. Switching workspaces may make previously cached components and configured key information unavailable.
Example:
$ s set workspace
$ s set workspace ~/.s
Options:
-h, --help Display help for command
There are two ways to set the workspace:
- Configure directly, for example:
s set workspace ~/.s
- Through the interactive method, configure:
At this point, you only need to select the corresponding option, and you can operate in a guided manner.
$ s set workspace π Current workspace path: ~/.s π Switching workspaces may make previously cached components and configured key information unavailable. ? Please input an absolute path:
π Note: The default workspace of the system is:
~/.s