Function Compute Command Line Interface (fcli) is a command line tool provided by Alibaba Cloud Function Compute to help you manage resources in Function Compute. If you use fcli for the first time, you must download and configure it.

Download fcli

Download and decompress the fcli package. For more information, see aliyun/fcli.

Configure fcli

If you use fcli for the first time, you must configure it. Function Compute allows you to configure fcli in the following methods:

Method 1

Run the fcli shell command to configure fcli.

  1. In the folder where the fcli executable file is located, run the fcli shell command.
  2. Enter the Alibaba Cloud account ID, AccessKey ID, and AccessKey secret, and select a region.

    You can obtain your Alibaba Cloud account ID from Account Management and the AccessKey ID and AccessKey secret from User Management.

    ? Alibaba Cloud Account ID <your account ID>
    ? Alibaba Cloud Access Key ID <your AccessKey ID>
    ? Alibaba Cloud Access Key Secret <your Accesskey Secret>
    ? Default region name cn-shanghai
    Store the configuration in: .fcli
    Welcome to the function compute world. Have fun!
    >>>          
    Then, the config.yaml file is generated in the folder where the fcli executable file is located.

Method 2

Run the fcli config command to configure fcli.

  1. In the folder where the fcli executable file is located, run the fcli config command.
  2. Enter the Alibaba Cloud account ID, AccessKey ID, and AccessKey secret, and select a region.

    You can obtain your Alibaba Cloud account ID from Account Management and the AccessKey ID and AccessKey secret from User Management.

    ? Alibaba Cloud Account ID <your account ID>
    ? Alibaba Cloud Access Key ID <your AccessKey ID>
    ? Alibaba Cloud Access Key Secret <your Accesskey Secret>
    ? Default region name cn-shanghai
    Store the configuration in: .fcli         
    Then, the config.yaml file is generated in the folder where the fcli executable file is located.

Method 3

Configure the YAML file.

  1. Open the ~/.fcli/config.yaml file.
  2. Set the parameters as needed and save the configurations.
    endpoint: https://<account ID>.<region ID>.fc.aliyuncs.com:8080
    api_version: 2016-08-15
    access_key_id: <your AccessKeyID>
    access_key_secret: <your AccessKeySecret>
    security_token: ""
    user_agent: fcli-0.1
    debug: false
    timeout: 60
    sls_endpoint: <region ID>.log.aliyuncs.com
    Note The account corresponding to the account ID, AccessKey ID, and AccessKey secret must be an Alibaba Cloud account.

    You can obtain your Alibaba Cloud account ID from Account Management and the AccessKey ID and AccessKey secret from User Management.

fcli command set

Function Compute provides a set of fcli commands for developers. Developers can also run the fcli --help command in the folder where the executable file is located to query command details.