tencent cloud

Feedback

Initialize the sample project

Last updated: 2022-03-15 16:08:06
This document is currently invalid. Please refer to the documentation page of the product.

    The initialization capability of SCF CLI allows you to quickly create a simple template project for further development. The newly created template project has the required code and configuration file. It can be directly packaged or further modified for deployment.

    Initialization Command

    Initialize a project by running the scf init command.

    Parameter Descriptions

    The parameters supported by the scf init command are as follows:

    Parameter Short Form Required Description Example
    name -n No Name of the generated project, which is demo by default if left blank. test
    runtime -r No Runtime environment of the generated project. Value range: nodejs6.10, python2.7, nodejs 8.9, python3.6, php5, php7, go1. Default value: python3.6. python2.7
    output-dir -o No Specifies the directory generated by the project, which is the current directory by default. /root/scf/code
    location -l No Specifies the path to an existing project, which can be git, mercurial, http(s), zip, or path. The project must be generated by cookiecutter. -

    Use Cases

    Run the following command to create a project named testproject for Python 2.7 in the /Users/xxx/code/scf directory.

    $ scf init --runtime python2.7 --name testproject --output-dir /Users/xxx/code/scf/
    [+] Initializing project...
    Template: gh:NevenMoore/demo-python
    Output-Dir: /Users/xxx/code/scf/
    Project-Name: testproject
    "Runtime": "Python2.7"
    [*] Project initialization is complete
    
    $ tree /Users/xxx/code/scf/testproject
    /Users/xxx/code/scf/testproject
    ├── README.md
    ├── main.py
    └── template.yaml
    
    1 directory, 3 files
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support