360 Secure SkillHub
360 安全技能中心

vscode-tunnel

该 Skill 提供 tunnel.sh 脚本,通过 start/stop/status/log 子命令在 Docker 容器内启动、停止 VS Code Remote Tunnel 并查看状态与日志,隧道名称可由命令行参数或环境变量指定;首次使用需 Microsoft 账号授权,隧道在后台运行;依赖 curl、tar、grep 下载并解压 VS Code CLI,仅声明支持 Linux x64。

listky
listky
热度 78.61
最近更新 2026-05-17 12:27:01
分类:开发依赖:代码执行 / 第三方 API / 读写文件应用场景:DevOps / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add vscode-tunnel
Metadata
name
vscode-tunnel
description
Start VS Code Remote Tunnel in Docker containers for remote terminal access

VS Code Tunnel

Start a VS Code Remote Tunnel in Docker container environments, enabling remote terminal access through VS Code.

Trigger Phrases

  • "start vscode tunnel"
  • "open vscode tunnel"
  • "connect vscode"
  • "launch code tunnel in container"
  • "vscode remote"

Commands

# Start tunnel (interactive name prompt)
bash /path/to/tunnel.sh start

# Start tunnel with specific name
bash /path/to/tunnel.sh start my-tunnel-name

# Stop tunnel
bash /path/to/tunnel.sh stop

# View status
bash /path/to/tunnel.sh status

# View logs
bash /path/to/tunnel.sh log

Environment Variables

Variable Description Default
VSCODE_TUNNEL_NAME Tunnel name Interactive input
VSCODE_CLI_DIR CLI installation directory ~/.vscode-cli

Usage Examples

User: start vscode tunnel
Agent: Starting VS Code Tunnel...
[Executes: bash tunnel.sh start]
Agent: Tunnel started. Please enter this code in VS Code to authorize: xxxx-xxxx
User: launch a tunnel named dev-env
Agent: Starting tunnel dev-env...
[Executes: bash tunnel.sh start dev-env]

Commands Reference

Command Description
start [name] Start tunnel with optional name
stop Stop running tunnel
status Display tunnel status
log View tunnel logs (live)

Dependencies

  • curl - Download CLI
  • tar - Extract CLI
  • grep - Log processing

Notes

  1. First-time startup requires Microsoft account authorization
  2. Authorization code will be displayed in the log output
  3. Tunnel runs in background; needs restart after container reboot

Platform Support

  • Linux x64 (Alpine/Debian/Ubuntu)
  • Docker container environments