huaweicloud/huaweicloud-skills9 files

Huawei Cloud Devbridge Tunnel

|

Specification
Skill ID
huaweicloud/huaweicloud-skills/huawei-cloud-devbridge-tunnel
Publisher
huaweicloud
Repository
huaweicloud-skills
Installs
0
Files
9
Synced
Sep 23, 2026
How to use it

Open any RiverX project, open the Skills panel in the chat, and search for this identifier. The files are fetched from the source repository at install time.

huaweicloud/huaweicloud-skills/huawei-cloud-devbridge-tunnelInstalls these files
  • SKILL.md
  • references/acceptance-criteria.md
  • references/cli-command-reference.md
  • references/cli-installation-guide.md
  • references/iam-policies.md
  • references/rest-api-reference.md
  • references/troubleshooting.md
  • references/verification-method.md
  • scripts/devbridge_cmd.sh

What this skill tells the agent

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://<tunnelId>-<port>.<region>-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 in scripts/devbridge_cmd.sh), NOT direct devbridge commands. Only devbridge auth and devbridge version are 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 <command> --help before 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 run devbridge <command> --help`.

Adaptation Layer Functions

FunctionReplacesPurpose
db_init—Verify devbridge CLI is available
db_createdevbridge createCreate tunnel (adapts -d, -e flags)
db_port_createdevbridge port createCreate port (adapts port, protocol, anonymous flags)
db_hostdevbridge hostHost local service
db_connectdevbridge connectConnect to tunnel
db_listdevbridge listList tunnels (adapts JSON flag)
db_showdevbridge showShow tunnel details
db_updatedevbridge updateUpdate tunnel
db_deletedevbridge deleteDelete tunnel
db_delete_alldevbridge delete-allDelete all tunnels
db_port_listdevbridge port listList ports
db_port_deletedevbridge port deleteDelete port (adapts port flag)
db_versiondevbridge versionShow CLI version
db_auth_statusdevbridge auth statusCheck auth status
db_auth_logindevbridge auth loginLogin

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 <skill_directory>/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:

  1. Read references/iam-policies.md to identify the required permissions.
  2. Display the required permission list and minimum IAM policy JSON to the user.
  3. Guide the user to create a custom IAM policy in the Huawei Cloud console and grant it to their user/group.
  4. 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 ~/.huawei directory

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_create fails because the name exists, present a yes/no choice (是否复用现有隧道?) before proceeding.

Default Parameters

ParameterDefault Value
Tunnel namedev-tunnel-<random> (e.g., dev-tunnel-3847)
Description开发隧道
Expiration8 (hours)
Port8080
Protocolhttp
Anonymous accessAllowed (--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 <skill_directory>/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

Use this skill in a project

Open any RiverX project, search the Skills panel for huaweicloud/huaweicloud-skills/huawei-cloud-devbridge-tunnel, and install it in one click.

Use this skill