Getting started with fcli
fcli is the command line interface (CLI) for Alibaba Cloud Function Compute. You can use fcli to manage Function Compute resources. If you are using fcli for the first time, you must download and configure it.
Download fcli
Download the fcli installation package and extract the package.
Configure fcli
If you are using fcli for the first time, you must configure it. You can use one of the following methods:
Method 1
Configure fcli using the fcli shell command.
In the folder that contains the fcli executable file, run the
fcli shellcommand.Follow the prompts to enter your Alibaba Cloud account ID, AccessKey ID, and AccessKey secret. Then, select a region.
You can obtain your Account ID from Account Management and your AccessKey ID and AccessKey secret from User Information 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! >>>After you complete the configuration, a config.yaml file is created in the folder that contains the fcli executable file.
Method 2
Configure fcli using the fcli config command.
In the folder that contains the fcli executable file, run the
fcli configcommand.Follow the prompts to enter your Alibaba Cloud account ID, AccessKey ID, and AccessKey secret. Then, select a region.
You can obtain your Account ID from Account Management and your AccessKey ID and AccessKey secret from User Information 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: .fcliAfter you complete the configuration, a config.yaml file is created in the folder that contains the fcli executable file.
Method 3
Configure the YAML file manually.
Open the ~/.fcli/config.yaml file.
Enter your values for the parameters and save the file.
endpoint: https://<account ID>.<region ID>.fc.aliyuncs.com 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.comNoteThe account ID, AccessKey ID, and AccessKey secret must belong to a root account.
You can obtain your Account ID from Account Management and your AccessKey ID and AccessKey secret from User Information Management.
fcli command set
Function Compute provides a set of fcli commands. To view details about the commands, run the fcli --help command in the folder that contains the executable file.