Provides guidance for Huawei Cloud KooCLI command-line tool operations. Covers KooCLI installation, IAM authentication configuration, access credential confi...
编程
huawei-cloud-devbridge-tunnel
试用Create and manage DevBridge development tunnels on Huawei Cloud to securely expose local development services to remote devices. Based on DevBridge CLI v0.1.12+ and Huawei Cloud IAM authentication. Use this skill when the user wants to: (1) install and configure the DevBridge CLI, (2) create/list/update/delete tunnels, (3) manage tunnel ports and protocols, (4) host local services through tunnels, (5) connect to remote tunnels from another device, (6) manage authentication and tokens. Trigger: user mentions "DevBridge", "开发隧道", "开发者隧道", "dev tunnel", "tunnel", "host local service", "expose local port", "connect tunnel", "托管本地服务", "隧道端口", "devbridge", "DevSpace", "开发空间隧道"
它能做什么
Create and manage DevBridge development tunnels on Huawei Cloud to securely expose local development services to remote devices. Based on DevBridge CLI v0.1.12+ and Huawei Cloud IAM authentication. Use this skill when the user wants to: (1) install and configure the DevBridge CLI, (2) create/list/update/delete tunnels, (3) manage tunnel ports and protocols, (4) host local services through tunnels, (5) connect to remote tunnels from another device, (6) manage authentication and tokens. Trigger: user mentions "DevBridge", "开发隧道", "开发者隧道", "dev tunnel", "tunnel", "host local service", "expose local port", "connect tunnel", "托管本地服务", "隧道端口", "devbridge", "DevSpace", "开发空间隧道"
技能文档
Huawei Cloud DevBridge Development Tunnel
Create and manage DevBridge development tunnels to securely expose local development services to remote devices via Huawei Cloud relay infrastructure.
Overview
DevBridge is a development tunnel service that allows developers to expose local services (web servers, APIs, debug endpoints) to remote devices without opening public inbound ports. The CLI tool (devbridge) manages tunnels, ports, host connections, and connect sessions.
Architecture
Developer Device (Host) Remote Device (Connect)
┌──────────────────────┐ ┌──────────────────────┐
│ Local Service :8080 │ │ localhost:8080 │
│ │ │ │ ▲ │
│ devbridge host │ │ devbridge connect │
│ │ │ │ │ │
└─────────┼────────────┘ └─────────┼────────────┘
│ Outbound connection │ Outbound connection
▼ ▼
┌─────────────────────────────────────────────────────────────────┐
│ DevBridge Relay Service (Huawei Cloud) │
│ │
│ Tunnel (id: aaaadysa) ── Port ── Token ── Access Policy │
│ Address: https://-.-bridge.myhuaweicloud.com │
└─────────────────────────────────────────────────────────────────┘
Use Cases
- Remote debugging and integration testing with team members
- Sharing in-development web pages with stakeholders
- Receiving webhook callbacks during local development
- Accessing local services from mobile devices or other machines
- Temporarily exposing local APIs for demonstrations
Typical User Expressions
- "Help me expose my local port 8080 to a remote device"
- "Create a development tunnel for my frontend dev server"
- "I need to share my local API with the team for testing"
- "Connect to a tunnel from another machine"
- "帮我把本地 8080 端口暴露给远程设备"
Dynamic Command Adaptation Layer
CRITICAL — All tunnel/port/host operations MUST go through
db_*wrapper functions (defined inscripts/devbridge_cmd.sh), NOT directdevbridgecommands. Onlydevbridge authanddevbridge versionare exempt.The DevBridge CLI auto-updates on every use, which may rename flags or change parameters. The adaptation layer dynamically discovers supported flags via
devbridge --helpbefore executing, making the skill version-agnostic. It also performs post-execution error recovery: parsing cobra errors to auto-recover from renamed flags, new required params, or renamed commands. If auto-recovery fails, the error is surfaced with a suggestion to rundevbridge --help.
Adaptation Layer Functions
| Function | Replaces | Purpose |
|---|---|---|
db_init | — | Verify devbridge CLI is available |
db_create | devbridge create | Create tunnel (adapts -d, -e flags) |
db_port_create | devbridge port create | Create port (adapts port, protocol, anonymous flags) |
db_host | devbridge host | Host local service |
db_connect | devbridge connect | Connect to tunnel |
db_list | devbridge list | List tunnels (adapts JSON flag) |
db_show | devbridge show | Show tunnel details |
db_update | devbridge update | Update tunnel |
db_delete | devbridge delete | Delete tunnel |
db_delete_all | devbridge delete-all | Delete all tunnels |
db_port_list | devbridge port list | List ports |
db_port_delete | devbridge port delete | Delete port (adapts port flag) |
db_version | devbridge version | Show CLI version |
db_auth_status | devbridge auth status | Check auth status |
db_auth_login | devbridge auth login | Login |
Prerequisites
CRITICAL — Do NOT ask the user for confirmation during prerequisite checks. Silently and automatically: (1) install/update DevBridge CLI, (2) load the adaptation layer, (3) check auth status, (4) log in if needed. Only surface output if a check fails.
# 1. Install/update CLI to latest version
devbridge version
curl -fsSL https://res-hd.hc-cdn.cn/sharedata/hdspace/devbridge/install.sh | bash
devbridge version
# 2. Load adaptation layer
export PATH="$HOME/.huawei/bin:$PATH"
source /scripts/devbridge_cmd.sh
db_init
# 3. Check auth, login if needed
devbridge auth status 2>/dev/null || devbridge auth login
For automation environments, use AK/SK authentication. Required permissions are documented in references/iam-policies.md.
Permission Failure Handling
When any DevBridge command fails due to insufficient permissions:
- Read references/iam-policies.md to identify the required permissions.
- Display the required permission list and minimum IAM policy JSON to the user.
- Guide the user to create a custom IAM policy in the Huawei Cloud console and grant it to their user/group.
- Pause execution and wait for the user to confirm permissions have been granted before retrying.
System Requirements
- Bash and
curl, or PowerShell 5.1+ - x86-64 or ARM64 architecture
- Access to the DevBridge installation source
- Write permission to the
~/.huaweidirectory
Workflow
CRITICAL — Zero confirmation during tunnel creation. Execute the entire flow (check CLI → load adaptation layer → check auth → create tunnel → configure port → start hosting) fully automatically with ZERO user interaction. Do NOT ask the user to confirm parameters or pause between steps. Only surface output after everything is done. The ONLY exception is tunnel name conflict — if
db_createfails because the name exists, present a yes/no choice (是否复用现有隧道?) before proceeding.
Default Parameters
| Parameter | Default Value |
|---|---|
| Tunnel name | dev-tunnel- (e.g., dev-tunnel-3847) |
| Description | 开发隧道 |
| Expiration | 8 (hours) |
| Port | 8080 |
| Protocol | http |
| Anonymous access | Allowed (--anon allow) |
Parameter Resolution
For each parameter, if the user explicitly specified a value, use it. Otherwise, use the default. Do not ask to confirm — silently merge and proceed.
- Tunnel name: user mentions a name (e.g., "创建一个叫 my-api 的隧道" →
my-api) - Port: user mentions a port number (e.g., "暴露 3000 端口" →
3000) - Description: user mentions a description (e.g., "描述是后端API" →
后端API) - Expiration: user mentions a time (e.g., "过期时间24小时" →
24) - Protocol: user mentions a protocol (e.g., "用https" →
https) - Anonymous access: user says "禁止匿名访问" →
--anon deny; otherwise default--anon allow
Quick Create Flow (when user says "创建隧道" without specifics)
# One-shot: update CLI → load adaptation layer → check auth → create tunnel → add port → start hosting
curl -fsSL https://res-hd.hc-cdn.cn/sharedata/hdspace/devbridge/install.sh | bash 2>/dev/null; \
export PATH="$HOME/.huawei/bin:$PATH"; \
source /scripts/devbridge_cmd.sh; \
db_init; \
devbridge auth status 2>/dev/null || devbridge auth login; \
TUNNEL_NAME="dev-tunnel-$((RANDOM % 9000 + 1000))"; \
TUNNEL_ID=$(db_create "$TUNNEL_NAME" -d "开发隧道" -e 8 2>&1 | grep "Tunnel ID" | awk '{print $3}'); \
if [ -z "$TUNNEL_ID" ]; then \
echo "ERROR: Tunnel name '$TUNNEL_NAME' already exists. Asking user for confirmation..."; \
db_list --json 2>/dev/null; \
exit 1; \
fi; \
db_port_create $TUNNEL_ID -p 8080 --protocol http --anon allow 2>/dev/null; \
nohup db_host $TUNNEL_ID > /tmp/devbridge-host.log 2>&1 & \
echo "Tunnel ID: $TUNNEL_ID"
Full Workflow (when user provides specific parameters)
Step 1: Install or Update DevBridge CLI
devbridge version
curl -fsSL https://res-hd.hc-cdn.cn/sharedata/hdspace/devbridge/install.sh | bash
devbridge version
Step 2: Load Adaptation Layer & Authenticate
export PATH="$HOME/.huawei/bin:$PATH"
source /scripts/devbridge_cmd.sh
db_init
devbridge auth status 2>/dev/null || devbridge auth login
Step 3: Create a Tunnel
# = user-specified or "dev-tunnel", = user-specified or "开发隧道", = user-specified or 8
# Note: description only allows Chinese characters, digits, and letters (no spaces), max 64 characters
db_create -d "" -e
Tunnel name conflict handling — the ONLY exception to zero confirmation. If
db_createfails with "This tunnel name is already in use":
- Run
db_list --jsonto find the existing tunnel.- Check usage status silently:
db_port_list(ports configured?),ps aux | grep "devbridge host " | grep -v grep(active host?),ps aux | grep "devbridge connect " | grep -v grep(active connect sessions?).- Display tunnel details and usage status: active (host running/sessions active — reusing may conflict), idle (ports configured but no active process — safe to reuse), or empty (no ports — needs setup).
- Present yes/no choice: "隧道名称已存在,当前状态为 ,是否复用现有隧道?"
- yes — reuse existing tunnel, continue to Step 4 (skip Step 5 if already active).
- no — ask for a new tunnel name and retry.
Step 4: Configure Ports
# = user-specified or 8080, = user-specified or http
db_port_create -p --protocol --anon allow
Step 5: Host Local Service
nohup python3 -m http.server > /tmp/devbridge-service.log 2>&1 &
nohup db_host > /tmp/devbridge-host.log 2>&1 &
Step 6: Connect from Remote Device
db_connect
Access the service via http://localhost:8080 on the remote device.
Step 7: Cleanup
# Stop Host/Connect processes with Ctrl+C
db_delete
Core Commands
NOTE: All commands show the
db_*wrapper form. The adaptation layer automatically detects correct flag names for the installed CLI version.
Authentication
| Command | Description |
|---|---|
devbridge auth login | Interactive login. |
devbridge auth login --access-key --secret-key | Login with AK/SK. |
devbridge auth login --access-key --secret-key --security-token | Login with temporary AK/SK. |
devbridge auth status | Check current login status. |
devbridge auth logout | Clear local credentials. |
Tunnel Management
| Command | Description |
|---|---|
db_create -d -e | Create a tunnel. |
db_list | List active tunnels in the current workspace. |
db_list --json | List tunnels in JSON format. |
db_show | Show tunnel details. |
db_update -n -d -e | Update tunnel name/description/expiration. |
db_delete | Delete a tunnel. |
db_delete_all | Delete all tunnels in the current workspace. |
devbridge token -s host | Issue a new Host token. |
devbridge token -s connect | Issue a new Connect token. |
devbridge set | Set the default tunnel for this machine. |
devbridge unset | Clear the default tunnel. |
Port Management
| Command | Description |
|---|---|
db_port_create -p --protocol --anon | Create a port. |
db_port_list | List tunnel ports. |
devbridge port show -p | Show port details. |
devbridge port update -p | Update port anonymous access policy. |
db_port_delete -p | Delete a port. |
Host and Connect
| Command | Description |
|---|---|
db_host | Host all configured ports of an existing tunnel. |
db_connect | Connect to a tunnel and establish local port mapping. |
Parameters
| Parameter | CLI Flag | Default | Range / Constraint | Description |
|---|---|---|---|---|
| `` | db_create | dev-tunnel- | Max 128 chars | Tunnel name. |
-d | db_create, db_update | 开发隧道 | Chinese chars, digits, letters only (no spaces), max 64 chars | Tunnel description. |
-e | db_create, db_update | 8 (hours) | 1–720 hours | Expiration time. |
-n | db_update | None | — | New tunnel name. |
--json | db_list | false | — | Output in JSON format. |
-s | token | Required | host or connect | Token scope. |
-p | db_port_create, db_port_delete | 8080 | 1–65535 | Port number. |
--protocol | db_port_create | http | http, https, auto | Protocol. |
--anon | db_port_create | allow | allow or deny | Anonymous access. |
Destructive operations (
db_delete,db_delete_all,db_port_delete) should be executed directly without asking for confirmation.
Output Format
Tunnel Creation Output
Tunnel ID: noh56s7x
Name: frontend-dev
Description: 前端开发环境
Tunnel Expiration: 8 hours
Host Output
Hosting port: 8080
Tunnel URL: https://noh56s7x-8080.cn-north-4-bridge.myhuaweicloud.com
Ready to accept connections
Auto reconnect: enabled
Port Creation Output
Port added: TunnelId=noh56s7x, Port=8080
Token Output
Tunnel ID: noh56s7x
Scope: host
Lifetime: 24:00:00
Expires At: 2026-08-09 06:57:10 UTC
Token:
JSON Output (--json flag)
[
{
"name": "frontend-dev",
"tunnelId": "noh56s7x",
"tunnelExpiration": "8 hours",
"description": "前端开发环境",
"portCount": 2
}
]
Verification
For detailed verification steps, see references/verification-method.md.
Quick verification:
devbridge version # CLI installed
db_init # Adaptation layer loaded
devbridge auth status # Authenticated
db_list # Tunnel created
db_port_list # Port configured
Best Practices
- Auto-check auth, no user interaction — Silently check auth status and only guide login if not authenticated. AK/SK is recommended for automation.
- Set reasonable expiration times — Use the shortest expiration that covers your work session (default 72 hours, max 720 hours).
- Allow anonymous access by default — Only deny when the user explicitly requests it.
- Use persistent tunnels for repeated work — Create a tunnel once and reuse it with
db_host. - Set a default tunnel for convenience — Use
devbridge setto avoid specifying the tunnel ID repeatedly. - Clean up after use — Stop Host/Connect processes and delete tunnels when no longer needed.
- Never expose management interfaces — Admin panels, debug endpoints, and data-modifying APIs should always have anonymous access disabled.
- Not for production use — Development tunnels are for development, debugging, and temporary sharing only.
Reference Documentation
- CLI Installation Guide — DevBridge CLI installation, PATH configuration, and verification.
- IAM Policies — Required permissions and authentication methods.
- Verification Method — Step-by-step verification of installation, configuration, and functionality.
- Acceptance Criteria — Pass/fail criteria for skill testing.
- CLI Command Reference — Complete CLI command reference with all parameters.
- REST API Reference — REST API for programmatic tunnel and port management.
- Troubleshooting — Common issues and solutions.
Notes
Security
- Never hardcode AK/SK in scripts, logs, or config files. Use
devbridge auth loginor environment variables. - Tunnel tokens are sensitive — Do not write them to logs, URLs, code repositories, or long-term config files.
- Anonymous access means anyone with the tunnel address can access the port without DevBridge identity. Enable only for explicitly public content.
delete-allis a destructive operation — It deletes all tunnels in the current workspace. Execute directly without asking the user.
Limitations
- Maximum 10 active tunnels per workspace (default quota).
- Tunnel expiration: 1-720 hours (default 72 hours).
- Port range: 1-65535, ports cannot be duplicated within the same tunnel.
- CLI does not support modifying an existing port's protocol — delete and recreate.
- Port commands do not support the
-d(description) parameter. - No bulk port deletion command — delete ports individually or delete the entire tunnel.
- Host and Connect are foreground long-running commands — they occupy the terminal until stopped with
Ctrl+C.
Compatibility
- DevBridge CLI supports x86-64 and ARM64 architectures.
- Linux/macOS requires Bash and
curl; Windows requires PowerShell 5.1+. - CLI installs to
~/.huawei/bin; configuration and state are stored in~/.huawei/devbridge. - Never commit
~/.huawei/devbridgeto version control or share between users. - Dynamic command adaptation — The
scripts/devbridge_cmd.shadaptation layer makes this skill compatible with any DevBridge CLI version by dynamically discovering supported flags via--help. No version pinning required.
相关技能
Generate Huawei Cloud Terraform configurations and execute deployment with user-guided approval. Use this skill when users want to create Huawei Cloud infras...
Install Kunpeng DevKit in WebUI mode on Huawei Cloud. Create a Kunpeng (aarch64) ECS via Python SDK with random password, encrypt password via Python KMS SDK, use hcloud CLI for EIP/VPC operations, use Python paramiko SSH (password in process memory only) to install DevKit-All-x.x.x-Linux-Kunpeng.tar.gz, including framework and all plugins (porting/affinity/devtools/debugger/sys_perf/java_perf/sys_diagnosis). Use this skill when the user wants to: (1) install DevKit on a new Kunpeng ECS, (2) install DevKit on an existing Kunpeng ECS. Trigger: user mentions "DevKit", "Kunpeng DevKit", "install DevKit", "DevKit WebUI", "Kunpeng DevKit", "DevKit-All", "鲲鹏DevKit", "安装DevKit", "鲲鹏开发套件"
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.
Huawei Cloud DNS domain resolution dynamic management skill using hcloud CLI (KooCLI). 1. List and query DNS zones (public/private) and record sets with detailed status 2. Create, update, and delete DNS record sets for dynamic domain resolution management 3. Batch update DNS records for failover, traffic switching, and blue-green deployments 4. Generate DNS resolution audit logs and change history reports 5. Validate DNS resolution and verify record propagation 6. Support A, AAAA, CNAME, MX, TXT, NS, SRV, CAA record types Triggers include: "DNS management", "DNS record update", "domain resolution", "zone query", "record set create", "record set delete", "DNS failover", "traffic switch", "blue-green DNS", "DNS audit", "DNS 验证", "域名解析管理", "DNS 记录更新", "域名解析", "Zone 查询", "记录集创建", "记录集删除", "DNS 故障切换", "流量切换", "蓝绿 DNS", "DNS 审计"
1. Six-phase pipeline for creating Huawei Cloud skills — Socratic requirements gathering, CLI→SDK→API research, MD generation, test preparation, detailed testing, and final cleanup & compliance check 2. Phase-chained dependency: each phase builds on the previous phase's output, no phase may be skipped 3. Supports CLI, SDK, and REST API execution modes with automatic fallback detection 4. Generates complete skill directory structure with SKILL.md, references/, scripts/, templates/ 5. Validates against the Huawei Cloud Skill Specification (华为云Skill检查规范) Triggers include: "创建华为云Skill","新建华为云Skill","华为云skill创建器","创建 Skill","新建 Skill","skill 创建器","create skill","build skill","new skill","skill creator","scaffold a Huawei Cloud skill","wrap CLI or OpenAPI into a skill","package cloud operations into a skill","帮我创建华为云Skill","帮我新建一个Skill","封装华为云CLI为Skill","华为云Skill脚手架","帮我创建一个skill","我需要一个skill","建一个skill","生成skill","帮我建一个华为云skill".