huawei-cloud-devbridge-tunnel
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseHuawei 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 () manages tunnels, ports, host connections, and connect sessions.
devbridgeDevBridge是一款开发隧道服务,允许开发者将本地服务(Web服务器、API、调试端点)暴露给远程设备,无需开放公网入站端口。CLI工具()用于管理隧道、端口、主机连接和会话连接。
devbridgeArchitecture
架构
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 throughwrapper functions (defined indb_*), NOT directscripts/devbridge_cmd.shcommands. Onlydevbridgeanddevbridge authare exempt.devbridge versionThe DevBridge CLI auto-updates on every use, which may rename flags or change parameters. The adaptation layer dynamically discovers supported flags viabefore 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 <command> --help.devbridge <command> --help
重要提示 — 所有隧道/端口/主机操作必须通过包装函数(定义于db_*),不能直接使用scripts/devbridge_cmd.sh命令。仅devbridge和devbridge auth除外。devbridge versionDevBridge CLI每次使用时会自动更新,这可能会重命名标志或更改参数。适配层在执行前通过动态发现支持的标志,使技能与版本无关。它还会执行执行后错误恢复:解析cobra错误以自动从重命名的标志、新增的必填参数或重命名的命令中恢复。如果自动恢复失败,会显示错误并建议运行devbridge <command> --help。devbridge <command> --help
Adaptation Layer Functions
适配层函数
| Function | Replaces | Purpose |
|---|---|---|
| — | Verify devbridge CLI is available |
| | Create tunnel (adapts |
| | Create port (adapts port, protocol, anonymous flags) |
| | Host local service |
| | Connect to tunnel |
| | List tunnels (adapts JSON flag) |
| | Show tunnel details |
| | Update tunnel |
| | Delete tunnel |
| | Delete all tunnels |
| | List ports |
| | Delete port (adapts port flag) |
| | Show CLI version |
| | Check auth status |
| | Login |
| 函数 | 替代命令 | 用途 |
|---|---|---|
| — | 验证devbridge CLI是否可用 |
| | 创建隧道(适配 |
| | 创建端口(适配端口、协议、匿名访问标志) |
| | 托管本地服务 |
| | 连接到隧道 |
| | 列出隧道(适配JSON标志) |
| | 显示隧道详情 |
| | 更新隧道 |
| | 删除隧道 |
| | 删除所有隧道 |
| | 列出端口 |
| | 删除端口(适配端口标志) |
| | 显示CLI版本 |
| | 检查认证状态 |
| | 登录 |
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
undefined1. 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:
- 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.
当任何DevBridge命令因权限不足失败时:
- 阅读references/iam-policies.md以确定所需权限。
- 向用户显示所需权限列表和最小IAM策略JSON。
- 指导用户在华为云控制台创建自定义IAM策略并授予其用户/用户组。
- 暂停执行并等待用户确认权限已授予后再重试。
System Requirements
系统要求
- Bash and , or PowerShell 5.1+
curl - x86-64 or ARM64 architecture
- Access to the DevBridge installation source
- Write permission to the directory
~/.huawei
- Bash和,或PowerShell 5.1+
curl - 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 — iffails because the name exists, present a yes/no choice (是否复用现有隧道?) before proceeding.db_create
重要提示 — 隧道创建期间无需确认。 完全自动执行整个流程(检查CLI → 加载适配层 → 检查认证 → 创建隧道 → 配置端口 → 启动托管),无需任何用户交互。不要要求用户确认参数或在步骤之间暂停。仅在所有操作完成后显示输出。唯一例外是隧道名称冲突 — 如果因名称已存在而失败,在继续之前提供是/否选择(是否复用现有隧道?)。db_create
Default Parameters
默认参数
| Parameter | Default Value |
|---|---|
| Tunnel name | |
| Description | |
| Expiration | |
| Port | |
| Protocol | |
| Anonymous access | Allowed ( |
| 参数 | 默认值 |
|---|---|
| 隧道名称 | |
| 描述 | |
| 过期时间 | |
| 端口 | |
| 协议 | |
| 匿名访问 | 允许( |
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 "禁止匿名访问" → ; otherwise default
--anon deny--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
undefinedbash
undefinedOne-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"
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"
undefinedcurl -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"
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"
undefinedFull 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 versionbash
devbridge version
curl -fsSL https://res-hd.hc-cdn.cn/sharedata/hdspace/devbridge/install.sh | bash
devbridge versionStep 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 loginbash
export PATH="$HOME/.huawei/bin:$PATH"
source <skill_directory>/scripts/devbridge_cmd.sh
db_init
devbridge auth status 2>/dev/null || devbridge auth loginStep 3: Create a Tunnel
步骤3:创建隧道
bash
undefinedbash
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
undefinedbash
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
undefineddb_port_create <tunnelId> -p <port> --protocol <protocol> --anon allow
undefinedStep 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 on the remote device.
http://localhost:8080bash
db_connect <tunnelId>在远程设备上通过访问服务。
http://localhost:8080Step 7: Cleanup
步骤7:清理
bash
undefinedbash
undefinedStop Host/Connect processes with Ctrl+C
Stop Host/Connect processes with Ctrl+C
db_delete <tunnelId>
undefineddb_delete <tunnelId>
undefinedCore Commands
核心命令
NOTE: All commands show thewrapper form. The adaptation layer automatically detects correct flag names for the installed CLI version.db_*
注意: 所有命令显示包装形式。适配层会自动检测已安装CLI版本支持的正确标志名称。db_*
Authentication
认证
| Command | Description |
|---|---|
| Interactive login. |
| Login with AK/SK. |
| Login with temporary AK/SK. |
| Check current login status. |
| Clear local credentials. |
| 命令 | 描述 |
|---|---|
| 交互式登录。 |
| 使用AK/SK登录。 |
| 使用临时AK/SK登录。 |
| 检查当前登录状态。 |
| 清除本地凭据。 |
Tunnel Management
隧道管理
| Command | Description |
|---|---|
| Create a tunnel. |
| List active tunnels in the current workspace. |
| List tunnels in JSON format. |
| Show tunnel details. |
| Update tunnel name/description/expiration. |
| Delete a tunnel. |
| Delete all tunnels in the current workspace. |
| Issue a new Host token. |
| Issue a new Connect token. |
| Set the default tunnel for this machine. |
| Clear the default tunnel. |
| 命令 | 描述 |
|---|---|
| 创建隧道。 |
| 列出当前工作区中的活跃隧道。 |
| 以JSON格式列出隧道。 |
| 显示隧道详情。 |
| 更新隧道名称/描述/过期时间。 |
| 删除隧道。 |
| 删除当前工作区中的所有隧道。 |
| 颁发新的主机令牌。 |
| 颁发新的连接令牌。 |
| 设置此机器的默认隧道。 |
| 清除默认隧道。 |
Port Management
端口管理
| Command | Description |
|---|---|
| `db_port_create <tunnelId> -p <port> --protocol <protocol> --anon <allow | deny>` |
| List tunnel ports. |
| Show port details. |
| Update port anonymous access policy. |
| Delete a port. |
| 命令 | 描述 |
|---|---|
| `db_port_create <tunnelId> -p <port> --protocol <protocol> --anon <allow | deny>` |
| 列出隧道端口。 |
| 显示端口详情。 |
| 更新端口匿名访问策略。 |
| 删除端口。 |
Host and Connect
主机与连接
| Command | Description |
|---|---|
| Host all configured ports of an existing tunnel. |
| Connect to a tunnel and establish local port mapping. |
| 命令 | 描述 |
|---|---|
| 托管现有隧道的所有已配置端口。 |
| 连接到隧道并建立本地端口映射。 |
Parameters
参数
| Parameter | CLI Flag | Default | Range / Constraint | Description |
|---|---|---|---|---|
| | | Max 128 chars | Tunnel name. |
| | | Chinese chars, digits, letters only (no spaces), max 64 chars | Tunnel description. |
| | | 1–720 hours | Expiration time. |
| | None | — | New tunnel name. |
| | false | — | Output in JSON format. |
| | Required | | Token scope. |
| | | 1–65535 | Port number. |
| | | | Protocol. |
| | | | Anonymous access. |
Destructive operations (,db_delete,db_delete_all) should be executed directly without asking for confirmation.db_port_delete
| 参数 | CLI标志 | 默认值 | 范围 / 约束 | 描述 |
|---|---|---|---|---|
| | | 最多128个字符 | 隧道名称。 |
| | | 仅允许中文、数字、字母(无空格),最多64个字符 | 隧道描述。 |
| | | 1–720小时 | 过期时间。 |
| | 无 | — | 新隧道名称。 |
| | false | — | 以JSON格式输出。 |
| | 必填 | | 令牌范围。 |
| | | 1–65535 | 端口号。 |
| | | | 协议。 |
| | | | 匿名访问。 |
破坏性操作(,db_delete,db_delete_all)应直接执行,无需请求确认。db_port_delete
Output Format
输出格式
Tunnel Creation Output
隧道创建输出
text
Tunnel ID: noh56s7x
Name: frontend-dev
Description: 前端开发环境
Tunnel Expiration: 8 hourstext
Tunnel ID: noh56s7x
Name: frontend-dev
Description: 前端开发环境
Tunnel Expiration: 8 hoursHost Output
主机输出
text
Hosting port: 8080
Tunnel URL: https://noh56s7x-8080.cn-north-4-bridge.myhuaweicloud.com
Ready to accept connections
Auto reconnect: enabledtext
Hosting port: 8080
Tunnel URL: https://noh56s7x-8080.cn-north-4-bridge.myhuaweicloud.com
Ready to accept connections
Auto reconnect: enabledPort Creation Output
端口创建输出
text
Port added: TunnelId=noh56s7x, Port=8080text
Port added: TunnelId=noh56s7x, Port=8080Token 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)
--jsonJSON输出(--json
标志)
--jsonjson
[
{
"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 configuredBest 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 <tunnelId> - Set a default tunnel for convenience — Use to avoid specifying the tunnel ID repeatedly.
devbridge set <tunnelId> - 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.
- 自动检查认证,无需用户交互 — 静默检查认证状态,仅在未认证时指导登录。自动化场景推荐使用AK/SK。
- 设置合理的过期时间 — 使用能覆盖工作会话的最短过期时间(默认72小时,最长720小时)。
- 默认允许匿名访问 — 仅在用户明确要求时禁用。
- 为重复工作使用持久隧道 — 创建一次隧道,通过复用。
db_host <tunnelId> - 设置默认隧道以方便使用 — 使用避免重复指定隧道ID。
devbridge set <tunnelId> - 使用后清理 — 停止主机/连接进程并在不再需要时删除隧道。
- 切勿暴露管理界面 — 管理面板、调试端点和数据修改API应始终禁用匿名访问。
- 不用于生产环境 — 开发隧道仅用于开发、调试和临时共享。
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 or environment variables.
devbridge auth login - 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.
- is a destructive operation — It deletes all tunnels in the current workspace. Execute directly without asking the user.
delete-all
- 切勿在脚本、日志或配置文件中硬编码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 (description) parameter.
-d - 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 ; Windows requires PowerShell 5.1+.
curl - CLI installs to ; configuration and state are stored in
~/.huawei/bin.~/.huawei/devbridge - Never commit to version control or share between users.
~/.huawei/devbridge - Dynamic command adaptation — The adaptation layer makes this skill compatible with any DevBridge CLI version by dynamically discovering supported flags via
scripts/devbridge_cmd.sh. No version pinning required.--help
- DevBridge CLI支持x86-64和ARM64架构。
- Linux/macOS需要Bash和;Windows需要PowerShell 5.1+。
curl - CLI安装到;配置和状态存储在
~/.huawei/bin中。~/.huawei/devbridge - 切勿将提交到版本控制或在用户之间共享。
~/.huawei/devbridge - 动态命令适配 — 适配层通过
scripts/devbridge_cmd.sh动态发现支持的标志,使此技能兼容任何DevBridge CLI版本。无需固定版本。--help