Query the total number of Huawei Cloud services available through KooCLI offline metadata. Returns the count of all supported cloud services from the cached service catalog. Triggers include: "how many Huawei Cloud services", "count Huawei Cloud services", "华为云服务总数", "华为云有多少个服务", "查询华为云服务数量".
编程
huawei-cloud-cli-guidance
试用Provides guidance for Huawei Cloud KooCLI command-line tool operations. Covers KooCLI installation, IAM authentication configuration, access credential confi...
它能做什么
Provides guidance for Huawei Cloud KooCLI command-line tool operations. Covers KooCLI installation, IAM authentication configuration, access credential configuration, command construction, common error troubleshooting. Use this skill when users ask about any cloud-related services or wants to operate Huawei Cloud services from the terminal. Triggers: Huawei Cloud, huaweiyun, "华为云","华为cli", "命令行", KooCLI, hcloud, huaweiyunCLI, Huawei Cloud command line, OBS, ECS, VPC, "云", yun, huaweiyun tool, huawei tool, "华为云工具", "云工具", "工具"
技能文档
huawei cloud cli guidance
Overview
Huawei Cloud KooCLI command-line tool guidance skill, providing comprehensive KooCLI usage guide. This skill covers core functionalities including KooCLI installation, authentication configuration, command construction, common error troubleshooting, helping users efficiently manage Huawei Cloud resources.
Attention
- Any issues encountered during the use of koocli must be addressed by prioritizing the guidance steps provided in this skill. [MUST][IMPORTANT]
- It is essential to read this document in its entirety and make full use of its guidance during the process.[MUST][IMPORTANT]
Prerequisites
- KooCLI Version: 7.2.2 or higher
- Huawei Cloud Account: Valid Huawei Cloud account with corresponding access permissions
- Authentication Credentials: Access Key (AK) and Secret Key (SK) or IAM user credentials
- Network Connection: Accessible Huawei Cloud service endpoints
- Operating System: Linux, macOS, or Windows (WSL supported)
KooCLI Command Format Standard
Huawei Cloud KooCLI adopts a unified command format:
hcloud [parameters] [options]
Command Structure
hcloud: Command-line tool name- ``: Cloud service name (e.g., ECS, VPC, OBS, etc.)
- ``: API operation name (e.g., ListInstances, CreateVpc, etc.)
[parameters]: Operation parameters (e.g., instance_id, vpc_name, etc.)[options]: Global options (e.g., --cli-region, --cli-output, etc.)
Parameter Format Rules
- Required parameters: Directly specified in the command, e.g.,
--instance_id i-12345678 - Optional parameters: Represented with square brackets, e.g.,
[--description "instance description"] - Authentication parameters: Use
--cli-prefix, e.g.,--cli-profile,--cli-region - Output parameters: Use
--cli-outputto specify output format (json/table/tsv) - Query parameters: Use
--cli-queryto perform JMESPath query filtering
Scenario Routing
Installation Scenario
- User asks about KooCLI installation → Jump to "1. Install KooCLI"
- User needs to verify installation → Check version command
hcloud version
Authentication Scenario
- User needs to configure authentication → Jump to "2. Configure koocli"
- User asks about different authentication modes → Choose Profile mode, explicit parameter mode, etc. based on requirements
Command Execution Scenario
- User needs to execute specific operations → Guide to use
hcloud --helpto query available operations - User encounters errors → Jump to "8. Common issues" for troubleshooting
Output Formatting Scenario
- User needs specific format output → Use
--cli-output=json/table/tsv - User needs to filter results → Use
--cli-queryfor JMESPath querying
Core Commands
refer to '../references/core-commands.md'
Architecture:
Cloud Service OpenAPI
|
| ECS API / VPC API / RDS API / OBS API / IAM API ...
v
Service Metadata JSON API Definition
|
| Description:
| - Service name
| - API version
| - Request method GET / POST / PUT / DELETE...
| - URI path
| - Request parameters
| - Response structure
| - Authentication method
| - Region and Endpoint
v
KooCLI Core
|
| Read metadata
| Generate commands
| Validate parameters
| Assemble HTTP requests
| Signature authentication
| Call OpenAPI
v
Dynamically Generated Commands
|
| hcloud [parameters]
v
Unified Execution Engine
|
| Execute requests
| Return results
v
Huawei Cloud Resource Operation Results
Understand the logic and process of KooCLI managing Huawei Cloud resources. Every time Huawei Cloud service is called or problems are encountered during the process, you must refer to and understand the architecture again, clarifying current steps and subsequent steps. [Required]
Applicable Scenarios
- Install koocli
- Configure IAM, AK, SK, region, profile
- Manage Huawei Cloud resources
1. Install KooCLI
- Check local version
hcloud version
Expected output: Current KooCLI version: 7.2.2 or higher.
- One-click installation (skip this step if local version check passes)
# Universal for all platforms
curl -sSL https://cn-north-4-hdn-koocli.obs.cn-north-4.myhuaweicloud.com/cli/latest/hcloud_install.sh -o ./hcloud_install.sh && bash ./hcloud_install.sh
# Non-interactive installation
curl -sSL https://cn-north-4-hdn-koocli.obs.cn-north-4.myhuaweicloud.com/cli/latest/hcloud_install.sh -o ./hcloud_install.sh && bash ./hcloud_install.sh -y
After installation completes, check if local installation was successful.
Important: No additional operations allowed!!! Any file content changes must obtain user permission.
If more detailed installation guidance is needed, refer to ./references/installation-guide.md
2. Configure koocli
Credential Configuration
After koocli download is complete, ask the user which way they want to use koocli [Required]
1. koocli provides a configuration-free usage method, only requiring passing current user authentication-related parameters directly in commands.
2. If the user chooses non-interactive method to add configuration items, execute hcloud configure init, guide the user to input each parameter value.
When using koocli to manage Huawei Cloud resources requires other permissions, refer to '../references/iam-policies.md'
3. ecsAgency
When the user has successfully established a delegation to Elastic Cloud Server (ECS), when using KooCLI within the ECS server, you can specify "--cli-mode=ecsAgency" in commands. KooCLI will automatically obtain temporary AK/SK and SecurityToken for authentication based on ECS delegation.
4. AssumeRole
When the delegator user creates a delegation and hands over resources to another account for management, the delegatee can add "--cli-agency-domain-id"/"--cli-agency-domain-name", "--cli-agency-name" and "--cli-source-profile" options to commands, using the configuration-free method to AssumeRole and call cloud service APIs, managing and using the delegator's resources:
hcloud VPC ListAddressGroup/v3 --cli-region="cn-north-4" --project_id="2cc60****************caefa5019ef" --cli-agency-domain-id=13534326******************5cf67b --cli-agency-name=****** --cli-source-profile=test
{
"request_id": "29ec21****************6d6b4cdd82",
"address_groups": [],
"page_info": {
"current_count": 0
}
}
5. SSO Login
KooCLI's SSO login command stores user authentication information in configuration files by completing SSO login, avoiding frequent input of these fixed information during operation execution. SSO login can be performed with the following command: hcloud configure sso
# SSO profile name (configuration item name to save after SSO login, required), SSO start URL (user portal URL, required), SSO region (region where IAM Identity Center is opened, required), Region (default or commonly used region, optional)
hcloud configure sso
? Input SSO profile name [required]: sso
? Input SSO start URL [required]: https://idcenter.huaweicloud.com/d-3********6/portal
? Input SSO region [required]: cn-north-4
? Input Region: cn-north-4
Browser page has been opened, waiting for you to complete SSO login...
? Choose account name: ACCOUNT_01
? Choose permission set name: PERMISSION_01
SSO login successful
6. Authentication Modes
KooCLI configuration item authentication mode values are AKSK, ecsAgency, SSO, AssumeRole. AKSK is recommended. When the configuration item being used has multiple authentication mode-related parameters configured simultaneously, use the "--cli-mode" option to specify the configuration item's authentication mode:
When setting configuration items, you need to specify the configuration item name with "--cli-profile", and also add corresponding authentication parameters based on the authentication mode "--cli-mode":
If the configuration item's authentication mode is "AKSK", then the values of "--cli-access-key" and "--cli-secret-key" in the configuration command cannot be empty;
If the configuration item's authentication mode is "ecsAgency", then specify "--cli-mode=ecsAgency" in the configuration command;
If the configuration item's authentication mode is "SSO", then the values of "--cli-sso-start-url" and "--cli-sso-region" in the configuration command cannot be empty;
If the configuration item's authentication mode is "AssumeRole", then the values of "--cli-agency-domain-id"/"--cli-agency-domain-name", "--cli-agency-name", "--cli-source-profile" in the configuration command cannot be empty.
7. Authentication Mode Selection
Use and only use one authentication method:
| Mode | Applicable Scenario | Start Command | Cleanup |
|---|---|---|---|
| Profile Mode | Agent sessions, multiple calls | hcloud configure init --cli-profile agent-profile | Temporary profiles need cleanup |
| Explicit Parameter Mode | One-time commands, CI/CD | Pass authentication parameters in each command | No local configuration |
| Existing Profile Mode | User already configured | --cli-profile | Do not modify configuration |
Profile Mode Configuration
# Create dedicated profile
hcloud configure init --cli-profile agent-profile
# View configuration
hcloud configure list
# Execute commands using profile
hcloud \
--cli-profile agent-profile \
--cli-region cn-north-4 \
--cli-output=json
Explicit Parameter Mode
# Using permanent AK/SK
hcloud \
--cli-access-key \
--cli-secret-key \
--cli-region cn-north-4
# Using temporary credentials
hcloud \
--cli-access-key \
--cli-secret-key \
--cli-security-token \
--cli-region cn-north-4
Multi-Environment Management
Create independent profiles for different environments:
dev: Development environmenttest: Test environmentprod: Production environment
Explicitly specify when calling:
hcloud \
--cli-profile dev \
--cli-region cn-north-4
3. Consult --help before constructing any command
Help output is the authoritative source. [Important]
Execute help output as follows:
- Use
hcloud --helpcommand to query the list of cloud services supported by KooCLI. After obtaining accurate cloud service names, proceed to next step. - Use
hcloud --helpcommand to query the service'soperationlist. Find out what operations the service has, obtain the operation the user needs, then continue. - Use
hcloud --helpto query the help information for the specific cloud serviceoperation. - After executing the API call command, print the output result to the user
4. Ensure service availability
When users ask about or want to execute corresponding service management, you should also execute the previous step's help query to ensure the service exists and is available.
5. OBS usage commands
In KooCLI, some functionality of the obsutil tool for managing OBS data via command line has been integrated. Specific functions and commands strictly refer to and execute according to the help output steps mentioned above.
If the operation is not found, you need to prompt the user to install obsutil to obtain complete functionality and explain the reason.
*** OBS Command Explanation: ***
OBS-related commands in KooCLI may exist in two forms:
1. OpenAPI style:
hcloud OBS
2. OBS integrated commands / obsutil style:
hcloud obs
The two have different parameter systems, must check help separately before execution:
hcloud OBS --help
hcloud OBS --help
hcloud obs help
hcloud obs help
6. Filter and format output
KooCLI supports three output formats: json, table, tsv. Default output is in json format.
You can use the "--cli-output" parameter to specify any of the aforementioned output formats, and you can also use the "--cli-query" option with JMESPath expression to perform JMESPath query on json results, filtering out information the user needs.
| Parameter | Parameter Purpose |
|---|---|
| cli-output | cli-o response data output format, can be one of: json, table, tsv |
| cli-query | cli-query JMESPath path for filtering response data |
| cli-output-num | cli-output-num whether to print line numbers in table output. Values: true or false |
Output Format Control
# JSON format (recommended for Agent)
hcloud \
--cli-profile agent-profile \
--cli-region cn-north-4 \
--cli-output=json
# Table format (suitable for manual viewing)
hcloud \
--cli-profile agent-profile \
--cli-region cn-north-4 \
--cli-output=table
# Text format
hcloud \
--cli-profile agent-profile \
--cli-region cn-north-4 \
--cli-output=text
JMESPath Filtering
Use --cli-query to extract specific fields:
# Extract specific fields
hcloud \
--cli-profile agent-profile \
--cli-region cn-north-4 \
--cli-output=json \
--cli-query "items[].{ID:id,Name:name,Status:status}"
# Filter specific status
hcloud \
--cli-profile agent-profile \
--cli-region cn-north-4 \
--cli-output=json \
--cli-query "items[?status=='ACTIVE'].{ID:id,Name:name,Status:status}"
Note: JMESPath query fields must be written according to actual JSON return structure, cannot assume all list interfaces return items.
7. Debugging
When troubleshooting KooCLI command failures, first add --cli-debug=true after the specific execution command to view underlying requests, responses, endpoints, parameter parsing, and authentication-related information.
8. Common issues
KooCLI divides errors encountered during command calls into five types, declaring their specific type at the beginning of error prompt messages. The positioning methods for various errors are as follows:
- [NETWORK_ERROR]: Usually HTTP request exceptions, please check network connection;
- [CLI_ERROR]: Usually errors caused by KooCLI's own exceptions during command processing, please contact KooCLI oncall for assistance;
- [USE_ERROR]: Usually errors caused by incorrect parameters in commands, please make corresponding modifications according to error prompts;
- [OPENAPI_ERROR]: Usually errors occurring when calling cloud service APIs, please contact relevant cloud service oncall for assistance;
- [APIE_ERROR]: Usually errors occurring when calling API Explorer to obtain metadata, please contact API Explorer cloud service oncall for assistance.
When encountering errors, query help based on error type and interact with users step by step to resolve.
9. Security
Credential Security
- Never expose AK/SK values in conversations or commands (
echo $ACCESS_KEY_IDis prohibited) - Never let users directly input AK/SK in conversations
- Never use
hcloud configure setto pass plaintext credentials - Only use
hcloud configure listto check credential status - Cloud environments recommend using IAM users rather than main accounts
- Enable MFA (Multi-Factor Authentication) for sensitive operations
Operation Security
- Must obtain user confirmation before modification operations (security group rules, restart, deletion, etc.)
- Prefer read-only APIs, avoid modifying resource status
- Production environment operations require risk warnings
- Sensitive information must never appear in report output (AK/SK, passwords, etc.)
Configuration Security
- Use independent profiles for different environments
- Regularly rotate credentials
- Use principle of least privilege
- Clean up temporary profiles
- Encrypt sensitive configuration information
Parameter Verification
Global Parameters
| Parameter | Description | Example |
|---|---|---|
--cli-profile | Configuration file name | --cli-profile dev |
--cli-region | Region | --cli-region cn-north-4 |
--cli-output | Output format | --cli-output=json |
--cli-query | JMESPath query | --cli-query "items[].{ID:id,Name:name}" |
--cli-debug | Debug mode | --cli-debug=true |
Authentication Parameters
| Authentication Mode | Required Parameters | Optional Parameters |
|---|---|---|
| AKSK | --cli-access-key, --cli-secret-key | --cli-security-token |
| Profile | --cli-profile | --cli-mode, --cli-region |
| ECS Agency | --cli-mode=ecsAgency | --cli-region |
| SSO | --cli-sso-start-url, --cli-sso-region | --cli-profile, --cli-region |
| AssumeRole | --cli-agency-domain-id, --cli-agency-name, --cli-source-profile | --cli-region |
Service-Specific Parameters
Use hcloud --help to view parameter list for specific operations.
Output Format
KooCLI supports three output formats:
JSON Format (Default)
hcloud ECS ListInstances/v3 --cli-region=cn-north-4 --cli-output=json
Applicable Scenarios: Automated scripts, API integration, data extraction
Table Format
hcloud ECS ListInstances/v3 --cli-region=cn-north-4 --cli-output=table
Applicable Scenarios: Manual viewing, quick browsing
TSV Format
hcloud ECS ListInstances/v3 --cli-region=cn-north-4 --cli-output=tsv
Applicable Scenarios: Import to spreadsheets, data processing
JMESPath Query
hcloud ECS ListInstances/v3 --cli-region=cn-north-4 --cli-output=json --cli-query "servers[?status=='ACTIVE'].{ID:id,Name:name,Status:status}"
Verification Methods
Installation Verification
- Version check:
hcloud versionshould return 7.2.2 or higher - Help verification:
hcloud --helpshould display available service list
Authentication Verification
- Profile verification:
hcloud configure listdisplays configured profile - Permission verification:
hcloud IAM ListUsers/v3 --cli-profiletests IAM permissions
Command Verification
- Help verification: Execute
hcloud --helpfor each service to confirm available operations - Parameter verification: Use
--cli-debug=trueto view parameter parsing results - Response verification: Check HTTP status codes and error messages returned by commands
Environment Verification
- Network connectivity:
curl -s https://ecs.cn-north-4.myhuaweicloud.comtests service endpoint - Certificate verification: Ensure system clock synchronization, certificates are valid
Best Practices
Authentication Management
- Use Profile mode for long-term session management
- Create independent Profiles for different environments (dev/test/prod)
- Regularly rotate AK/SK, avoid using the same credentials long-term
- Use IAM users instead of main account for daily operations
Command Construction
- First query help:
hcloud --help→hcloud --help - Use
--cli-debug=truefor initial command debugging - Gradually add parameters, avoid constructing complex commands at once
- Use
--cli-queryto filter and format output
Error Handling
- Read error type prefixes: [NETWORK_ERROR], [CLI_ERROR], [USE_ERROR], [OPENAPI_ERROR], [APIE_ERROR]
- Check network connectivity: for [NETWORK_ERROR]
- Verify parameter format: for [USE_ERROR]
- Check API documentation: for [OPENAPI_ERROR]
Performance Optimization
- Use
--cli-output=jsonfor automated processing - Properly use
--cli-queryto reduce data transfer - Use scripts instead of interactive commands for batch operations
- Cache frequently used configurations to avoid repetitive input
Notes
Usage Limitations
- Version compatibility: Ensure KooCLI version is compatible with service API versions
- Regional restrictions: Some services are only available in specific regions
- API quotas: Pay attention to API call frequency limits
- Network requirements: Some operations require specific network environments
Common Pitfalls
- Parameter order: Some services are sensitive to parameter order
- JSON format: Complex parameters require correct JSON format
- Region settings: Forgetting to set
--cli-regionresults in operations in default region - Output parsing: Table format output may be truncated due to terminal width
Troubleshooting
- Enable debugging:
--cli-debug=truedisplays detailed request information - Check logs: View log files in
~/.hcloud/logs/ - Version check: Ensure KooCLI version is up to date
- Network diagnostics: Use
curlto test service endpoint reachability
Reference Documents
./references/installation-guide.md— Installation guide./references/cli-troubleshooting.md— Error troubleshooting./references/common-workflows.md— Common workflows./references/parameter-format.md— Parameter format rules./references/service-catalog.md— Service catalog./references/iam-policies.md— IAM policies./references/acceptance-criteria.md— Acceptance criteria./references/core-commands.md— Core commands
相关技能
Queries Huawei Cloud Cloud Connect (CC) resources via hcloud CLI. Covers cloud connection instances (single + list), bandwidth packages (single + list), inter-region bandwidths (single + list), network instances (single + list), cloud connection routes (single + list), and cross-account authorisations (granted + received). No write operations. Use this skill when the user needs to inspect cross-cloud connectivity topology, check bandwidth package status, review inter-region bandwidth allocation, query network instances attached to a cloud connection, troubleshoot routing in Cloud Connect, or audit cross-account authorisation relationships (who authorised whom). Triggers: 云连接, CC, Cloud Connect, 带宽包, bandwidth package, 域间带宽, inter-region bandwidth, 网络实例, network instance, 路由查询, cloud connection route, 跨云网络, cross-cloud connectivity, 授权, authorisation, 被授权, permission, 跨账号, cross-account.
Generate Huawei Cloud Terraform configurations and execute deployment with user-guided approval. Use this skill when users want to create Huawei Cloud infras...
Generate Huawei Cloud pre-order price estimates, safely provision allowlisted resources via hcloud, and guide unsubscribe requests to the console only. Use this skill whenever the user mentions 华为云/Huawei Cloud/hcloud with 报价/询价/价格/quote/pricing/budget, 开通/购买/创建/provision/create, or 退订/unsubscribe. Create requires runtime help, --dryrun, fee review, and confirmation. Never run or emit unsubscribe CLI/API. Refuse other clouds, credentials, payment/renewal/delete, and non-allowlisted writes.
Queries Huawei Cloud billing and fee details only when Terraform needs a billing or pricing inquiry. Covers balances, bills, coupons, cash coupons, stored-value cards, orders, refunds, costs, free resources, resource usage, enterprise accounts, and on-demand/period/ELB/NAT/DCS pricing. No write operations. Use this skill only when Terraform requires billing details, invoice/bill summaries, coupon or balance status, refund/order billing status, or pricing inquiry. Triggers: Terraform 账单查询, Terraform 费用查询, Terraform 价格询价, Terraform 询价, Terraform billing query, Terraform pricing inquiry, Terraform price quote, Terraform bill summary.
Queries Huawei Cloud ECS (Elastic Cloud Server) resources in read-only mode. Covers ECS instances, flavors, keypairs, quotas, server groups, block devices, NICs, VNC console, launch templates, recycle bin, scheduled events, and tags. No write operations. Use this skill when the user needs to query ECS instance details, list flavors, check server status, view block devices, or inspect ECS resource attributes. Triggers include: 查询ECS, ECS实例查询, 云服务器查询, 弹性云服务器, ECS规格, ECS配额, 云服务器列表, ECS详情, query ECS, list ECS servers, show server details, ECS flavors, ECS quotas, ECS keypairs, server groups, block devices, ECS inventory, cloud server list, ecs list, ecs query, ecs show.
huaweicloud-skills-team 的更多技能
浏览全部技能用自然语言控制华为昇腾 NPU,本地或 SSH 远程执行 npu-smi 命令。
在华为云昇腾 910B DevServer 上按单机或双机(16 卡)拓扑部署并测试 LLM、VL、Embedding、Rerank 模型。
面向华为云资源的只读查询能力,用于资源清点、核对与参数发现。
通过本地 Python SDK 只读查询华为云 IAM 资源(用户、用户组、策略、委托、AK/SK、MFA、安全设置)。
在华为云 Flexus L 实例上一键部署 OpenClaw AI Agent 平台,并完成模型与通道配置。
在华为云 Flexus L 实例上一键部署 Hermes AI Agent 平台,并完成大模型与机器人通道配置。