Create and manage DevBridge development tunnels on Huawei Cloud to securely expose local development services to remote devices. Based on DevBridge CLI v0.2.x and API Key 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 API Keys. Trigger: user mentions "DevBridge", "开发隧道", "开发者隧道", "dev tunnel", "tunnel", "host local service", "expose local port", "connect tunnel", "托管本地服务", "隧道端口", "devbridge", "DevSpace", "开发空间隧道"
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. Host and Connect both initiate outbound connections to the relay service, so the hosting device does not need a public inbound port.
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 端口暴露给远程设备"
Version Support
Item
Requirement
CLI version
v0.2.x (installed from official channel, e.g. 0.2.1-release / 0.2.2-release)
Authentication
API Key (devbridge auth login --api-key or env HW_API_KEY) or interactive login
Tunnel domain
New cluster domain (devbridge-s2.hwtunnel.com etc.), shown in devbridge host output
Old versions
v0.1.x is NOT supported — AK/SK auth flags removed, old domain no longer connects
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 may change flags between releases. The adaptation layer dynamically discovers supported flags via devbridge <command> --help before executing, making the skill version-agnostic within v0.2.x. 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
Function
Replaces
Purpose
db_init
—
Ensure CLI installed (v0.2.x+), authenticated (auto-login via DEVBRIDGE_API_KEY/HW_API_KEY)
db_create
devbridge create
Create tunnel, returns just the tunnel ID (stdout)
db_port_create
devbridge port create
Create port (adapts port, protocol, anonymous flags)
db_host
devbridge host
Start hosting in background, returns PID (stdout), tunnel URL (stderr)
db_host_bg
devbridge host + nohup bash -c
Background host (legacy alias, use db_host instead)
db_connect
devbridge connect
Start connect in background, returns PID (stdout)
db_list
devbridge list
List tunnels
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_limits
devbridge limits
Show quota / usage / balance
db_echo
devbridge echo
Start diagnostic echo service
db_ping
devbridge ping
Ping a URI to test connectivity
db_version
devbridge version
Show CLI version
db_auth_status
devbridge auth status
Check auth status
db_auth_login
devbridge auth login
Login (interactive or --api-key)
db_tunnel_url
—
Get tunnel public URL from host log (authoritative, do not construct manually)
db_processes
—
List running host/connect processes
db_process_stop
—
Stop a host/connect process by PID
db_process_logs
—
Get process logs by PID
Prerequisites
CRITICAL — Do NOT ask the user for confirmation during prerequisite checks.db_init silently and automatically: (1) install CLI if missing, (2) upgrade if v0.1.x (old domain, cannot connect), (3) check auth, (4) auto-login via DEVBRIDGE_API_KEY or HW_API_KEY env var. Only surface output if a check fails.
For automation environments, use an API Key (see references/iam-policies.md). API Keys are created at the DevBridge management page: https://devstation.connect.huaweicloud.com/space/devbridge/apikey.
Install script note: in non-interactive / headless environments, always pass -s (silent) to the install script: ... | bash -s -- -s. Without it, the script may prompt "overwrite?" reading /dev/tty and fail where no terminal exists.
Pause execution and wait for the user to confirm credentials have been updated 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
Parameter
Default Value
Tunnel name
dev-tunnel-<random> (e.g., dev-tunnel-3847)
Description
开发隧道
Expiration
72 (hours) — CLI default; range 1–720
Port
8080
Protocol
auto (options: http / https / auto)
Anonymous access
Denied (--deny-anonymous is the CLI default; use -a only when the user explicitly asks to allow anonymous access)
Security change: anonymous access defaults to deny. Unlike older skill versions, do NOT pass --anon allow by default. Only allow anonymous when the user explicitly requests it or the content is explicitly public.
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); otherwise 72
Protocol: user mentions a protocol (e.g., "用https" → https); otherwise auto
Anonymous access: user says "允许匿名访问" or "公网直接访问" → -a; otherwise deny (default)
Quick Create Flow (when user says "创建隧道" without specifics)
# <name> = user-specified or "dev-tunnel", <description> = user-specified or "开发隧道", <expiration> = user-specified or 72
# Note: description only allows Chinese characters, digits, and letters (no spaces), max 64 characters
db_create <name> -d "<description>" -e <expiration>
Tunnel name conflict handling — the ONLY exception to zero confirmation. If db_create fails with "This tunnel name is already in use":
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).
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
bash
# <port> = user-specified or 8080, <protocol> = user-specified or auto
# Anonymous access: default deny; use -a only if user explicitly asks
db_port_create <tunnelId> -p <port> --protocol <protocol>
Auto-check auth, no user interaction — Silently check auth status and only guide login if not authenticated. API Key via HW_API_KEY is recommended for automation.
Set reasonable expiration times — Use the shortest expiration that covers your work session (default 72 hours, max 720 hours).
Deny anonymous access by default — Only allow (-a) when the user explicitly requests it or content is explicitly public.
Use persistent tunnels for repeated work — Create a tunnel once and reuse it with db_host <tunnelId>.
Set a default tunnel for convenience — Use devbridge set <tunnelId> to 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.
Keep CLI upgraded to v0.2.x — The 2026-09-20 domain switch invalidated old clients; older versions can no longer connect.
Never hardcode API Key in scripts, logs, or config files. Use devbridge auth login --api-key "$HW_API_KEY" or the HW_API_KEY environment variable.
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-all is a destructive operation — It deletes all tunnels in the current workspace. Execute directly without asking the user. 共享/复用工作区时先 db_list 确认,避免连带删除他人隧道。
Limitations
Maximum 10 active tunnels per workspace (default quota).
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 managed background processes — use db_process_stop <pid> to stop.
list / port list no longer support --json output in v0.2.x.
Compatibility
DevBridge CLI v0.2.x 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/devbridge to version control or share between users.
Dynamic command adaptation — The scripts/devbridge_cmd.sh adaptation layer makes this skill compatible with any DevBridge CLI v0.2.x version by dynamically discovering supported flags via --help. No version pinning required.