{"skill":{"slug":"e2b-desktop","displayName":"E2B Desktop","summary":"Control E2B Desktop sandboxes (virtual Linux desktops) for computer-use agents. Use when you need to create/manage sandboxed desktop environments, take scree...","description":"---\nname: e2b-desktop\ndescription: Control E2B Desktop sandboxes (virtual Linux desktops) for computer-use agents. Use when you need to create/manage sandboxed desktop environments, take screenshots, perform mouse/keyboard actions, run commands, stream VNC output, or build computer-use agent loops with E2B Desktop SDK.\n---\n\n# E2B Desktop Skill\n\nControl a headless Linux desktop (Ubuntu + XFCE) via the `e2b-desktop` Python SDK.\nAll scripts live in `scripts/` and wrap the SDK in bash for easy agent use.\n\n## Prerequisites\n\n```bash\npip install e2b-desktop\nexport E2B_API_KEY=e2b_***\n```\n\n## State Management\n\n- `start_sandbox.sh` saves the sandbox ID to `~/.e2b_state`\n- All other scripts auto-load it from there\n- Override anytime with `export E2B_SANDBOX_ID=<id>`\n- Sandboxes survive script exit — reconnect with `Sandbox.connect(sandbox_id)`\n\n## Scripts\n\n| Script | Usage | Description |\n|---|---|---|\n| `start_sandbox.sh` | `[--resolution 1280x800] [--timeout 300] [--stream]` | Create sandbox; optionally start VNC stream |\n| `kill_sandbox.sh` | `[SANDBOX_ID]` | Kill sandbox and remove state |\n| `screenshot.sh` | `[OUTPUT_FILE]` | Take screenshot → PNG (default: `/tmp/e2b_screenshot.png`) |\n| `click.sh` | `X Y` | Left click at coordinates |\n| `right_click.sh` | `X Y` | Right click |\n| `double_click.sh` | `X Y` | Double click |\n| `middle_click.sh` | `X Y` | Middle click |\n| `move_mouse.sh` | `X Y` | Move cursor (no click) |\n| `drag.sh` | `X1 Y1 X2 Y2` | Click-drag between two points |\n| `scroll.sh` | `AMOUNT` | Scroll (positive=up, negative=down) |\n| `type_text.sh` | `\"text\"` | Type text at current cursor |\n| `press_key.sh` | `KEY [KEY2...]` | Press key or combo (e.g. `ctrl c`) |\n| `run_command.sh` | `\"cmd\"` | Run shell command inside sandbox |\n| `open_url.sh` | `URL_OR_PATH` | Open URL or file in default app |\n| `launch_app.sh` | `APP_NAME` | Launch app (e.g. `firefox`, `vscode`) |\n| `stream_start.sh` | `[--auth]` | Start VNC stream; `--auth` for password-protected |\n| `stream_stop.sh` | _(none)_ | Stop VNC stream |\n| `get_cursor.sh` | _(none)_ | Print `CURSOR_X` and `CURSOR_Y` |\n| `get_screen_size.sh` | _(none)_ | Print `SCREEN_WIDTH` and `SCREEN_HEIGHT` |\n| `list_windows.sh` | `[APP_NAME]` | List app windows or show active window |\n| `wait.sh` | `MILLISECONDS` | Wait N ms (sandbox-side) |\n\n## Computer-Use Agent Loop Pattern\n\n```bash\nSCRIPTS=\"skills/e2b-desktop/scripts\"\n\n# 1. Start sandbox\nsource <($SCRIPTS/start_sandbox.sh --resolution 1280x800 --stream)\necho \"Sandbox: $SANDBOX_ID\"\necho \"View at: $STREAM_URL\"\n\n# 2. Agent loop\nwhile true; do\n  # Capture screen\n  $SCRIPTS/screenshot.sh /tmp/screen.png\n\n  # Send to LLM, parse action... (your code)\n  ACTION=$(llm_decide /tmp/screen.png)\n\n  case \"$ACTION\" in\n    click:*)   IFS=: read -r _ x y <<< \"$ACTION\"; $SCRIPTS/click.sh $x $y ;;\n    type:*)    $SCRIPTS/type_text.sh \"${ACTION#type:}\" ;;\n    key:*)     $SCRIPTS/press_key.sh ${ACTION#key:} ;;\n    done)      break ;;\n  esac\ndone\n\n# 3. Clean up\n$SCRIPTS/kill_sandbox.sh\n```\n\n## Key Notes\n\n- `scroll.sh AMOUNT`: positive = scroll up, negative = scroll down (matches `desktop.scroll(amount)` API)\n- `press_key.sh ctrl c`: multiple args become a key combo via `desktop.press([\"ctrl\", \"c\"])`\n- `run_command.sh` exits with the sandbox command's exit code\n- All mouse coordinate scripts accept integer pixel coordinates matching sandbox resolution\n- VNC stream: only one active stream at a time; stop before switching windows\n","topics":["Sdk"],"tags":{"latest":"1.0.0"},"stats":{"comments":0,"downloads":889,"installsAllTime":33,"installsCurrent":1,"stars":0,"versions":1},"createdAt":1772363982092,"updatedAt":1779077470134},"latestVersion":{"version":"1.0.0","createdAt":1772363982092,"changelog":"Initial release: control E2B cloud Linux desktop with shell scripts for screenshot, mouse/keyboard, VNC stream, and shell commands","license":null},"metadata":null,"owner":{"handle":"eyhn","userId":"s179tay9kh4xgr5mhs5q7zwknh885n71","displayName":"EYHN","image":"https://avatars.githubusercontent.com/u/13579374?v=4"},"moderation":{"isSuspicious":false,"isMalwareBlocked":false,"verdict":"clean","reasonCodes":["review.llm_review"],"summary":"Review: review.llm_review","engineVersion":"v2.4.24","updatedAt":1779969212352}}