tencent cloud


Creating Functions on CLI

Last updated: 2021-08-11 10:24:56


    This document describes how to use the SCF component provided by Serverless Framework to quickly create and deploy an SCF project. For more information on components and how to use them, please see Components Overview


    The SCF CLI tool has been disused since February 2020. We recommend you use the more rich-featured and convenient Serverless Framework CLI tool for project development.



    Creating function

    Run the following command to quickly create a function in the Node.js language:

    sls init scf-demo

    scf-demo in the command is the Node.js template by default, and you can replace it with function templates in other languages, such as scf-golang, scf-php, and scf-python.

    Deploying function

    Run the following command in the scf-demo directory to deploy the function:

    sls deploy

    A QR code will pop up. Please scan it to authorize and start deployment. After successful deployment, SCF resources will be automatically created.


    If authentication fails, please authorize as instructed in Account and Permission Configuration.

    View function information

    Run the following command to view the information of the deployed SCF resources:

    sls info

    Removing function

    Run the following command to remove the deployed SCF resources:

    sls remove

    Relevant Features

    • For more information on how to use Serverless Framework CLI to manipulate SCF functions, please see Serverless Framework CLI.
    • Serverless Web IDE is a browser-based integrated development environment. It delivers an on-cloud development experience comparable to native IDEs. For more information on its features for SCF, please see Serverless Web IDE.
    • The SCF SDK integrates function business flow APIs, which simplifies the invocation of functions. For more information on its feature for functions, please see SDK for Python and SDK for Node.js.
    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