Help Center/ SecMaster/ CLI Reference/ How to Use KooCLI
Updated on 2026-08-27 GMT+08:00

How to Use KooCLI

Huawei Cloud Koo Command Line Interface (KooCLI), previously named "HCloud CLI", is designed to manage Huawei Cloud service APIs released on API Explorer. With KooCLI, you can call the open APIs of CFW to manage and use your CFW resources. For details about KooCLI, see What Is KooCLI?

Installing KooCLI

Before using KooCLI, install it. KooCLI is compatible with Windows, Linux, and macOS. Install the required version.

Initializing KooCLI Configuration

Your identity information is obtained for authentication when you use KooCLI to call APIs. By configuring KooCLI initialization, you can store your permanent AK/SK information in the configuration file. In this way, you do not need to frequently enter the fixed information when calling APIs.

Skip this step if you intend to pass authentication parameters directly in commands instead of using the configuration file. For details, see Using KooCLI in Non-configuration Mode.

The following uses Windows as an example to describe how to initialize KooCLI configuration. The operations on Linux and macOS are similar. Before the initialization, obtain the AK/SK information. For details, see Access Keys.

  1. Open the CLI.
  2. Run the following commands to initialize the configuration:
    hcloud configure init
  3. Enter the parameter values as prompted.
    Access Key ID [required]: //Mandatory. Enter the AK.
     Secret Access Key [required]: //Mandatory. Enter the SK. The system anonymizes the entered content.
     Secret Access Key (again): //Mandatory. Enter the SK again. The system anonymizes the entered content.
     Region: //Optional. Enter a region.

    After the configuration is complete, the system displays a message indicating that the initial configuration is successful.

Generating and Executing CLI Commands

KooCLI supports two methods for generating commands:

  • Use API Explorer to quickly generate and obtain the CLI command for calling an API. You are advised to use API Explorer to obtain CLI commands.
  • Use CLI commands to query the operation commands and related parameters of APIs, and then manually combine the CLI commands to call the APIs. For details, see Step 4: View and Run Cloud Service Operation Commands.

    The following uses the Querying the Recipient Status API of SecMaster as an example to describe how to generate a CLI command in API Explorer and then run the CLI command to call the API.

    1. In API Explorer, select SecMaster from the cloud service drop-down list and v1 for Version. In the API list, choose Security Reports > ListRecipientsStatus.
    2. On the parameter configuration page in the middle, set the parameters required for calling the API.
    3. In the right pane, click the CLI Example tab to view the generated CLI commands.

      The following is an example of the CLI command for the API:

      hcloud SecMaster ListRecipientsStatus/v1 --cli-region="cn-east-3" --workspace_id="6944735d-2314-49f5-a4a2-855xxxx3e7fc" --project_id="e3e9e6834f4440039782xxxx4f5b16d1" --email_address="10xxxx1323@qq.com"
    4. Copy the generated CLI commands and paste them into the CLI for execution.

      The following is an example of the CLI command output for the API:

      [ { "address" : "10xxxx1323@qq.com", "confirm_status" : "FINISH" } ]