← 返回
AI智能 Key 中文

E2B Desktop

Control E2B Desktop sandboxes (virtual Linux desktops) for computer-use agents. Use when you need to create/manage sandboxed desktop environments, take scree...
E2B Desktop 沙箱控制工具,用于管理虚拟 Linux 桌面环境,支持创建沙盒环境、屏幕捕获等操作。
eyhn
AI智能 clawhub v1.0.0 1 版本 100000 Key: 需要
★ 0
Stars
📥 799
下载
💾 38
安装
1
版本
#latest

概述

E2B Desktop Skill

Control a headless Linux desktop (Ubuntu + XFCE) via the e2b-desktop Python SDK.

All scripts live in scripts/ and wrap the SDK in bash for easy agent use.

Prerequisites

pip install e2b-desktop
export E2B_API_KEY=e2b_***

State Management

  • start_sandbox.sh saves the sandbox ID to ~/.e2b_state
  • All other scripts auto-load it from there
  • Override anytime with export E2B_SANDBOX_ID=
  • Sandboxes survive script exit — reconnect with Sandbox.connect(sandbox_id)

Scripts

ScriptUsageDescription
---------
start_sandbox.sh[--resolution 1280x800] [--timeout 300] [--stream]Create sandbox; optionally start VNC stream
kill_sandbox.sh[SANDBOX_ID]Kill sandbox and remove state
screenshot.sh[OUTPUT_FILE]Take screenshot → PNG (default: /tmp/e2b_screenshot.png)
click.shX YLeft click at coordinates
right_click.shX YRight click
double_click.shX YDouble click
middle_click.shX YMiddle click
move_mouse.shX YMove cursor (no click)
drag.shX1 Y1 X2 Y2Click-drag between two points
scroll.shAMOUNTScroll (positive=up, negative=down)
type_text.sh"text"Type text at current cursor
press_key.shKEY [KEY2...]Press key or combo (e.g. ctrl c)
run_command.sh"cmd"Run shell command inside sandbox
open_url.shURL_OR_PATHOpen URL or file in default app
launch_app.shAPP_NAMELaunch app (e.g. firefox, vscode)
stream_start.sh[--auth]Start VNC stream; --auth for password-protected
stream_stop.sh_(none)_Stop VNC stream
get_cursor.sh_(none)_Print CURSOR_X and CURSOR_Y
get_screen_size.sh_(none)_Print SCREEN_WIDTH and SCREEN_HEIGHT
list_windows.sh[APP_NAME]List app windows or show active window
wait.shMILLISECONDSWait N ms (sandbox-side)

Computer-Use Agent Loop Pattern

SCRIPTS="skills/e2b-desktop/scripts"

# 1. Start sandbox
source <($SCRIPTS/start_sandbox.sh --resolution 1280x800 --stream)
echo "Sandbox: $SANDBOX_ID"
echo "View at: $STREAM_URL"

# 2. Agent loop
while true; do
  # Capture screen
  $SCRIPTS/screenshot.sh /tmp/screen.png

  # Send to LLM, parse action... (your code)
  ACTION=$(llm_decide /tmp/screen.png)

  case "$ACTION" in
    click:*)   IFS=: read -r _ x y <<< "$ACTION"; $SCRIPTS/click.sh $x $y ;;
    type:*)    $SCRIPTS/type_text.sh "${ACTION#type:}" ;;
    key:*)     $SCRIPTS/press_key.sh ${ACTION#key:} ;;
    done)      break ;;
  esac
done

# 3. Clean up
$SCRIPTS/kill_sandbox.sh

Key Notes

  • scroll.sh AMOUNT: positive = scroll up, negative = scroll down (matches desktop.scroll(amount) API)
  • press_key.sh ctrl c: multiple args become a key combo via desktop.press(["ctrl", "c"])
  • run_command.sh exits with the sandbox command's exit code
  • All mouse coordinate scripts accept integer pixel coordinates matching sandbox resolution
  • VNC stream: only one active stream at a time; stop before switching windows

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 01:51 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,353 📥 317,888
developer-tools

Steel Browser

eyhn
通过 Steel.dev 控制云浏览器会话,实现 Web 自动化和计算机使用代理。适用于需要浏览网页、填写表单、点击元素等场景。
★ 0 📥 828
ai-intelligence

ontology

oswalpalash
类型化知识图谱,用于结构化智能体记忆与可组合技能。支持创建/查询实体(人员、项目、任务、事件、文档)及关联...
★ 710 📥 243,636