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/up

By huaweicloud · 663 installs

npx skills add huaweicloud/huaweicloud-skills --skill huawei-cloud-devbridge-tunnel

Source repository · Upstream listing

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. Host and Connect both initiate outbound connections to the relay service, so the hosting device does not need a public inbound port. Architecture 2026 09 20 域名升级通知 :DevBridge 隧道域名已切换,原 .cn north 4 bridge.myhuaweicloud.com 变更为新集群域名(如 .devbridge s2.hwtunnel.com )。 旧版端侧(v0.1.x)已无法连接 ,必须使用 v0.2.x 并重新创建隧道。以 devbridge host 实际输出的 Tunnel URL 为准。 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 端口暴露给远程设备" 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. v0.2.x 只支持 API Key : access key / secret key / security token (AK/SK)参数已移除,不要用 AK/SK 尝试登录(旧版 skill 的用法在 v0.2.x 无效)。API Key 在 DevBridge 管理页创建: https://devstation.connect.huaweicloud.com/space/devbridge/apikey 。 For automation environments, use an API Key (see [references/iam policies.md](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. GitCode 私有仓库安装 : npx skills add 不支持 GitCode token 认证。从私有仓库安装 skill 时,先 git clone 再手动复制: Permission / Auth Failure Handling When any DevBridge command fails due to invalid or missing credentials: 1. Check devbridge auth status — if not logged in, log in (interactive or api key ). 2. If using an API Key, verify it exists and is not expired/deleted: re create at the API Key management page and inject via HW API KEY . 3. Read [references/iam policies.md](references/iam policies.md) for guidance. 4. 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) 注意:匿名访问默认禁止。 上述流程创建的隧道默认 deny anonymous ,公网访问会返回 authentication required 。如果需要公网直接访问(如暴露 Web 服务给外部用户),在 db port create 时加 a : Full Workflow (when user provides specific parameters) Step 1: Install or Update DevBridge CLI Step 2: Load Adaptation Layer & Authenticate Step 3: Create a Tunnel Tunnel name conflict handling — the ONLY exception to zero confirmation. If db create fails with "This tunnel name is already in use": 1. Run db list to find the existing tunnel. 2. Check usage status silently: db port list <tunnelId (ports configured?), ps aux grep "devbridge host <tunnelId " grep v grep (active host?), ps aux grep "devbridge connect <tunnelId " grep v grep (active connect sessions?). 3. 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). 4. Present yes/no choice: "隧道名称已存在,当前状态为 <active/idle/empty ,是否复用现有隧道?" 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 端口更新后需重启 host: 如果 host 进程已在运行,使用 devbridge port update 修改端口配置(如切换匿名访问策略)后,正在运行的 host 进程 不会自动感知变化 。需要先停止旧 host 进程( db process stop <pid ),再重新 db host <tunnelId 才能使新配置生效。 Step 5: Host Local Service Alternative one shot temporary tunnel: devbridge host p 8080 e 8 (creates a temp tunnel and hosts immediately). ⚠️ 中继域名随集群变化 ,严禁按文档拼接 URL。一律用 db tunnel url <id 读取权威地址。 Step 6: Connect from Remote Device Access the service via http://localhost:8080 on the remote device. Step 7: Cleanup 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 (opens browser). devbridge auth login api key <key Login with API Key. HW API KEY=<key devbridge auth login Login using API Key from environment variable. devbridge auth status Check current login status. devbridge auth logout Clear local credentials. Removed in v0.2.x : access key , secret key , security token (AK/SK) are no longer supported. Use API Key instead. Tunnel Management Command Description db create <name d <desc e <hours Create a tunnel. db list List active tunnels in the current workspace. db show <tunnelId Show tunnel details. db update <tunnelId n <name d <desc e <hours Update tunnel name/description/expiration. db delete <tunnelId Delete a tunnel. db delete all Delete all tunnels in the current workspace. devbridge token <tunnelId s host Issue a new Host token. devbridge token <tunnelId s connect Issue a new Connect token. devbridge set <tunnelId Set the default tunnel for this machine. devbridge unset Clear the default tunnel. db limits Show account quota / usage / balance. Port Management Command Description db port create <tunnelId p <port protocol <protocol Create a port (anonymous access denied by default; add a to allow). db port list <tunnelId List tunnel ports. devbridge port show <tunnelId p <port Show port details. devbridge port update <tunnelId p <port a Update port anonymous access policy (allow). devbridge port update <tunnelId p <port deny anonymous Update port anonymous access policy (deny). db port delete <tunnelId p <port Delete a port. Host and Connect Command Description db host <tunnelId Host all configured ports of an existing tunnel. devbridge host p 8080 e 8 Create a temporary tunnel and host immediately. devbridge host <tunnelId