Funcraft is a command-line tool provided by Function Compute. This tool allows you to easily manage the resources of Function Compute, API Gateway, and Log Service. You can use Funcraft to develop, build, and deploy resources based on the resource configuration file template.yml. This topic describes how to install Funcraft.

Notice This topic is no longer maintained. If you use Funcraft to manage your Function Compute resources, we recommend that you migrate your resources to Serverless Devs and use Serverless Devs to manage your resources.

For more information about how to migrate Function Compute-related resources from Funcraft to Serverless Devs, see Migrate resources from Funcraft to Serverless Devs.

For more information about Serverless Devs, see What is Serverless Devs?.

For more information about how to install Serverless Devs, see Install Serverless Devs.

We apologize for any inconvenience caused.

Step 1: Install Funcraft

You can use one of the following methods to install Funcraft:

  • Use Node Package Manager (npm). This method is applicable to Windows, macOS, and Linux operating systems in which npm is installed.
    1. Run the following command to install Funcraft:

      npm install @alicloud/fun -g
      Note
      • If the Error: EACCES: permission denied error message appears in Linux or macOS after the preceding command is run, run the sudo npm install @alicloud/fun -g command.
      • If the installation takes an extended period of time, you can run the npm --registry=https://registry.npmmirror.com install @alicloud/fun -g command to use the Taobao npm source.
    2. After the installation is complete, run the following command to view the version information:

      fun --version
  • Download a binary package. This method is applicable to Windows, macOS, and Linux operating systems. Perform the following steps to install Funcraft:
    1. On the Releases page, click the corresponding download link to download the package of the latest version that suits your operating system.

    2. After the package is downloaded, decompress the package. Then, you can use Funcraft.

    The following content describes how to install Funcraft in different operating systems in detail:

    • Windows
      1. On the Releases page, download the latest released package named fun-*-win.exe.zip, where the asterisk (*) indicates the version number such as v3.6.24.
      2. Decompress the fun-v3.6.24-win.exe.zip package to obtain the fun-v3.6.24.win.exe file. Rename the file as fun.exe.
      3. Add the fun.exe file to the PATH directory such as C:\WINDOWS\System32.
      4. Open the command terminal and run the fun.exe --version command to check whether Funcraft is installed and view the version number.
    • Linux
      1. On the Releases page, view the latest released package. For example, Release 3.6.24 indicates that the version number is v3.6.24.
      2. Open a terminal such as Bash or Zsh and run the following command to download Funcraft.
        Notice If a later version of Funcraft is available, replace v3.6.24 in https://funcraft-release.oss-cn-hangzhou.aliyuncs.com/fun/fun-v3.6.24-linux.zip with the latest version number.
        curl -o fun-linux.zip https://funcraft-release.oss-cn-hangzhou.aliyuncs.com/fun/fun-v3.6.24-linux.zip
        Expected output:
        % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                         Dload  Upload   Total   Spent    Left  Speed
        100 51.2M  100 51.2M    0     0  17.0M      0  0:00:03  0:00:03 --:--:-- 14.3M
      3. Run the following command to decompress the ZIP package:
        unzip fun-linux.zip
        Expected output:
        Archive:  fun-linux.zip
          inflating: fun-v3.6.24-linux
      4. Run the following command to move the extracted file to the PATH directory.
        Notice If a later version of Funcraft is available, replace v3.6.24 in the command with the latest version number.
        mv fun-v3.6.24-linux /usr/local/bin/fun
      5. Run the following command to check whether the latest Funcraft version is installed:
        fun --version
        Expected output:
        3.6.24
    • macOS
      1. On the Releases page, view the latest released package. For example, Release 3.6.24 indicates that the version number is v3.6.24.
      2. Open a terminal such as Bash or Zsh and run the following command to download Funcraft.
        Notice If a later version of Funcraft is available, replace v3.6.24 in https://funcraft-release.oss-cn-hangzhou.aliyuncs.com/fun/fun-v3.6.24-macos.zip with the latest version number.
        curl -o fun-macos.zip https://funcraft-release.oss-cn-hangzhou.aliyuncs.com/fun/fun-v3.6.24-macos.zip
        Expected output:
        % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                         Dload  Upload   Total   Spent    Left  Speed
        100 47.8M  100 47.8M    0     0   724k      0  0:01:07  0:01:07 --:--:-- 3727k
      3. Run the following command to decompress the ZIP package:
        unzip fun-macos.zip
        Expected output:
        Archive:  fun-macos.zip
          inflating: fun-v3.6.24-macos
      4. Run the following command to move the extracted file to the PATH directory.
        Notice If a later version of Funcraft is available, replace v3.6.24 in the command with the latest version number.
        mv fun-v3.6.24-macos /usr/local/bin/fun
      5. Run the following command to check whether the latest Funcraft version is installed:
        fun --version
        Expected output:
        3.6.24

Step 2: (Optional) Install Docker

You must install Docker in the development environment if you want to compile and install dependencies or perform local debugging by using the fun install, fun build, or fun local command of Funcraft.

For more information about how to download other editions of Docker, visit Docker Hub.

What to do next

Configure Funcraft