Updated on 2023-02-27 GMT+08:00

Installing KooCLI in Linux

KooCLI can be run on Linux AMD64 or Linux Arm64. You can install the CLI with one click or in several steps. If you choose step-by-step installation, use the installation command that matches your OS. Run the following command to query the OS used by your host:

echo $HOSTTYPE

If the command output is x86_64, use the download command for AMD64. If the command output is aarch64, use the download command for Arm64.

One-Click Installation

Run the following command to install KooCLI:
curl -sSL https://eu-west-101-apiexplorer-cli.obs.eu-west-101.myhuaweicloud.eu/cli/latest/hcloud_install.sh -o ./hcloud_install.sh && bash ./hcloud_install.sh

By default, KooCLI is downloaded to the /usr/local/hcloud/ directory. A symbolic link is created for KooCLI in the /usr/local/bin/ directory.

You can modify the file download directory based on the interaction information during command execution. If you do not have sufficient permissions, switch to user root and run the installation command again.

To use the default configuration and skip the interaction, add -y to the end of the command as follows:

curl -sSL https://eu-west-101-apiexplorer-cli.obs.eu-west-101.myhuaweicloud.eu/cli/latest/hcloud_install.sh -o ./hcloud_install.sh && bash ./hcloud_install.sh -y

Step-by-Step Installation

Perform the following steps:

  1. Run one of the following commands to download KooCLI:

    • curl commands
      • Download command for AMD64
        curl -LO "https://eu-west-101-apiexplorer-cli.obs.eu-west-101.myhuaweicloud.eu/cli/latest/huaweicloud-cli-linux-amd64.tar.gz"
      • Download command for Arm64
        curl -LO "https://eu-west-101-apiexplorer-cli.obs.eu-west-101.myhuaweicloud.eu/cli/latest/huaweicloud-cli-linux-arm64.tar.gz"
    • wget commands
      • Download command for AMD64
        wget "https://eu-west-101-apiexplorer-cli.obs.eu-west-101.myhuaweicloud.eu/cli/latest/huaweicloud-cli-linux-amd64.tar.gz" -O huaweicloud-cli-linux-amd64.tar.gz
      • Download command for Arm64
        wget "https://eu-west-101-apiexplorer-cli.obs.eu-west-101.myhuaweicloud.eu/cli/latest/huaweicloud-cli-linux-arm64.tar.gz" -O huaweicloud-cli-linux-arm64.tar.gz

  2. Decompress the tool package.

    • Decompression command for AMD64
      tar -zxvf huaweicloud-cli-linux-amd64.tar.gz
    • Decompression command for Arm64
      tar -zxvf huaweicloud-cli-linux-arm64.tar.gz

  3. (Optional) Create a symbolic link for KooCLI or add its directory to the $PATH variable so that you can use hcloud commands in any directory.

    • Create a symbolic link for KooCLI in the /usr/local/bin/ directory.
      ln -s $(pwd)/hcloud /usr/local/bin/

      After creating a symbolic link in the /usr/local/bin/ directory, you do not need to add the directory of CLI to the $PATH variable.

    • Add the directory of KooCLI to the $PATH variable.
      export PATH=$PATH:$(pwd)/

  4. (Optional) Run the following command to turn on autocomplete:

    hcloud auto-complete on

    If the following information is displayed, autocomplete is turned on. If the configuration does not take effect, run the bash command as prompted.

    hcloud auto-complete on
    Autocomplete (bash only) turned on. If it does not work, run the `bash` command.

  5. (Optional) Run the following command to check whether the installation is successful:

    hcloud version

    If version information similar to the following is displayed, the installation is successful:

    hcloud version
    Current KooCLI version: 3.2.8