Set command

The set commands are used to configure tools.

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:

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:

  1. Provide Registry information directly, for example:s set registry http://registry.devsapp.cn/simple
  2. Run the command in interactive mode. Example:
    $ 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 
    
    Then, follow instructions to select options based on your business requirements.

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. 图片alt

πŸ™Š 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:

  1. Configure directly, for example:s set proxy --http_proxy xxxx:xxx --https_proxy xxxx:xxx --enable

  2. 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:

  1. Configure directly, for example: s set analysis disable
  2. Through the interactive method, configure:
    $ s set analysis
    
    πŸ“ Current analysis action: enable
    
    ? Choose an action? (Use arrow keys)
    ❯ enable
      disable
    
    At this point, you only need to select the corresponding option, and you can operate in a guided manner.

πŸ™Š 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:

  1. Configure directly, for example: s set log disable
  2. Through the interactive method, configure:
    $ s set log
    
    πŸ“ Current log action: enable
    
    ? Choose an action? (Use arrow keys)
    ❯ enable
      disable
    
    At this point, you only need to select the corresponding option, and you can operate in a guided manner.

πŸ™Š 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:

  1. Configure directly, for example: s set workspace ~/.s
  2. Through the interactive method, configure:
    $ s set workspace
    
    πŸ“ Current workspace path: ~/.s
    
    πŸ™Š Switching workspaces may make previously cached components and configured key information unavailable.
    
    ? Please input an absolute path:
    
    At this point, you only need to select the corresponding option, and you can operate in a guided manner.

πŸ™Š Note: The default workspace of the system is: ~/.s

Edit this page on GitHub Updated at Fri, Nov 24, 2023