huawei-cloud-devbridge-tunnel

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Huawei Cloud DevBridge Development Tunnel

华为云DevBridge开发隧道

Create and manage DevBridge development tunnels to securely expose local development services to remote devices via Huawei Cloud relay infrastructure.
创建和管理DevBridge开发隧道,通过华为云中继基础设施安全地将本地开发服务暴露给远程设备。

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.
DevBridge是一款开发隧道服务,允许开发者将本地服务(Web服务器、API、调试端点)暴露给远程设备,无需开放公网入站端口。CLI工具(
devbridge
)用于管理隧道、端口、主机连接和会话连接。

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 │
└─────────────────────────────────────────────────────────────────┘
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
  • 与团队成员进行远程调试和集成测试
  • 向利益相关者分享开发中的网页
  • 在本地开发期间接收Webhook回调
  • 从移动设备或其他机器访问本地服务
  • 临时暴露本地API用于演示

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 端口暴露给远程设备"
  • "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
.
重要提示 — 所有隧道/端口/主机操作必须通过
db_*
包装函数
(定义于
scripts/devbridge_cmd.sh
),不能直接使用
devbridge
命令。仅
devbridge auth
devbridge version
除外。
DevBridge CLI每次使用时会自动更新,这可能会重命名标志或更改参数。适配层在执行前通过
devbridge <command> --help
动态发现支持的标志,使技能与版本无关。它还会执行执行后错误恢复:解析cobra错误以自动从重命名的标志、新增的必填参数或重命名的命令中恢复。如果自动恢复失败,会显示错误并建议运行
devbridge <command> --help

Adaptation Layer Functions

适配层函数

FunctionReplacesPurpose
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
函数替代命令用途
db_init
验证devbridge CLI是否可用
db_create
devbridge create
创建隧道(适配
-d
-e
标志)
db_port_create
devbridge port create
创建端口(适配端口、协议、匿名访问标志)
db_host
devbridge host
托管本地服务
db_connect
devbridge connect
连接到隧道
db_list
devbridge list
列出隧道(适配JSON标志)
db_show
devbridge show
显示隧道详情
db_update
devbridge update
更新隧道
db_delete
devbridge delete
删除隧道
db_delete_all
devbridge delete-all
删除所有隧道
db_port_list
devbridge port list
列出端口
db_port_delete
devbridge port delete
删除端口(适配端口标志)
db_version
devbridge version
显示CLI版本
db_auth_status
devbridge auth status
检查认证状态
db_auth_login
devbridge auth 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.
bash
undefined
重要提示 — 前提条件检查期间不要向用户请求确认。 静默自动执行:(1) 安装/更新DevBridge CLI,(2) 加载适配层,(3) 检查认证状态,(4) 必要时登录。仅在检查失败时显示输出。
bash
undefined

1. Install/update CLI to latest version

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
devbridge version curl -fsSL https://res-hd.hc-cdn.cn/sharedata/hdspace/devbridge/install.sh | bash devbridge version

2. Load adaptation layer

2. Load adaptation layer

export PATH="$HOME/.huawei/bin:$PATH" source <skill_directory>/scripts/devbridge_cmd.sh db_init
export PATH="$HOME/.huawei/bin:$PATH" source <skill_directory>/scripts/devbridge_cmd.sh db_init

3. Check auth, login if needed

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](references/iam-policies.md).
devbridge auth status 2>/dev/null || devbridge auth login

对于自动化环境,使用AK/SK认证。所需权限记录在[references/iam-policies.md](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.
当任何DevBridge命令因权限不足失败时:
  1. 阅读references/iam-policies.md以确定所需权限。
  2. 向用户显示所需权限列表和最小IAM策略JSON。
  3. 指导用户在华为云控制台创建自定义IAM策略并授予其用户/用户组。
  4. 暂停执行并等待用户确认权限已授予后再重试。

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
  • Bash和
    curl
    ,或PowerShell 5.1+
  • x86-64或ARM64架构
  • 可访问DevBridge安装源
  • ~/.huawei
    目录的写入权限

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.
重要提示 — 隧道创建期间无需确认。 完全自动执行整个流程(检查CLI → 加载适配层 → 检查认证 → 创建隧道 → 配置端口 → 启动托管),无需任何用户交互。不要要求用户确认参数或在步骤之间暂停。仅在所有操作完成后显示输出。唯一例外是隧道名称冲突 — 如果
db_create
因名称已存在而失败,在继续之前提供是/否选择(是否复用现有隧道?)。

Default Parameters

默认参数

ParameterDefault Value
Tunnel name
dev-tunnel-<random>
(e.g.,
dev-tunnel-3847
)
Description
开发隧道
Expiration
8
(hours)
Port
8080
Protocol
http
Anonymous accessAllowed (
--anon allow
)
参数默认值
隧道名称
dev-tunnel-<random>
(例如:
dev-tunnel-3847
描述
开发隧道
过期时间
8
(小时)
端口
8080
协议
http
匿名访问允许(
--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
对于每个参数,如果用户明确指定了值,则使用该值。否则,使用默认值。不要请求确认 — 静默合并并继续。
  • 隧道名称:用户提及名称(例如:"创建一个叫 my-api 的隧道" →
    my-api
  • 端口:用户提及端口号(例如:"暴露 3000 端口" →
    3000
  • 描述:用户提及描述(例如:"描述是后端API" →
    后端API
  • 过期时间:用户提及时间(例如:"过期时间24小时" →
    24
  • 协议:用户提及协议(例如:"用https" →
    https
  • 匿名访问:用户说"禁止匿名访问" →
    --anon deny
    ;否则默认
    --anon allow

Quick Create Flow (when user says "创建隧道" without specifics)

快速创建流程(当用户仅说"创建隧道"未指定细节时)

bash
undefined
bash
undefined

One-shot: update CLI → load adaptation layer → check auth → create tunnel → add port → start hosting

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"
undefined
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"
undefined

Full Workflow (when user provides specific parameters)

完整工作流程(当用户提供特定参数时)

Step 1: Install or Update DevBridge CLI

步骤1:安装或更新DevBridge CLI

bash
devbridge version
curl -fsSL https://res-hd.hc-cdn.cn/sharedata/hdspace/devbridge/install.sh | bash
devbridge version
bash
devbridge version
curl -fsSL https://res-hd.hc-cdn.cn/sharedata/hdspace/devbridge/install.sh | bash
devbridge version

Step 2: Load Adaptation Layer & Authenticate

步骤2:加载适配层并认证

bash
export PATH="$HOME/.huawei/bin:$PATH"
source <skill_directory>/scripts/devbridge_cmd.sh
db_init
devbridge auth status 2>/dev/null || devbridge auth login
bash
export PATH="$HOME/.huawei/bin:$PATH"
source <skill_directory>/scripts/devbridge_cmd.sh
db_init
devbridge auth status 2>/dev/null || devbridge auth login

Step 3: Create a Tunnel

步骤3:创建隧道

bash
undefined
bash
undefined

<name> = user-specified or "dev-tunnel", <description> = user-specified or "开发隧道", <expiration> = user-specified or 8

<name> = 用户指定或 "dev-tunnel", <description> = 用户指定或 "开发隧道", <expiration> = 用户指定或 8

Note: description only allows Chinese characters, digits, and letters (no spaces), max 64 characters

注意:描述仅允许中文、数字和字母(无空格),最多64个字符

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":
> 1. Run `db_list --json` 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.
db_create <name> -d "<description>" -e <expiration>

> **隧道名称冲突处理 — 无需确认的唯一例外。** 如果`db_create`失败并提示"This tunnel name is already in use":
> 1. 运行`db_list --json`查找现有隧道。
> 2. 静默检查使用状态:`db_port_list <tunnelId>`(是否配置端口?)、`ps aux | grep "devbridge host <tunnelId>" | grep -v grep`(主机是否活跃?)、`ps aux | grep "devbridge connect <tunnelId>" | grep -v grep`(会话连接是否活跃?)。
> 3. 显示隧道详情和使用状态:**活跃**(主机运行/会话活跃 — 复用可能冲突)、**闲置**(已配置端口但无活跃进程 — 可安全复用)或**空**(无端口 — 需要设置)。
> 4. 提供是/否选择:"隧道名称已存在,当前状态为 <active/idle/empty>,是否复用现有隧道?"
>    - **是** — 复用现有隧道,继续步骤4(如果已活跃则跳过步骤5)。
>    - **否** — 请求新的隧道名称并重试。

Step 4: Configure Ports

步骤4:配置端口

bash
undefined
bash
undefined

<port> = user-specified or 8080, <protocol> = user-specified or http

<port> = 用户指定或 8080, <protocol> = 用户指定或 http

db_port_create <tunnelId> -p <port> --protocol <protocol> --anon allow
undefined
db_port_create <tunnelId> -p <port> --protocol <protocol> --anon allow
undefined

Step 5: Host Local Service

步骤5:托管本地服务

bash
nohup python3 -m http.server <port> > /tmp/devbridge-service.log 2>&1 &
nohup db_host <tunnelId> > /tmp/devbridge-host.log 2>&1 &
bash
nohup python3 -m http.server <port> > /tmp/devbridge-service.log 2>&1 &
nohup db_host <tunnelId> > /tmp/devbridge-host.log 2>&1 &

Step 6: Connect from Remote Device

步骤6:从远程设备连接

bash
db_connect <tunnelId>
Access the service via
http://localhost:8080
on the remote device.
bash
db_connect <tunnelId>
在远程设备上通过
http://localhost:8080
访问服务。

Step 7: Cleanup

步骤7:清理

bash
undefined
bash
undefined

Stop Host/Connect processes with Ctrl+C

Stop Host/Connect processes with Ctrl+C

db_delete <tunnelId>
undefined
db_delete <tunnelId>
undefined

Core Commands

核心命令

NOTE: All commands show the
db_*
wrapper form. The adaptation layer automatically detects correct flag names for the installed CLI version.
注意: 所有命令显示
db_*
包装形式。适配层会自动检测已安装CLI版本支持的正确标志名称。

Authentication

认证

CommandDescription
devbridge auth login
Interactive login.
devbridge auth login --access-key <ak> --secret-key <sk>
Login with AK/SK.
devbridge auth login --access-key <ak> --secret-key <sk> --security-token <token>
Login with temporary AK/SK.
devbridge auth status
Check current login status.
devbridge auth logout
Clear local credentials.
命令描述
devbridge auth login
交互式登录。
devbridge auth login --access-key <ak> --secret-key <sk>
使用AK/SK登录。
devbridge auth login --access-key <ak> --secret-key <sk> --security-token <token>
使用临时AK/SK登录。
devbridge auth status
检查当前登录状态。
devbridge auth logout
清除本地凭据。

Tunnel Management

隧道管理

CommandDescription
db_create <name> -d <desc> -e <hours>
Create a tunnel.
db_list
List active tunnels in the current workspace.
db_list --json
List tunnels in JSON format.
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_create <name> -d <desc> -e <hours>
创建隧道。
db_list
列出当前工作区中的活跃隧道。
db_list --json
以JSON格式列出隧道。
db_show <tunnelId>
显示隧道详情。
db_update <tunnelId> -n <name> -d <desc> -e <hours>
更新隧道名称/描述/过期时间。
db_delete <tunnelId>
删除隧道。
db_delete_all
删除当前工作区中的所有隧道。
devbridge token <tunnelId> -s host
颁发新的主机令牌。
devbridge token <tunnelId> -s connect
颁发新的连接令牌。
devbridge set <tunnelId>
设置此机器的默认隧道。
devbridge unset
清除默认隧道。

Port Management

端口管理

CommandDescription
`db_port_create <tunnelId> -p <port> --protocol <protocol> --anon <allowdeny>`
db_port_list <tunnelId>
List tunnel ports.
devbridge port show <tunnelId> -p <port>
Show port details.
devbridge port update <tunnelId> -p <port>
Update port anonymous access policy.
db_port_delete <tunnelId> -p <port>
Delete a port.
命令描述
`db_port_create <tunnelId> -p <port> --protocol <protocol> --anon <allowdeny>`
db_port_list <tunnelId>
列出隧道端口。
devbridge port show <tunnelId> -p <port>
显示端口详情。
devbridge port update <tunnelId> -p <port>
更新端口匿名访问策略。
db_port_delete <tunnelId> -p <port>
删除端口。

Host and Connect

主机与连接

CommandDescription
db_host <tunnelId>
Host all configured ports of an existing tunnel.
db_connect <tunnelId>
Connect to a tunnel and establish local port mapping.
命令描述
db_host <tunnelId>
托管现有隧道的所有已配置端口。
db_connect <tunnelId>
连接到隧道并建立本地端口映射。

Parameters

参数

ParameterCLI FlagDefaultRange / ConstraintDescription
<name>
db_create
dev-tunnel-<random>
Max 128 charsTunnel name.
-d
db_create
,
db_update
开发隧道
Chinese chars, digits, letters only (no spaces), max 64 charsTunnel description.
-e
db_create
,
db_update
8
(hours)
1–720 hoursExpiration time.
-n
db_update
NoneNew tunnel name.
--json
db_list
falseOutput in JSON format.
-s
token
Required
host
or
connect
Token scope.
-p
db_port_create
,
db_port_delete
8080
1–65535Port 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.
参数CLI标志默认值范围 / 约束描述
<name>
db_create
dev-tunnel-<random>
最多128个字符隧道名称。
-d
db_create
,
db_update
开发隧道
仅允许中文、数字、字母(无空格),最多64个字符隧道描述。
-e
db_create
,
db_update
8
(小时)
1–720小时过期时间。
-n
db_update
新隧道名称。
--json
db_list
false以JSON格式输出。
-s
token
必填
host
connect
令牌范围。
-p
db_port_create
,
db_port_delete
8080
1–65535端口号。
--protocol
db_port_create
http
http
,
https
,
auto
协议。
--anon
db_port_create
allow
allow
deny
匿名访问。
破坏性操作
db_delete
,
db_delete_all
,
db_port_delete
)应直接执行,无需请求确认。

Output Format

输出格式

Tunnel Creation Output

隧道创建输出

text
Tunnel ID:            noh56s7x
Name:                 frontend-dev
Description:          前端开发环境
Tunnel Expiration:    8 hours
text
Tunnel ID:            noh56s7x
Name:                 frontend-dev
Description:          前端开发环境
Tunnel Expiration:    8 hours

Host Output

主机输出

text
Hosting port: 8080
Tunnel URL: https://noh56s7x-8080.cn-north-4-bridge.myhuaweicloud.com
Ready to accept connections
Auto reconnect: enabled
text
Hosting port: 8080
Tunnel URL: https://noh56s7x-8080.cn-north-4-bridge.myhuaweicloud.com
Ready to accept connections
Auto reconnect: enabled

Port Creation Output

端口创建输出

text
Port added: TunnelId=noh56s7x, Port=8080
text
Port added: TunnelId=noh56s7x, Port=8080

Token Output

令牌输出

text
Tunnel ID:     noh56s7x
Scope:         host
Lifetime:      24:00:00
Expires At:    2026-08-09 06:57:10 UTC
Token:         <token-value>
text
Tunnel ID:     noh56s7x
Scope:         host
Lifetime:      24:00:00
Expires At:    2026-08-09 06:57:10 UTC
Token:         <token-value>

JSON Output (
--json
flag)

JSON输出(
--json
标志)

json
[
  {
    "name": "frontend-dev",
    "tunnelId": "noh56s7x",
    "tunnelExpiration": "8 hours",
    "description": "前端开发环境",
    "portCount": 2
  }
]
json
[
  {
    "name": "frontend-dev",
    "tunnelId": "noh56s7x",
    "tunnelExpiration": "8 hours",
    "description": "前端开发环境",
    "portCount": 2
  }
]

Verification

验证

For detailed verification steps, see references/verification-method.md.
Quick verification:
bash
devbridge version        # CLI installed
db_init                  # Adaptation layer loaded
devbridge auth status    # Authenticated
db_list                  # Tunnel created
db_port_list <tunnelId>  # Port configured
详细验证步骤请参阅references/verification-method.md
快速验证:
bash
devbridge version        # CLI installed
db_init                  # Adaptation layer loaded
devbridge auth status    # Authenticated
db_list                  # Tunnel created
db_port_list <tunnelId>  # Port configured

Best Practices

最佳实践

  1. Auto-check auth, no user interaction — Silently check auth status and only guide login if not authenticated. AK/SK is recommended for automation.
  2. Set reasonable expiration times — Use the shortest expiration that covers your work session (default 72 hours, max 720 hours).
  3. Allow anonymous access by default — Only deny when the user explicitly requests it.
  4. Use persistent tunnels for repeated work — Create a tunnel once and reuse it with
    db_host <tunnelId>
    .
  5. Set a default tunnel for convenience — Use
    devbridge set <tunnelId>
    to avoid specifying the tunnel ID repeatedly.
  6. Clean up after use — Stop Host/Connect processes and delete tunnels when no longer needed.
  7. Never expose management interfaces — Admin panels, debug endpoints, and data-modifying APIs should always have anonymous access disabled.
  8. Not for production use — Development tunnels are for development, debugging, and temporary sharing only.
  1. 自动检查认证,无需用户交互 — 静默检查认证状态,仅在未认证时指导登录。自动化场景推荐使用AK/SK。
  2. 设置合理的过期时间 — 使用能覆盖工作会话的最短过期时间(默认72小时,最长720小时)。
  3. 默认允许匿名访问 — 仅在用户明确要求时禁用。
  4. 为重复工作使用持久隧道 — 创建一次隧道,通过
    db_host <tunnelId>
    复用。
  5. 设置默认隧道以方便使用 — 使用
    devbridge set <tunnelId>
    避免重复指定隧道ID。
  6. 使用后清理 — 停止主机/连接进程并在不再需要时删除隧道。
  7. 切勿暴露管理界面 — 管理面板、调试端点和数据修改API应始终禁用匿名访问。
  8. 不用于生产环境 — 开发隧道仅用于开发、调试和临时共享。

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.
  • CLI Installation Guide — DevBridge CLI安装、PATH配置和验证。
  • IAM Policies — 所需权限和认证方法。
  • Verification Method — 安装、配置和功能的分步验证。
  • Acceptance Criteria — 技能测试的通过/失败标准。
  • CLI Command Reference — 完整的CLI命令参考,包含所有参数。
  • REST API Reference — 用于程序化隧道和端口管理的REST API。
  • Troubleshooting — 常见问题及解决方案。

Notes

注意事项

Security

安全性

  • Never hardcode AK/SK in scripts, logs, or config files. Use
    devbridge auth login
    or 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-all
    is a destructive operation
    — It deletes all tunnels in the current workspace. Execute directly without asking the user.
  • 切勿在脚本、日志或配置文件中硬编码AK/SK。使用
    devbridge auth login
    或环境变量。
  • 隧道令牌是敏感信息 — 不要将其写入日志、URL、代码仓库或长期配置文件。
  • 匿名访问意味着任何拥有隧道地址的人无需DevBridge身份即可访问端口。仅对明确公开的内容启用。
  • delete-all
    是破坏性操作
    — 它会删除当前工作区中的所有隧道。直接执行,无需询问用户。

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
    .
  • 每个工作区最多10个活跃隧道(默认配额)。
  • 隧道过期时间:1-720小时(默认72小时)。
  • 端口范围:1-65535,同一隧道内端口不能重复。
  • CLI不支持修改现有端口的协议 — 删除并重新创建。
  • 端口命令不支持
    -d
    (描述)参数。
  • 无批量端口删除命令 — 逐个删除端口或删除整个隧道。
  • 主机和连接是前台长期运行命令 — 它们会占用终端,直到用
    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/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 version by dynamically discovering supported flags via
    --help
    . No version pinning required.
  • DevBridge CLI支持x86-64和ARM64架构。
  • Linux/macOS需要Bash和
    curl
    ;Windows需要PowerShell 5.1+。
  • CLI安装到
    ~/.huawei/bin
    ;配置和状态存储在
    ~/.huawei/devbridge
    中。
  • 切勿将
    ~/.huawei/devbridge
    提交到版本控制或在用户之间共享。
  • 动态命令适配
    scripts/devbridge_cmd.sh
    适配层通过
    --help
    动态发现支持的标志,使此技能兼容任何DevBridge CLI版本。无需固定版本。